Skip to main content

point playola at an article that lists albums, get back an importable playlist file

Project description

playola

point it at an article that lists albums, get back a playlist file you can import into your streaming service. claude reads the article and pulls out the artist/album list, then each album is resolved to its real tracks and written to a CSV + M3U you can import.

apple music ships first (resolved via the free, public itunes search API - no apple developer account, no auth). the service layer is pluggable, so other services can be added without touching the rest of the code.

if you have an apple developer account, playola can also create the playlist directly in your apple music library - --push on a build, or playola push on an existing .m3u8/.csv - so you can skip the converter entirely. see pushing straight into apple music.

install

install it as a standalone command with uv (or pipx, or plain pip):

uv tool install playola        # or: pipx install playola  /  pip install playola

then point it at an anthropic key. playola uses the standard anthropic sdk, so it picks up whatever auth the sdk already sees - the simplest is an env var:

export ANTHROPIC_API_KEY=sk-ant-...

usage

playola https://example.com/best-albums-article

it prompts for a playlist name (the article URL is stored in the playlist description so you can always trace it back), then writes two files into the output directory:

  • <name>.csv - import via a converter such as soundiiz or tunemymusic (both have free tiers), which push the playlist straight into apple music. columns are Title, Artist, Album, Duration, ISRC, URL.
  • <name>.m3u8 - an extended M3U with the apple music track URLs, importable by the macos music app and most players.

build flags (the default subcommand - playola <url> is short for playola build <url>):

flag default meaning
url (positional) prompted the article URL
--name prompted playlist name
--service apple streaming service to resolve against
--out-dir . where to write the files
--model claude-opus-4-8 claude model for extraction (or set --model claude-sonnet-4-6 for a cheaper run)
--push off also create the playlist in your apple music library
--config / --credentials see setup override the apple music config / secrets file locations

albums that can't be confidently matched are skipped and listed at the end so you know what to add by hand.

pushing straight into apple music

the CSV/M3U files above are portable and need zero setup, but importing them still means a manual trip through a converter. with an apple developer account playola can create the playlist directly in your library instead:

playola auth                              # one-time browser sign-in (see below)
playola <url> --name "My List" --push     # build, then push in one shot
playola push out/my-list.m3u8             # or push a file you already have

push reads the apple music catalog id that's already embedded in each track's URL, so no re-resolution happens - it works on any .m3u8/.csv playola wrote (even hand-edited). tracks without a catalog id are skipped and reported.

one-time setup

  1. in the apple developer portal, create a Media Identifier and a MusicKit key, then download the key's .p8 file. note your Team ID and the Key ID.

  2. write two files (defaults under ~/.config/playola/):

    ~/.config/playola/config.toml - non-secret settings:

    credentials_path = "~/.config/playola/credentials.toml"
    storefront = "us"
    # token_path = "~/.config/playola/token.json"   # optional; this is the default
    

    ~/.config/playola/credentials.toml - the secrets:

    team_id = "XXXXXXXXXX"
    key_id = "YYYYYYYYYY"
    private_key_path = "~/.config/playola/AuthKey_YYYYYYYYYY.p8"
    
  3. run playola auth once. a browser opens; sign in with the apple id whose library you want to write to. the resulting Music-User-Token is cached (chmod 600) in token.json and reused.

the user token lasts about six months and can't be renewed; when a push returns "401 ... run playola auth again", just re-run playola auth.

--config and --credentials override the file locations (flag > config.toml pointer > default), so you can keep separate profiles or store secrets elsewhere.

adding another streaming service

  1. subclass MusicService (playola/services/base.py) and implement resolve_album(ref) -> list[Track].
  2. register it in playola/services/__init__.py.

that's the whole contract - extraction and rendering don't care which service produced the tracks.

from source

working on playola itself? clone the repo and let uv manage the environment - no venv to set up by hand:

git clone https://github.com/sulrich/playola
cd playola
uv run playola https://example.com/best-albums-article    # run it
uv run pytest                                             # run the tests

the tests cover the pure logic (CSV/M3U rendering, album match scoring, track ordering, HTML-to-text, response parsing). the network calls (claude, itunes) are exercised by running the tool.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

playola-0.1.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

playola-0.1.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file playola-0.1.0.tar.gz.

File metadata

  • Download URL: playola-0.1.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for playola-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6be53bad07d15fcf7b0a3cdd8f617760a80a814cf73aee610dc6d4dfb18932bb
MD5 dc256db2476d03f0ccc18a2faf12d001
BLAKE2b-256 7f43d83c39621cf49371bcabe065eced6f1c43ad18a8ffdbac02ee99236f1733

See more details on using hashes here.

File details

Details for the file playola-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: playola-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for playola-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 398b3a80dce92a2548e61cfdcaa985afdec8dd9d1af2223723150ecd903ebeba
MD5 7d61cc6f2e8a5592a15b4d6fa8a08cbb
BLAKE2b-256 84750334ea3506cd4581e8943351eb3040a72cb9cb155a46a8769275b60dc1dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page