Authentication
YouTube Music
YouTube Music has no official API; tunesync uses ytmusicapi with a browser session.
Automatic browser-window login (recommended)
tunesync auth ytmusic- Opens a clean Chrome or Edge window using a dedicated profile inside tunesync's data folder (your personal browser is never touched).
- Log in to your Google account and open Library if needed.
- Once detected and verified against YouTube Music, the window closes automatically and saves
browser.json.
Silent background refresh
If Google ever rotates or expires session cookies later, renew them silently without typing your password again:
tunesync auth ytmusic --refreshHeadless / manual fallback
On a server without Chrome or Edge, copy any browse request from music.youtube.com DevTools (Network → Copy as cURL):
tunesync auth ytmusic --clipboard
# or from a temporary file (delete it afterwards):
tunesync auth ytmusic --file request.txtSpotify
Option 1: Exportify CSV (no Spotify auth needed)
Export your playlist from exportify.app and run tunesync import. No Spotify Premium, no Developer app, and zero risk to your Spotify account.
Option 2: Official Spotify Web API (PKCE)
Requires a Spotify Premium account (since 2026) to own a Developer Dashboard app:
- Create an app at developer.spotify.com/dashboard.
- Add
http://127.0.0.1:8888/callbackunder Redirect URIs. - Enable Web API and copy your Client ID.
- Export
SPOTIFY_CLIENT_IDand run:
# PowerShell
$env:SPOTIFY_CLIENT_ID="your-client-id"
# Bash / zsh
export SPOTIFY_CLIENT_ID="your-client-id"
tunesync auth spotifyOption 3: Spotify web backend (experimental)
When no SPOTIFY_CLIENT_ID is set, tunesync can use Spotify's private web-player API with your sp_dc cookie:
tunesync auth spotify --method webWhen Chrome or Edge is installed, a clean window opens on open.spotify.com, waits for you to log in, verifies the token, and saves sp_dc automatically. For non-interactive scripts:
tunesync auth spotify --method web --sp-dc "<value>" --i-knowAccount risk
Spotify's terms prohibit automated access to its private web API. If you use --method web, consider using a secondary account invited as a collaborator on your playlists. Liked songs are read-only in web mode.