feat: multi-platform URL & playlist support via yt-dlp probe

Generalize URL handling beyond YouTube to any yt-dlp-supported site
(SoundCloud, Bandcamp, etc), single tracks and playlists/sets/albums.

- probe_url(): one yt-dlp --flat-playlist probe classifies playlist vs track
  and returns per-entry Hits; YouTube playlists still use ytmusicapi.
- _track_url(): YouTube tracks keep the music.youtube album-art URL; other
  platforms download via their native entry URL (no more videoId reconstruction).
- Per-source folders: <root>/<artist>/<extractor>/ (soundcloud/bandcamp/youtube)
  instead of hardcoded youtube; download_single derives source from metadata.
- download_hits() downloads pre-probed Hits; API probes once and passes hits
  into the job closure. Replaces YouTube-only is_playlist_url/expand_playlist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 00:25:58 -07:00
parent 7309ad3a29
commit f103b6c253
8 changed files with 260 additions and 102 deletions

View File

@@ -3,6 +3,6 @@ import server.mf as smf
def test_url_helpers_reexported():
assert callable(smf.is_url)
assert callable(smf.is_playlist_url)
assert callable(smf.download_playlist)
assert callable(smf.probe_url)
assert callable(smf.download_hits)
assert callable(smf.download_single)