Merge pull request #275 from harry0703/dev

add timeout
This commit is contained in:
Harry 2024-04-17 10:56:18 +08:00 committed by GitHub
commit a44016a7cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,7 +51,7 @@ def search_videos(search_term: str,
logger.info(f"searching videos: {query_url}, with proxies: {proxies}")
try:
r = requests.get(query_url, headers=headers, proxies=proxies, verify=False)
r = requests.get(query_url, headers=headers, proxies=proxies, verify=False, timeout=(30, 60))
response = r.json()
video_items = []
if "videos" not in response: