{"id":28217,"library":"spotify2ytmusic","title":"spotify2ytmusic","description":"CLI tool and library to transfer Spotify playlists to YouTube Music. v0.9.32, active development, monthly releases.","status":"active","version":"0.9.32","language":"python","source_language":"en","source_url":"https://github.com/lifeparticle/spotify2ytmusic","tags":["spotify","youtube-music","playlist-transfer","cli","migration"],"install":[{"cmd":"pip install spotify2ytmusic","lang":"bash","label":"Latest release"}],"dependencies":[{"reason":"Spotify API client","package":"spotipy","optional":false},{"reason":"YouTube Music API client","package":"ytmusicapi","optional":false}],"imports":[{"note":"main module is internal; always import from top-level","wrong":"from spotify2ytmusic.main import Spotify2YTMusic","symbol":"Spotify2YTMusic","correct":"from spotify2ytmusic import Spotify2YTMusic"}],"quickstart":{"code":"from spotify2ytmusic import Spotify2YTMusic\n\n# Set environment variables or pass directly\nclient = Spotify2YTMusic(\n    spotify_client_id=os.environ.get('SPOTIFY_CLIENT_ID', ''),\n    spotify_client_secret=os.environ.get('SPOTIFY_CLIENT_SECRET', ''),\n    ytmusic_auth=os.environ.get('YTMUSIC_AUTH', '')\n)\n# Transfer a public Spotify playlist by ID\nresult = client.transfer_playlist('37i9dQZF1DXcBWIGoYBM5M')\nprint(result)","lang":"python","description":"Initialize with credentials and transfer a public playlist. Requires Spotify API credentials and YouTube Music headers auth."},"warnings":[{"fix":"Extract playlist ID from URL using regex or string splitting before passing to `transfer_playlist`.","message":"In version 0.9.0, the `transfer_playlist` method changed from accepting Spotify playlist URL to requiring the playlist ID. URL parsing must be done manually.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Generate headers_auth by exporting request headers from browser's developer tools (Network tab) after logging into music.youtube.com. Pass as a JSON string.","message":"YouTube Music 'headers_auth' parameter expects a JSON string of browser headers, not a simple token. Many users pass an invalid string and get 401 errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `headers_auth=...` instead of `ytmusic_auth=...`.","message":"The `Spotify2YTMusic` class constructor parameter `ytmusic_auth` has been deprecated in favor of `headers_auth` since v0.9.20.","severity":"deprecated","affected_versions":">=0.9.20"},{"fix":"Split large playlists into chunks or use the `max_tracks` parameter (if available) to limit per run.","message":"Spotify rate limits can cause the transfer to fail silently for large playlists (>100 tracks). The library does not handle pagination errors gracefully.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Verify SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET from Spotify Developer Dashboard. Regenerate if needed.","cause":"Invalid or expired Spotify client credentials.","error":"spotipy.exceptions.SpotifyException: http status: 401, code: -1 - code: 401, reason: Unauthorized"},{"fix":"Re-export headers from browser network request to music.youtube.com and ensure the JSON string is valid (e.g., '{\"cookie\":\"...\", \"x-origin\":\"...\"}').","cause":"Incorrect or malformed YouTube Music headers_auth string.","error":"ytmusicapi.exceptions.YTMusicServerError: 401 Unauthorized"},{"fix":"Extract the playlist ID: e.g., '37i9dQZF1DXcBWIGoYBM5M' from 'https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M'.","cause":"Passing a full Spotify playlist URL instead of playlist ID.","error":"KeyError: 'id' when calling transfer_playlist"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}