spotify-ripper icon indicating copy to clipboard operation
spotify-ripper copied to clipboard

Fix cover art download

Open pauloup opened this issue 6 years ago • 7 comments

I've made some changes to tags.py and fixed the cover art download bug #51.

The bug seemed to be in the image.load function in the main spotify library. It returns True but no data is getting loaded. So I replaced it by a urllib.urlretrieve call that saves the cover art to a temp file, and retrieves the data in a variable image.

I also changed the cover url to get the higher resolution available (640px for now) using the track.album.cover(2) option.

Please let me know if there is any issue.

pauloup avatar Jun 15 '19 03:06 pauloup

I got this error message returned after the download is complete (before tagging the audio file):

Spotify error detected                                    
module 'urllib' has no attribute 'urlretrieve'            
Skipping to next track...                                 
Deleting partially ripped file

adan89lion avatar Jun 29 '19 11:06 adan89lion

@adan89lion Are you sure spotify-ripper is running on python 2.7?

This is common error if you're on python 3+, since it has split urllib into several modules. I think it is preferable to keep the code 2.7 compatible, so please, try running on 2.7 (if this i's the case), and let me know if it works as intended. Thanks for reporting.

pauloup avatar Jun 29 '19 12:06 pauloup

@pauloup Seems like it! Thanks (I thought this python script is compatible with the python 3 version of the ripper).

adan89lion avatar Jun 30 '19 00:06 adan89lion

@adan89lion To make this python 3 compatible, just replace "urllib" by "urllib.request" in the two instances it appears in tags.py

pauloup avatar Jun 30 '19 00:06 pauloup

I just wanted to install this fix, and replaced the tags.py in spotify-ripper/spotify_ripper. But it seams that this is the wrong place as it makes no difference. Even when I rename the tags.py spotify-ripper is still running as before. Does anybody know what I need to do to install this fix?

Faeb35 avatar Oct 29 '19 08:10 Faeb35

I just updated the file tags.py to reflect a recent change in Spotify. The cover art URL now starts with "i.scdn.co", and no more "open.spotify.com.

pauloup avatar Apr 01 '20 02:04 pauloup

@pauloup Thank you for this fix!! I was going crazy about the cover download function not working anymore!

lavolp3 avatar Apr 07 '20 12:04 lavolp3