Add YouTube fallback download with full Spotify metadata#890
Open
vo1dee wants to merge 3 commits into
Open
Conversation
When downloader is set to Auto and all configured services (Tidal, Amazon Music, Qobuz) fail, the app can optionally fall back to YouTube via yt-dlp. Changes: - backend/youtube.go: new YouTubeDownloader that auto-installs yt-dlp on first use, searches YouTube (ytsearch5), picks the candidate closest in duration to the Spotify track, downloads best available audio, converts to MP3 320kbps via ffmpeg, and embeds full Spotify metadata + cover art - app.go: add case 'youtube' to DownloadTrack switch - frontend/src/lib/settings.ts: add youtubeFallback boolean setting - frontend/src/types/api.ts: extend DownloadRequest.service with 'youtube' - frontend/src/components/PlatformIcons.tsx: add YouTubeIcon SVG component - frontend/src/components/SettingsPage.tsx: add YouTube Fallback toggle (visible in Auto mode, off by default) - frontend/src/hooks/useDownload.ts: after Tidal/Amazon/Qobuz all fail, attempt YouTube when youtubeFallback setting is enabled (both downloadWithAutoFallback and downloadWithItemID paths) - .github/workflows/build-macos.yml: CI workflow to build macOS DMG (macOS cannot be cross-compiled from Linux)
The bogem/id3v2 library was silently failing to write tags to ffmpeg-converted MP3 files. Switch to an ffmpeg-based second pass (matching the existing M4A approach) which reliably writes ID3 tags and embeds cover art in the same step.
Author
|
Too bad it's not flac and thus not really scope of this project, spotube (web) linked in the readme does the same, and outputs .mp3 |
Author
Well, I see. But it's still option to get a full release, in case only some tracks are failed to download, which happened to me. Not sure why, but only Amazon works for me (with VPN), and also, on some obscure releases it failed to download 3 out of 7 tracks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
~/.spotiflac/on first use, same pattern as ffmpeg), converts to MP3 320kbps via ffmpeg, then embeds full Spotify metadata + cover artHow it works
"<track> <artist>"(top 5 results) and picks the result whose duration is closest to the Spotify track duration-codec copy— no quality lossNew files
backend/youtube.go—YouTubeDownloader, yt-dlp auto-install, search, duration matching, full download pipeline.github/workflows/build-macos.yml— GitHub Actions workflow for macOS DMG (cannot cross-compile from Linux)Modified files
app.go—case "youtube":added to the download service switchbackend/metadata.go—embedMetadataToMP3WithFFmpeg()added (ffmpeg-based MP3 tag writing, analogous to existing M4A approach)frontend/src/types/api.ts—serviceunion extended with"youtube"frontend/src/lib/settings.ts—youtubeFallback: booleansetting addedfrontend/src/components/SettingsPage.tsx— YouTube Fallback switch +YouTubeIconfrontend/src/components/PlatformIcons.tsx—YouTubeIconSVG componentfrontend/src/hooks/useDownload.ts— YouTube fallback wired into bothdownloadWithAutoFallbackanddownloadWithItemID