From f6362fda5d3a1c52c01bb4f601dff2cfec42dccd Mon Sep 17 00:00:00 2001 From: Hellow Date: Tue, 29 Nov 2022 19:30:20 +0100 Subject: [PATCH] hopefully fixed timeout in musify --- src/music_kraken/audio_source/sources/musify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/music_kraken/audio_source/sources/musify.py b/src/music_kraken/audio_source/sources/musify.py index 6198f57..bc8851b 100644 --- a/src/music_kraken/audio_source/sources/musify.py +++ b/src/music_kraken/audio_source/sources/musify.py @@ -147,8 +147,11 @@ class Musify(AudioSource): # download the audio data logger.info(f"downloading: '{url}'") try: - r = session.get(url, timeout=15) - except requests.exceptions.ConnectionError or requests.exceptions.ReadTimeout: + r = session.get(url, timeout=TIMEOUT) + except requests.exceptions.ConnectionError: + return False + except requests.exceptions.ReadTimeout: + logger.warning(f"musify server didn't respond after {TIMEOUT} seconds") return False if r.status_code != 200: if r.status_code == 404: