Skip to content

JamFox/spotify-listlister

Repository files navigation

Spotify-ListLister

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.

Installation

  1. Download the source.
  2. 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>
  1. Install dependencies:
    • pip install spotify OR
    • If you have trouble install packages using requirements.txt in a fresh venv.

Usage

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

Play a random list

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.

Random list player installation

  1. First install spotify: pip install spotify-cli
  2. Login using one of its auth methods:
  • spotify auth login OR
  • spotify auth login --client-id XXXXX --client-secret YYYYY

Random list player usage

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks