From 76427aea20d12dd2cb0520e721e051ed36dbf984 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sat, 30 May 2020 18:49:41 +0200 Subject: [PATCH] Fixed library downloading invalid images --- deemix/app/downloader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index 2d82bfd..bee0b3b 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -90,6 +90,7 @@ def downloadImage(url, path, overwrite="n"): if not os.path.isfile(path) or overwrite in ['y', 't']: try: image = get(url, headers={'User-Agent': USER_AGENT_HEADER}, timeout=30) + image.raise_for_status() with open(path, 'wb') as f: f.write(image.content) return path