Registry / data / spotify2ytmusic

spotify2ytmusic

JSON →
library0.9.32pypypiunverified

CLI tool and library to transfer Spotify playlists to YouTube Music. v0.9.32, active development, monthly releases.

pip install spotify2ytmusic
INSTALL
IMPORT
SIG · SPOTIFY2YTMUSIC
S
spotify2ytmusic
datapythonv0.9.32
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Spotify2YTMusic
from spotify2ytmusic.backend import Spotify2YTMusic
from spotify2ytmusic import Spotify2YTMusic

Initialize with credentials and transfer a public playlist. Requires Spotify API credentials and YouTube Music headers auth.

from spotify2ytmusic import Spotify2YTMusic # Set environment variables or pass directly client = Spotify2YTMusic( spotify_client_id=os.environ.get('SPOTIFY_CLIENT_ID', ''), spotify_client_secret=os.environ.get('SPOTIFY_CLIENT_SECRET', ''), ytmusic_auth=os.environ.get('YTMUSIC_AUTH', '') ) # Transfer a public Spotify playlist by ID result = client.transfer_playlist('37i9dQZF1DXcBWIGoYBM5M') print(result)
spotify2ytmusic --version
Debug
Known issues
breakingIn 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.
fix
Extract playlist ID from URL using regex or string splitting before passing to `transfer_playlist`.
affects: >=0.9.0
gotchaYouTube 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.
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.
affects: all
deprecatedThe `Spotify2YTMusic` class constructor parameter `ytmusic_auth` has been deprecated in favor of `headers_auth` since v0.9.20.
fix
Use `headers_auth=...` instead of `ytmusic_auth=...`.
affects: >=0.9.20
gotchaSpotify rate limits can cause the transfer to fail silently for large playlists (>100 tracks). The library does not handle pagination errors gracefully.
fix
Split large playlists into chunks or use the `max_tracks` parameter (if available) to limit per run.
affects: all
Upgrade
Version history
0.9.32latest on PyPI · released Feb 1, 2025
Audit
Dependencies
spotipyrequiredSpotify API client
ytmusicapirequiredYouTube Music API client
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources