Implement music downloading via yt-dlp in shanty-dl
#7
Notifications
Total Time Spent: 2 hours 49 minutes
connor
2 hours 49 minutes
No due date set.
Dependencies
No dependencies set.
Reference: Shanty/Main#7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
shanty-dlcrate is responsible for actually downloading music files. For the MVP, the only backend isyt-dlp, which is capable of downloading audio from YouTube, SoundCloud, Bandcamp, and hundreds of other sites. The user provides a specific song (or list of songs), and the crate handles downloading, converting to the desired format, and storing the result.This issue covers:
yt-dlp integration — shell out to
yt-dlp(assumed to be installed on the system) to download audio. The crate should:ytsearch:) to find the best match when given a queryDownload queue — integrate with the
download_queuetable inshanty-db:pending→downloading→completed/failed)Post-download integration — after a successful download:
shanty-index(or at minimum insert a record)downloadedshanty-org) to move the file to the right locationCLI interface — the
shanty-dlbinary should accept:download <query_or_url>— download a single itemdownload --from-queue— process all pending items in the download queue--format <mp3|opus|flac|best>— output format--output <dir>— output directory--dry-run— show what would be downloaded without doing itqueue add <query>— add an item to the download queuequeue list— show the current queuequeue retry— retry all failed downloadsDesign Considerations
DownloadBackendtrait) so that future backends (torrents viatransmission-rpc, Soulseek, NZBGet, etc.) can be added. The trait should define methods likesearch,download,supports_url, etc.--print-jsonor--dump-jsonfor structured output.Acceptance Criteria
DownloadBackendtrait exists and yt-dlp is the first implementation