SolidHal / spotify-ripper

Command-line ripper for Spotify, with a workaround for playlist emptying
MIT License
80 stars 22 forks source link

playlist download #25

Open ramonskie opened 6 years ago

ramonskie commented 6 years ago

i'm using the nice ripper for a long time. and since the beginning of this week it failed to download the playlists

Logging in...
Logged in as 1131828447
Loading playlist...
Loading playlist...
Logging out...

i tried the export SPOTIPY_CLIENT_ID and secrets etc (creating my own credenials ofcourse. got the latest spotipy-2.4.4 as the pip install/upgrade only install 2.0.5 for some reason.

but no luck so far. any other ideas?

ramonskie commented 6 years ago

each track still works.

so for my current workaround is select all the songs im my spotify playlist (in the spotify client) the right click share>copy spotify uris past that to a txt file and use that with spotify-ripper

oglomov commented 6 years ago

Using the remove from playlist workaround does not seem to work for me. Also, I have tried copying all URIs in a text file and use this: spotify-ripper --flat-with-index -l list_of_uris.txt it starts downloading but after the first track it stops with the message below, no idea what that means though, if someone has a clue?

ID3 v2.4: 8 frames Writing ID3 version v2.4

Exception in thread SpotifyRipperThread: Traceback (most recent call last): File "/Users/XXXXXXXXXXX/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/Users/XXXXXXXXXXX/.pyenv/versions/2.7.10/lib/python2.7/site-packages/spotify_ripper/ripper.py", line 366, in run self.post.remove_tracks_from_playlist() File "/Users/XXXXXXXXXXX/.pyenv/versions/2.7.10/lib/python2.7/site-packages/spotify_ripper/post_actions.py", line 287, in remove_tracks_from_playlist remove_all_from_playlist(ripper.session.user.canonical_name, ripper.playlist_uri) File "/Users/XXXXXXXXXXX/.pyenv/versions/2.7.10/lib/python2.7/site-packages/spotify_ripper/remove_all_from_playlist.py", line 19, in remove_all_from_playlist tracks = get_playlist_tracks(username, playlistURI) File "/Users/XXXXXXXXXXX/.pyenv/versions/2.7.10/lib/python2.7/site-packages/spotify_ripper/remove_all_from_playlist.py", line 31, in get_playlist_tracks p1, p2, p3, p4, rPlaylistID = playlistURI.split(':', 5) AttributeError: 'NoneType' object has no attribute 'split'

ramonskie commented 6 years ago

try using python 3.6.x

oglomov commented 6 years ago

Thanks, tried with 3.6.1 still no luck :( On the other hand, I realized that I was skipping the "export" commands, so it seems that the remove from playlists actually works.

tom-schaek commented 6 years ago

i had the exact same problem where playlists wouldn't download and fixed it by doing: $ pip install --upgrade git+https://github.com/SolidHal/spotify-ripper After that i made a new app and keys here https://developer.spotify.com/dashboard/applications and added them.

tuxruffian commented 6 years ago

I also had the same problem. I tried all of the sugestions above with no luck, but found I was able to resolve the issue by using a variant of tom-schaek's solution. Instead of using install --upgrade (which didn't work for me), I used install --force-reinstall.

Full command:

pip install --force-reinstall git+https://github.com/SolidHal/spotify-ripper

Apparently re-installing each of the dependencies did the trick. I suspect it was either mutagen and/or the schedule python module(s).

ramonskie commented 6 years ago

unfortunately non of the reinstall options worked for me

dstyp commented 6 years ago

Seems to work for me but related question - how get redirect uri when running spotify-ripper on a headless remote server? :)

elkenj commented 6 years ago

@oglomov an exception is thrown because the script treats every URI it encounters as a playlist and tries to extract info from the URI that is not present.

As a workaround to the workaround, you can edit "/Users/XXXXXXXXXXX/.pyenv/versions/2.7.10/lib/python2.7/site-packages/spotify_ripper/remove_all_from_playlist.py" and change the remove_all_from_playlist function to:

def remove_all_from_playlist(username, playlistURI):
    pass

Frankly, I don't see why the ripper should empty any playlists anyway.

cukabeka commented 5 years ago

Well, same here. I use this on a mac and reinstalled. Now i get this message

You need to set your credentials. You can do this by
            setting environment variables like so:

            export SPOTIPY_CLIENT_ID='your-spotify-client-id'
            export SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'
            export SPOTIPY_REDIRECT_URI='your-app-redirect-url'

2 issues here

I found in the Dashboard

Redirect URIs
https://example.com/callback/
White-listed addresses to redirect to after authentication success OR failure (e.g. http://mysite.com/callback/)

But I have no idea what to insert in the export command or in the dashboard (once the export command works ;) )

ramonskie commented 5 years ago

this project is dead so i suggest use the work arround i provided https://github.com/SolidHal/spotify-ripper/issues/25#issuecomment-393535012 or use this updated fork https://github.com/wolfmanx/spotify-ripper/tree/pr-collect

cukabeka commented 5 years ago
def remove_all_from_playlist(username, playlistURI):
    pass

But the actual path was /usr/local/lib/python3.7/site-packages/spotify_ripper/remove_all_from_playlist.py I could not find that here in the thread before.

This helped me indeed. Thanks. So is the wolfmanx fork the most updated and working version of the spotify-ripper? Actually, it could be possible to integrate the "Create text file from all URIs in Playlist" step into the script, too, right?

pualien commented 5 years ago

take a look at this simple gist in python to easily recover a file full of spotify uris from playlist