oops, merged stuff without checking first

This commit is contained in:
uh_wot 2020-02-29 21:58:10 +01:00
parent 1c8fe8fd64
commit 15bbb8392b
1 changed files with 2 additions and 2 deletions

View File

@ -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