Skip to content

AliSerwat/Spotify-Playlist-Splitter

Repository files navigation

spotify-playlist-split

Split large Spotify playlists (exported via Exportify) into parts of up to 100 tracks, then import them into Spotify using the desktop paste assistant or the Spotify Web API.

What it does

  1. Split — reads an Exportify CSV, detects the track URI column, and writes part_XX.csv plus part_XX_uris.txt files (100 tracks per part by default).
  2. Publish — creates playlists in Spotify via paste (recommended), api, or auto (API with paste fallback).

Prerequisites

  • Python 3.11+
  • Exportify export of your playlist
  • Spotify desktop app for paste mode

Install

python -m venv .venv
.venv\Scripts\activate          # Windows
# source .venv/bin/activate     # macOS/Linux

pip install -e ".[dev]"

Copy your Exportify CSV to data/playlist.csv (or set INPUT_CSV).

Quick start (notebook)

jupyter notebook notebooks/split_and_publish.ipynb

Run all cells: split, then publish. First-time setup installs the package with %pip install -e ..

Quick start (CLI)

spotify-split split --input data/playlist.csv
spotify-split publish --mode paste

Exportify workflow

  1. Open Exportify and sign in with Spotify.
  2. Export the playlist you want to split.
  3. Save the CSV as data/playlist.csv (or another path and pass --input).
  4. Run split; outputs go to output/playlist_parts/ by default.

See examples/exportify_columns.md for expected CSV columns.

Publish modes

Mode Description
paste Default. Copies track URIs to the clipboard; you paste into new playlists in the Spotify desktop app. No Premium or API credentials required.
api OAuth + Spotify Web API. Requires Premium on the developer app owner account. Set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET in .env.
auto Tries API first; falls back to paste on Premium or network errors.

Copy .env.example to .env and fill in credentials only if you use api or auto:

copy .env.example .env

Set PUBLISH_MODE=api or use spotify-split publish --mode api.

Throne / proxy

  • Paste mode works with Throne TUN + System proxy enabled.
  • API mode uses a dedicated HTTP session with trust_env=False so Spotify requests bypass HTTP_PROXY environment variables. If OAuth still fails behind a proxy, add Spotify domains to your proxy DIRECT rules.

Project layout

├── src/spotify_playlist_split/   # library
├── notebooks/split_and_publish.ipynb
├── data/                         # your CSVs (gitignored)
├── output/                       # generated parts (gitignored)
└── examples/exportify_columns.md

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors