Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cover art download #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

pauloup
Copy link

@pauloup pauloup commented Jun 15, 2019

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.

lavolp3 added a commit to lavolp3/spotify-ripper that referenced this pull request Jun 27, 2019
Fix cover art download  PR hbashton#53
@adan89lion
Copy link

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

@pauloup
Copy link
Author

pauloup commented Jun 29, 2019

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

@adan89lion
Copy link

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

@pauloup
Copy link
Author

pauloup commented Jun 30, 2019

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

@Faeb35
Copy link

Faeb35 commented Oct 29, 2019

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?

@pauloup
Copy link
Author

pauloup commented Apr 1, 2020

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.

@lavolp3
Copy link

lavolp3 commented Apr 7, 2020

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

lavolp3 added a commit to lavolp3/spotify-ripper that referenced this pull request Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants