jonathanjordan21 commited on
Commit
47bf472
·
verified ·
1 Parent(s): 7a4ba1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -392,7 +392,7 @@ async def google_search(q: str, delimiter: str = "\n---\n", sites: Annotated[lis
392
 
393
 
394
  @app.get("/google_search_urls")
395
- async def google_search_url(q: str, sites: Annotated[list[str] | None, Query()] = None, start:int = 0):
396
  url = f"https://www.google.com/search?start={start}&q={q} "
397
 
398
  if sites:
@@ -401,7 +401,7 @@ async def google_search_url(q: str, sites: Annotated[list[str] | None, Query()]
401
  res = requests.get(
402
  url,
403
  headers={
404
- "user-agent": "Googlebot",
405
  "accept-language": "en-US"
406
  },
407
  timeout=(10, 27),
 
392
 
393
 
394
  @app.get("/google_search_urls")
395
+ async def google_search_url(q: str, sites: Annotated[list[str] | None, Query()] = None, start:int = 0, user_agent="Twitterbot"):
396
  url = f"https://www.google.com/search?start={start}&q={q} "
397
 
398
  if sites:
 
401
  res = requests.get(
402
  url,
403
  headers={
404
+ "user-agent": user_agent,
405
  "accept-language": "en-US"
406
  },
407
  timeout=(10, 27),