hopefully fixed timeout in musify

This commit is contained in:
Hellow 2022-11-29 19:30:20 +01:00
parent 8b9e62cc8a
commit f6362fda5d

View File

@ -147,8 +147,11 @@ class Musify(AudioSource):
# download the audio data # download the audio data
logger.info(f"downloading: '{url}'") logger.info(f"downloading: '{url}'")
try: try:
r = session.get(url, timeout=15) r = session.get(url, timeout=TIMEOUT)
except requests.exceptions.ConnectionError or requests.exceptions.ReadTimeout: except requests.exceptions.ConnectionError:
return False
except requests.exceptions.ReadTimeout:
logger.warning(f"musify server didn't respond after {TIMEOUT} seconds")
return False return False
if r.status_code != 200: if r.status_code != 200:
if r.status_code == 404: if r.status_code == 404: