Imported from SKD-international/skd-downloader (
AGENTS.md). Install upstream withnpx skills add SKD-international/skd-downloader. Copyright stays with the author.
SKD Downloader — Shared Agent Context
What This Is
Native macOS downloader built around yt-dlp, aimed at replacing MediaHuman with a simpler GUI.
- GitHub:
SKD-international/skd-downloader - Release lane: Swift 6 SwiftPM app, universal
arm64+x86_64, macOS 14+, distributed through the Homebrew cask inbonchaloo/tap - Version: single source of truth is the
VERSIONfile (read by both scripts)
Run
./script/build_and_run.sh --verify
Build
./script/build_and_run.sh --build
./script/build_and_run.sh --package
./script/release_native.sh
Test
swift test
bash -n script/build_and_run.sh script/release_native.sh
Architecture
| Path | Purpose |
|---|---|
Package.swift |
Swift package manifest |
VERSION |
App version used by build and release scripts |
Sources/DownloaderCore/ |
Engine, yt-dlp command builder and output parser, managed toolchain (yt-dlp + Deno installer), failure classifier, presets, media probe, media library models |
Sources/DownloaderUI/ |
SwiftUI app state, queue, media library, player, settings |
Sources/SKDDownloaderNativeApp/ |
App entry point |
script/build_and_run.sh |
Build, package, launch, and local verification |
script/release_native.sh |
Release packaging, signing, notarization, upload, cask metadata |
homebrew/skd-downloader.rb |
Homebrew cask |
tests/DownloaderCoreTests/, tests/DownloaderUITests/ |
Swift Testing suites |
Config & Data
~/Library/Application Support/skd-downloader-native/holdsconfig.json,workbench.json,history.json,queue/queue.json,library/, andtools/bin/(app-managed yt-dlp and Deno)
Download Flow
Paste URL
-> YTDLPEngine.fetchInfo (yt-dlp --dump-json --flat-playlist)
-> queue items with a configuration snapshot
Start queue
-> YTDLPCommandBuilder.build
-> YTDLPEngine.startDownload streams stdout/stderr lines
-> YTDLPOutputParser reads progress and destination
-> history + media library entry on success
Toolchain
ManagedToolchaininstalls yt-dlp (yt-dlp_macos, universal) and Deno (per-arch zip) from official GitHub releases, verifying SHA-256 against the published manifest. Never bundle or fetch tools from anywhere else.BinaryLocatorsearches the managedtools/binfirst, then Homebrew,/usr/local/bin,~/.local/bin,~/.deno/bin,/opt/local/bin,/usr/bin, and the loginPATH.- Every yt-dlp invocation passes
--ffmpeg-locationand--js-runtimes deno:<dir>explicitly; GUI launches have a barePATH. EngineHealthmarks yt-dlpoutdatedwhen behind the latest release or older than 60 days. Deno is a required tool.DownloadFailure.classifymaps yt-dlp output to a title plus a remedy (updateYTDLP,installDeno,installFFmpeg,useBrowserCookies,checkURL); UI surfaces the remedy as a button.- ffmpeg stays external: the FFmpeg project publishes no official macOS binary.
Gotchas
- Public casks should use the stable GitHub release download URL and load without
HOMEBREW_GITHUB_API_TOKEN. - Private beta casks require explicit
SKD_RELEASE_PRIVATE_ASSET=1release mode. yt-dlppath selection and cookie handling are the most failure-prone parts of the app.ffmpegis required for merge and audio extraction flows.- Browser cookie reads can hit macOS app-data privacy; the engine retries once without browser cookies when the cookie DB is unreadable.