{"id":28218,"library":"spotify2ytmusicv2","title":"Spotify2YTMusicV2","description":"A tool to copy Spotify playlists to YouTube Music (YTMusic). Currently at version 0.2.2, released on 2025-04-20. Release cadence is irregular; still in early development.","status":"active","version":"0.2.2","language":"python","source_language":"en","source_url":"https://github.com/ohjho/spotify2ytmusicv2","tags":["spotify","youtube-music","playlist-transfer","cli"],"install":[{"cmd":"pip install spotify2ytmusicv2","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for Spotify API interaction","package":"spotipy","optional":false},{"reason":"Required for YouTube Music API interaction","package":"ytmusicapi","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"Spotify2YTMusic","correct":"from spotify2ytmusicv2 import Spotify2YTMusic"}],"quickstart":{"code":"from spotify2ytmusicv2 import Spotify2YTMusic\nimport os\n\nclient = Spotify2YTMusic(\n    spotify_client_id=os.environ.get('SPOTIFY_CLIENT_ID', ''),\n    spotify_client_secret=os.environ.get('SPOTIFY_CLIENT_SECRET', ''),\n    ytmusic_headers_raw=os.environ.get('YT_MUSIC_HEADERS', '{}')\n)\nplaylist_id = 'your_spotify_playlist_id'\nclient.copy_playlist(playlist_id, public=True)","lang":"python","description":"Authenticate and copy a Spotify playlist to YouTube Music. Obtain Spotify API credentials from Spotify Developer Dashboard, and YTMusic headers from browser dev tools after logging into music.youtube.com."},"warnings":[{"fix":"Export the headers JSON as a string: export YT_MUSIC_HEADERS='{\"User-Agent\":\"...\",\"Cookie\":\"...\"}'","message":"The YTMusic headers must be passed as a raw JSON string in the environment variable YT_MUSIC_HEADERS. Do not use a dictionary or file; the library expects a string.","severity":"gotcha","affected_versions":"All"},{"fix":"Use `client.copy_playlist(...)` instead of `client.transfer_playlist(...)`.","message":"In version 0.2.0, the method `copy_playlist` was renamed from `transfer_playlist`. Calling `transfer_playlist` will raise an AttributeError.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Extract the ID from the URL (e.g., '3s9t1vD1d0c2a6b8f0e4a' from 'open.spotify.com/playlist/...').","message":"The library expects Spotify playlist ID (not URL). Passing a full Spotify URL will fail silently or raise an error.","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":"Ensure you have set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET environment variables correctly.","cause":"Missing or invalid Spotify API credentials (client ID or secret).","error":"spotipy.exceptions.SpotifyException: http status: 400, code: -1, message: Bad request"},{"fix":"Copy the full headers object from browser dev tools, including all keys, and export as a JSON string.","cause":"The YT_MUSIC_HEADERS string is missing required keys like 'User-Agent' and 'Cookie'.","error":"KeyError: 'User-Agent'"},{"fix":"Use client.copy_playlist(playlist_id) instead.","cause":"Using the old method name which was removed in version 0.2.0.","error":"AttributeError: 'Spotify2YTMusic' object has no attribute 'transfer_playlist'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}