Migrate Spotify playlists or liked songs into YouTube Music. Use when the user wants to copy one playlist, all playlists, or liked songs from Spotify to YT Music, especially when they have a Spotify playlist URL, a Spotify bearer token, a Spotify client ID for PKCE, or a local liked-song JSON export that needs to be flattened and imported.
Use the bundled scripts instead of rebuilding this workflow from scratch.
python3 <path-to-skill>/scripts/spotify_to_ytmusic.py --help.--spotify-playlist <url-or-id> for one playlist.--all-playlists for an account-wide playlist export.--liked-songs to apply YouTube Music likes instead of creating a playlist.--spotify-liked-json <path> when liked songs come from a local JSON dump instead of the Spotify API.--dry-run first unless the user explicitly wants the live migration immediately.Use the simplest source that is already available:
--spotify-access-token or set .SPOTIFY_ACCESS_TOKEN--spotify-client-id or SPOTIFY_CLIENT_ID. Do not ask for a client secret; this workflow does not require one.spotify_extract_liked_json.py, then feed the output into --spotify-liked-json.The migrator expects a ytmusicapi auth file such as browser.json or oauth.json.
--yt-auth /path/to/browser.json.music.youtube.com, create browser auth with:pbpaste | python3 <path-to-skill>/scripts/spotify_to_ytmusic.py --setup-yt-browser
If ytmusicapi is missing, install it in a virtual environment rather than system-wide.
When the user provides a large liked.json or another nested export with the shape
data.me.library.tracks.items[*].track.data, do not load the full file into context.
Flatten it with the bundled extractor:
python3 <path-to-skill>/scripts/spotify_extract_liked_json.py \
/path/to/liked.json \
--output /path/to/liked_flat.json
The extractor keeps only the import-relevant fields and reports whether the source file looks partial.
If the user cannot access liked songs through the Spotify API, use the browser helper
at scripts/spotify_export_liked_songs_browser.js in the Spotify Web Player console,
save the resulting JSON, then flatten it if needed.
Single playlist:
SPOTIFY_ACCESS_TOKEN='...' \
python3 <path-to-skill>/scripts/spotify_to_ytmusic.py \
--spotify-playlist "<spotify-playlist-url>" \
--yt-auth /path/to/browser.json \
--dry-run
All playlists:
SPOTIFY_ACCESS_TOKEN='...' \
python3 <path-to-skill>/scripts/spotify_to_ytmusic.py \
--all-playlists \
--yt-auth /path/to/browser.json \
--report-file /tmp/spotify_export_report.json
Liked songs from flattened JSON:
python3 <path-to-skill>/scripts/spotify_to_ytmusic.py \
--liked-songs \
--spotify-liked-json /path/to/liked_flat.json \
--yt-auth /path/to/browser.json \
--report-file /tmp/spotify_liked_report.json
video_id, the like step deduplicates them before applying likes.