Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

playlist-sync-tool

One-way playlist sync: mirrors your YouTube Music playlists into Gaana. YouTube Music is the source of truth; Gaana is the mirror. Additions only — deleting a track from the source does not delete it from Gaana (yet).

Install

pipx install playlist-sync-tool

(Or, from a clone: pip install -e ".[dev]" inside a virtualenv.)

Auth setup (one-time, per service)

playlist-sync auth setup ytmusic
playlist-sync auth setup gaana

Each command asks for that service's session credentials (captured from your own logged-in browser session) and stores them locally at ~/.config/playlist-sync/<service>.json, permissioned 0600. Nothing is ever sent anywhere except that service's own servers.

  • YT Music: follow ytmusicapi's browser-auth guide to capture your request headers, then paste the resulting JSON when prompted.
  • Gaana: log into gaana.com, open DevTools → Network, and copy the token query-parameter value from any authenticated request (e.g. an add-to-playlist or "like" call), then paste it when prompted.

Known limitations

  • Gaana's public search API returns no duration or album info for a track, so YT Music → Gaana matches are decided on title+artist fuzzy similarity alone — the ±3s duration safety net only ever applies when both sides happen to report a duration, which Gaana's side never does.
  • Gaana's write endpoints appear to return HTTP 200 even for some logical failures (an invalid track/playlist id may not surface as an error at all). If a track silently doesn't appear after a sync run despite no reported failure, this is the likely cause — see docs/superpowers/spikes/2026-09-07-gaana-write-endpoint.md.

Usage

Manual run (prompts you to resolve any ambiguous track matches):

playlist-sync sync

Scheduled/cron run (never prompts; logs ambiguous tracks to ~/.config/playlist-sync/sync.log and skips them until a manual run resolves them):

playlist-sync sync --cron

Example crontab entry (every 6 hours):

0 */6 * * * /path/to/playlist-sync sync --cron

Config directory override

Set PLAYLIST_SYNC_CONFIG_DIR to change where credentials and the local sync-state database are stored (defaults to ~/.config/playlist-sync).

Development

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

See docs/superpowers/specs/2026-09-07-ytmusic-gaana-sync-design.md for the full architecture writeup, and docs/superpowers/spikes/ for the reverse-engineering notes on Gaana's undocumented write endpoint.

License

GPLv3 — see LICENSE.

About

tool to sync liked songs between services

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages