This commit is contained in:
Lars Noack 2022-11-08 14:44:33 +01:00
parent 2f1d97b67b
commit 63f30bffba

View File

@ -52,7 +52,10 @@ def get_download_link(default_url):
def download_from_musify(file, url): def download_from_musify(file, url):
logging.info(f"downloading: '{url}'") logging.info(f"downloading: '{url}'")
r = session.get(url) try:
r = session.get(url, timeout=15)
except requests.exceptions.ConnectionError:
return -1
if r.status_code != 200: if r.status_code != 200:
if r.status_code == 404: if r.status_code == 404:
logging.warning(f"{r.url} was not found") logging.warning(f"{r.url} was not found")