Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ app.add_middleware(
|
|
24 |
)
|
25 |
|
26 |
@app.get("/linkedin_post_details")
|
27 |
-
async def linkedin_post_details(post_id: str, url: Optional[str] = None):
|
28 |
if not url:
|
29 |
url = "https://www.linkedin.com/posts/"+post_id
|
30 |
res = requests.get(url, headers={"user-agent":"Googlebot", "accept-language": "en-US"})
|
@@ -122,7 +122,7 @@ async def linkedin_post_details(post_id: str, url: Optional[str] = None):
|
|
122 |
|
123 |
|
124 |
@app.get("/facebook_post_detail")
|
125 |
-
async def fb_post_detail(username: str, post_id: str, url: Optional[str] = None):
|
126 |
if not url:
|
127 |
url = f"https://www.facebook.com/{username}/posts/{post_id}"
|
128 |
user_agent = "Googlebot"
|
@@ -197,7 +197,7 @@ async def fb_post_detail(username: str, post_id: str, url: Optional[str] = None)
|
|
197 |
|
198 |
|
199 |
@app.get("/google_search")
|
200 |
-
async def google_search(q: str, delimiter: str = "\n---\n", sites: Annotated[list[str] | None, Query()] = None):
|
201 |
print(sites)
|
202 |
print(type(sites))
|
203 |
url = f"https://www.google.com/search?q={q} "
|
@@ -221,7 +221,7 @@ async def google_search(q: str, delimiter: str = "\n---\n", sites: Annotated[lis
|
|
221 |
|
222 |
|
223 |
@app.get("/tiktok_video_details")
|
224 |
-
async def tiktok_video_details(username: str, video_id:str, url: Optional[str] = None):
|
225 |
if not url:
|
226 |
if username[0] != "@":
|
227 |
username = "@" + username
|
|
|
24 |
)
|
25 |
|
26 |
@app.get("/linkedin_post_details")
|
27 |
+
async def linkedin_post_details(post_id: Optional[str] = None, url: Optional[str] = None):
|
28 |
if not url:
|
29 |
url = "https://www.linkedin.com/posts/"+post_id
|
30 |
res = requests.get(url, headers={"user-agent":"Googlebot", "accept-language": "en-US"})
|
|
|
122 |
|
123 |
|
124 |
@app.get("/facebook_post_detail")
|
125 |
+
async def fb_post_detail(username: Optional[str] = None, post_id: Optional[str] = None, url: Optional[str] = None):
|
126 |
if not url:
|
127 |
url = f"https://www.facebook.com/{username}/posts/{post_id}"
|
128 |
user_agent = "Googlebot"
|
|
|
197 |
|
198 |
|
199 |
@app.get("/google_search")
|
200 |
+
async def google_search(q: Optional[str] = None, delimiter: str = "\n---\n", sites: Annotated[list[str] | None, Query()] = None):
|
201 |
print(sites)
|
202 |
print(type(sites))
|
203 |
url = f"https://www.google.com/search?q={q} "
|
|
|
221 |
|
222 |
|
223 |
@app.get("/tiktok_video_details")
|
224 |
+
async def tiktok_video_details(username: Optional[str] = None, video_id:Optional[str] = None, url: Optional[str] = None):
|
225 |
if not url:
|
226 |
if username[0] != "@":
|
227 |
username = "@" + username
|