From 15bbb8392baf817a6810a6238a4fc995dd38d25a Mon Sep 17 00:00:00 2001 From: uh_wot <3631986-uh_wot@users.noreply.gitlab.com> Date: Sat, 29 Feb 2020 21:58:10 +0100 Subject: [PATCH] oops, merged stuff without checking first --- deemix/app/downloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index 269583b..679380c 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -286,7 +286,7 @@ def downloadTrackObj(trackAPI, settings, overwriteBitrate=False, extraTrack=None if not os.path.isfile(track['album']['picPathLocal']): with open(track['album']['picPathLocal'], 'wb') as f: try: - f.write(urlopen(track['album']['picUrl'].replace(f"{settings['embeddedArtworkSize']}x{settings['embeddedArtworkSize']}", f"{settings['localArtworkSize']}x{settings['localArtworkSize']}")).read()) + f.write(get(track['album']['picUrl'].replace(f"{settings['embeddedArtworkSize']}x{settings['embeddedArtworkSize']}", f"{settings['localArtworkSize']}x{settings['localArtworkSize']}")).content) except HTTPError: track['album']['picPathLocal'] = None # Save artist art @@ -296,7 +296,7 @@ def downloadTrackObj(trackAPI, settings, overwriteBitrate=False, extraTrack=None if not os.path.isfile(track['album']['artist']['picPathLocal']): with open(track['album']['artist']['picPathLocal'], 'wb') as f: try: - f.write(urlopen(track['album']['artist']['picUrl']).read()) + f.write(get(track['album']['artist']['picUrl']).content) except HTTPError: track['album']['artist']['picPathLocal'] = None