Lists spotify user's playlists.
Discovered a wonderful Spotify account that had over 6k playlists. Only 200 or so of them are displayed when looking at the profile through Spotify's website or app. Needed a way to list a list of all of their playlists so I can listen to the ones I'm interested in.
- Download the source.
- Create the configuration file:
- Rename listlister.conf.j2 to listlister.conf and fill in the fields. OR
- Create your own configuration file and supply the path to it with
-c
or--cfg
.
Auth configuration is required:
[auth]
id = <App Client ID>
secret = <App Client Secret>
- Install dependencies:
pip install spotify
OR- If you have trouble install packages using requirements.txt in a fresh venv.
Run help:
python listlister.py -h
Which displays how to use the tool:
listlister.py [-h] -u USER [-i] [-t] [-c CFG] [-p] [-o OUT]
List users playlists and write them to file or terminal.
required arguments:
-u USER, --user USER User ID of whose playlists to list.
options:
-h, --help show this help message and exit
-i, --id Print playlist IDs instead of names. Works only for file output without tracks flag.
-t, --tracks Also list tracks inside the playlists.
-c CFG, --cfg CFG Path to configuration file. Defaults to listlister.conf.
-p, --print Output to terminal instead of file if this flag is set.
-o OUT, --out OUT Path to output file. Defaults to playlists-<USER>.out
The second script randomlist.py
can play a random playlist from a file generated by listlister.py
Essentially it will just pick a random line from a file and feed it into the command: spotify play --playlist <Playlist Name>
OR spotify play --uri spotify:playlist:<Playlist ID>
depending on if the "id" argument is set.
- First install spotify:
pip install spotify-cli
- Login using one of its auth methods:
spotify auth login
ORspotify auth login --client-id XXXXX --client-secret YYYYY
Run help: python randomlist.py -h
Which displays how to use it:
randomlist.py [-h] -pl PLAYLISTS [-i]
Play a random playlist from a list.
required arguments:
-pl PLAYLISTS, --playlists PLAYLISTS
List where to pick a playlist from.
options:
-h, --help show this help message and exit
-i, --id Set this flag if playlist list is comprised of IDs not names.