Small Python scripts for preparing a local music library and playlists for an iPod. The scripts are independent; run only the ones you need.
- Python 3.10 or newer.
mutagenfororganize_library.pyandpeek_missing_metadata.py:python -m pip install mutagen- A Spotify developer app for
backup_spotify_playlist_covers.py. Addhttp://127.0.0.1:8888/callbackas its redirect URI. SetSPOTIFY_CLIENT_IDin your environment; no client secret is needed.
Run commands from this directory. Review the settings near the top of each script, especially drive paths, before running it.
| Script | Purpose | Input and output |
|---|---|---|
split_spotify_playlists.py |
Splits a TuneMyMusic Spotify export into one CSV per collection for CSVMusic. | Reads My Spotify Library.csv; writes spotify_playlist_csvs/, including a manifest and separate non-track collections. |
backup_spotify_playlist_covers.py |
Uses Spotify OAuth PKCE to download cover images for playlists visible to your account. | Writes timestamped backups under spotify_playlist_cover_backups/, with a CSV manifest. Requests private and collaborative playlist read access. |
leftovers.py |
Copies audio from an old iPod backup into the local library and creates a playlist for it. | Edit SOURCE for your backup path; writes Library/Mystery iPod Finds/ and Playlists/Mystery iPod Finds.m3u8. Existing destination files with the same names can be overwritten. |
make_ipod_classic_og_playlist.py |
Creates an M3U8 playlist for all supported audio in Library/iPod Classic OG/. |
Writes Playlists/iPod Classic OG.m3u8. |
peek_missing_metadata.py |
Reports audio files missing artist, album, or title tags. | Reads Library/; writes missing_metadata.csv. |
organize_library.py |
Plans a new artist/album library, selects preferred copies of duplicate tracks, and rewrites playlist paths. | Reads Library/ and Playlists/; writes to DEST_ROOT only with --apply. Requires mutagen. |
- Place your own music under
Library/and M3U/M3U8 playlists underPlaylists/. - Run
python peek_missing_metadata.pyto inspect missing tags. - Edit
DEST_ROOTnear the top oforganize_library.pyto a destination you control. Runpython organize_library.pyfor a dry run and inspect the counts, path examples, and unresolved playlist entries. - Only after reviewing the plan, run
python organize_library.py --apply. The destination must be absent or empty; the script copies files and leaves the source library in place. Unresolved playlist entries are preserved and reported.
The Spotify CSV splitter and cover backup are optional separate utilities. To back up covers in PowerShell, set $env:SPOTIFY_CLIENT_ID = "your-client-id" in that session, then run python backup_spotify_playlist_covers.py.