Spotify-YouTube Migrator
raw JSON → 2.0.0 verified Sat May 09 auth: no python
A Python package to migrate playlists between Spotify and YouTube Music. Version 2.0.0 supports OAuth authentication and bidirectional migration. Release cadence is irregular; last updated November 2024.
pip install spotify-youtube-migrator Common errors
error ModuleNotFoundError: No module named 'spotify_youtube_migrator' ↓
cause Package not installed or installed in a different environment.
fix
Run
pip install spotify-youtube-migrator in the correct Python environment. error AttributeError: module 'spotify_youtube_migrator' has no attribute 'Migrator' ↓
cause You are using v1.x where the class was named 'PlaylistMigrator' or you have an old version installed.
fix
Upgrade to v2.0.0:
pip install --upgrade spotify-youtube-migrator. Then use from spotify_youtube_migrator import Migrator. error spotipy.oauth2.SpotifyOauthError: Invalid client id ↓
cause Spotify API credentials are missing or incorrect.
fix
Set environment variables
SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, and SPOTIPY_REDIRECT_URI. Warnings
breaking v2.0.0 introduced a completely new API. The old v1 `PlaylistMigrator` class is removed. Code written for v1 will not work. ↓
fix Update imports to use `from spotify_youtube_migrator import Migrator` and use the new methods (`migrate_spotify_to_youtube`, `migrate_youtube_to_spotify`).
gotcha Non-interactive (scripted) usage is not directly supported. The constructor `Migrator()` triggers interactive OAuth unless you manually handle environment variables or modify the source. ↓
fix Set `SPOTIPY_CLIENT_ID`, `SPOTIPY_CLIENT_SECRET`, `SPOTIPY_REDIRECT_URI` and `YT_OAUTH_*` variables, or subclass Migrator to provide tokens.
deprecated The `config.py` module is deprecated; environment variables are now the preferred configuration method. ↓
fix Use environment variables instead of editing config.py. See README for required variables.
Imports
- Migrator wrong
from spotify_youtube_migrator.migrator import Migratorcorrectfrom spotify_youtube_migrator import Migrator
Quickstart
from spotify_youtube_migrator import Migrator
migrator = Migrator()
# This will prompt for Spotify and YouTube Music credentials interactively
migrator.migrate_spotify_to_youtube()