To get the playlist tracks, you'll first need the playlist ID. To get the playlist ID, just right-click the playlist and goto Share -> Playlist URL. The URL will be something like
https://open.spotify.com/user/X/playlist/Y?si=Z
The playlist ID you need is Y
.
Take that playlist ID and goto the Spotify Developer page. At the bottom click Get Token and choose the playlist permissions, and then sign-in so it fills out your token. You'll be asked to specify the Scopes, just select the ones that have to do with playlists.
Now in the Spotify Developer page, enter in the playlist ID under playlist_id, set the limit to 100. To get the results then, just click Try It, the button at the bottom. Now you'll see a bunch of JSON below, just copy that into a file and save it as spotify_playlist.json
or something.
Pre-requisites for this script:
pip install youtube-dl requests-html
And then to run
python getplaylist.py ./spotifyplaylist.json