From 63f30bffbae20ec3fc368a6093b28e56f0230318 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Tue, 8 Nov 2022 14:44:33 +0100 Subject: [PATCH] asdf --- src/scraping/musify.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scraping/musify.py b/src/scraping/musify.py index 59771e7..1d68ffb 100644 --- a/src/scraping/musify.py +++ b/src/scraping/musify.py @@ -52,7 +52,10 @@ def get_download_link(default_url): def download_from_musify(file, 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 == 404: logging.warning(f"{r.url} was not found")