add timeout
This commit is contained in:
@@ -51,7 +51,7 @@ def search_videos(search_term: str,
|
|||||||
logger.info(f"searching videos: {query_url}, with proxies: {proxies}")
|
logger.info(f"searching videos: {query_url}, with proxies: {proxies}")
|
||||||
|
|
||||||
try:
|
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()
|
response = r.json()
|
||||||
video_items = []
|
video_items = []
|
||||||
if "videos" not in response:
|
if "videos" not in response:
|
||||||
|
|||||||
Reference in New Issue
Block a user