caseychu / spotify-backup

A Python script that exports all of your Spotify playlists.
MIT License
847 stars 123 forks source link

liked songs #18

Closed AtomicNess123 closed 4 years ago

AtomicNess123 commented 4 years ago

Are "liked songs" copied as a playlist? I couldn't find my liked songs in the exported file. Otherwise, awesome tool.

lamorton commented 4 years ago

It looks like the "liked" songs are located at: https://open.spotify.com/user/{user_id}/collection

I tried substituting 'collection' for 'playlists' in the code, but it doesn't work. There's nothing in the Spotify API reference about it.

Edit: Ahh, it's called 'Saved Music' internally.
https://open.spotify.com/user/{user_id}/tracks is the location, and it requires a separate authentication type, but this should be a few lines changed. I'm working on a PR.

AtomicNess123 commented 4 years ago

Great, thanks! Is this already implemented in the last python script?

lamorton commented 4 years ago

Yes, version I wrote here implements the fix.

AtomicNess123 commented 4 years ago

So it hasn't been merged in the master? I just used the master but can't find where the liked songs are. Which heading does it have? "Liked songs" does not appear. Thanks!

lamorton commented 4 years ago

Ahh, sorry, I linked you to the master instead of feature branch. Note that you need to use the command as

python spotify-backup.py --scope user-library-read

AtomicNess123 commented 4 years ago

Thanks! If I do

python spotify-backup.py playlists.txt

it won't work? Also, what heading do the liked songs have? I can't find them (I have over 2000 tracks!).

lamorton commented 4 years ago

You can put the filename at the end, but you need the --scope user-library-read part in there to get the liked songs -- and then it will only get the liked songs, no other playlists.

lamorton commented 4 years ago

Btw, it looks like this fork has even more features.

AtomicNess123 commented 4 years ago

Thanks so much!

AtomicNess123 commented 4 years ago

You can put the filename at the end, but you need the --scope user-library-read part in there to get the liked songs -- and then it will only get the liked songs, no other playlists.

BTW, it won't work for me. spotify-backup.py: error: argument --scope: invalid choice: 'user-library-read' (choose from 'playlist-read-private', 'playlist-read-collaborative')