v0.37.0: Import from URL takes Spotify links

A Spotify track, album or playlist is read off Spotify's public embed
page, each song found on YouTube by the result closest to Spotify's
length, downloaded with the song flags, tagged with Spotify's
artist/title/album/track number, then imported and identified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 01:09:46 -07:00
co-authored by Claude Opus 5.5
parent ac682774e9
commit 581be8d732
9 changed files with 830 additions and 11 deletions
+13
View File
@@ -365,6 +365,19 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal
get `gui/url_import_progress.py`, a non-modal per-song list (Hide keeps
downloading; clicking the status-bar line reopens it). `LTSTART` carries
the id, and `ERROR: [site] <id>: …` lines become `item_failed`.
**A Spotify link** (Round 76, `spotify_link.py`, ported from trav's
`spotify-youtube` script) can't be downloaded, but Spotify's public
embed page (`open.spotify.com/embed/<kind>/<id>`, a `__NEXT_DATA__`
JSON block, no key) names every song with its **length**. `SpotifyProbe`
feeds those to the same checklist; `SpotifyImportWorker` (a
`UrlImportWorker` with the same signals, rows keyed by Spotify id) runs a
`ytsearch5:` listing per song, takes the result closest to Spotify's
length (`rank_candidates`: within 10 s, then no "live"/"cover" the
Spotify title doesn't have — the shazam-import lesson), falls back to the
next result if a download fails, and writes Spotify's title/artist/album/
track number into the mp3 **before** emitting `downloaded`, so the
import files it under the right artist and Identify ranks by that artist.
If the embed page changes shape, `parse_embed` raises `SpotifyError`.
- **`lintunes/mpris.py`** — registers `org.mpris.MediaPlayer2.lintunes` over D-Bus
so the desktop's media keys / now-playing popup control playback. Spacebar and