fixes: #159 Refactored grab_playlist (#160)

* Refactored grab_playlist

grab_playlist was looping through the user's playlist until it finds the playlist.
In some cases a public playlist isn't in the user's playlists
Using a more direct approach, querying for the tracks of a playlist

* Remove old `def write_playlist()`

* Playlist URL download now works on private playlists
This commit is contained in:
fanlp3
2017-11-29 23:19:38 -05:00
committed by Ritiek Malhotra
parent 7d7f4b75f7
commit 6ac60000e6
2 changed files with 10 additions and 25 deletions

View File

@@ -160,7 +160,7 @@ https://open.spotify.com/track/0fbspWuEdaaT9vfmbAZr1C
#### Download playlists
- You can copy the Spotify URL of the playlist and pass it in `--playlist` option. Note: This method will not work with playlists set to private only or with collaborative playlists (since they cannot be set be publicly visible).
- You can copy the Spotify URL of the playlist and pass it in `--playlist` option. Note: This method works for public as well as private playlists.
For example
@@ -186,7 +186,7 @@ For example
- You can also load songs using Spotify username if you don't have the playlist URL. (Open profile in Spotify, click on the three little dots below name, "Share", "Copy to clipboard", paste last numbers or text into command-line: `https://open.spotify.com/user/0123456790`)
- Try running `python3 spotdl.py -u <your_username>`, it will show all your public playlists (which excludes collaborative and private playlists).
- Try running `python3 spotdl.py -u <your_username>`, it will (only) show all your public playlists (which excludes collaborative and private playlists).
- Once you select the one you want to download, the script will load all the tracks from the playlist into `<playlist_name>.txt`.