yt-dlp Downloader
Download media from any yt-dlp-supported site as audio, video, or both, embed proper metadata + cover art, and transfer the result to a target path configured when the plugin was enabled.
Six MCP tools are provided by the bundled ytdl-rmcp server:
| Tool | Purpose |
|---|---|
youtube_search |
Search YouTube and return result URLs without downloading. |
youtube_search_ui |
Open an interactive YouTube search UI in MCP App-capable hosts. |
youtube_download |
Download one or more URLs and transfer them to the configured target. |
youtube_probe |
Read-only: resolve title/duration/uploader/format counts without downloading. |
youtube_identify |
Fingerprint local audio with fpcalc, return AcoustID/MusicBrainz candidates, preview canonical tags, and optionally write high-confidence tags. |
youtube_stats |
Summarize the persistent download ledger with totals, kinds, uploaders, and recent entries. |
Defaults
- Audio-first.
modedefaults toaudio, codec defaults to the configuredaudio_format(mp3 unless changed at enable time). - Destinations come from plugin config. Audio lands in
target_path, and video lands invideo_target_pathwhen configured. Targets can be local (/path), SSH (host:/path), or rclone (remote:pathorrclone:remote:/path). You do not normally pass target fields — they fall back to the user config. - Files are organized by artist. Output is
Artist/Title [id].ext, with title, artist, album, date, and cover art embedded so media servers (Plex, etc.) index them cleanly.
Common usage
Search YouTube first:
youtube_search(query="slow pulp live", limit=5)
Open the interactive search UI:
youtube_search_ui(query="slow pulp live", limit=10)
Download audio (the default) from a link:
youtube_download(urls="https://www.youtube.com/watch?v=...")
Download video at capped resolution:
youtube_download(urls="https://...", mode="video", max_height=1080)
Grab both audio and video (audio → music dest, video → movies dest):
youtube_download(urls="https://...", mode="both")
Add downloaded audio tracks to a Plex playlist:
youtube_download(urls="https://...", plex_playlist="Fresh Downloads")
Re-pull a playlist and only fetch what's new:
youtube_download(urls="https://.../playlist?list=...", use_archive=true)
Check a target before a big download:
youtube_probe(urls="https://...")
Identify a local audio file against AcoustID/MusicBrainz:
youtube_identify(paths="/path/to/song.mp3", response_format="json")
High-confidence matches include a read-only retag_preview with canonical
MusicBrainz artist/title/release/date/type/track metadata and MBIDs.
Set write_tags=true to write that high-confidence preview back to the file.
Review download totals and recent entries:
youtube_stats(limit=10)
When requesting JSON stats, expect top-level totals plus skipped_entries,
by_kind, by_uploader, and recent. Bucket fields include downloads
(compatibility alias for call count), calls, items, files, bytes, and
size. Malformed ledger lines are skipped; successful downloads still return if
the ledger append fails, with history_error included in JSON output.
Notes
- YouTube mix/radio URLs (
list=RD...,&start_radio=1) are auto-cleaned to the seed video so they don't resolve to an unrelated track. - Playlists are downloaded fully and flattened into per-artist folders.
- On transfer failure the local staging copy is kept so the operation can be retried;
on success it is removed unless
keep_local=true. - Completed download calls are appended to a JSONL ledger, defaulting to the
per-user state dir. Set
YTDLP_HISTORY_PATHto put it somewhere specific. - Embedded title metadata strips common YouTube noise such as
(Official Video),[Official Audio], trailing| @channel, and extra whitespace by default. SetYTDLP_CLEAN_METADATA=0to preserve source titles exactly. youtube_identifyrequiresYTDLP_ACOUSTID_CLIENT_KEYandfpcalc(Chromaprint) onPATH, or an explicitFPCALC_PATH. It previews by default; passwrite_tags=trueto write high-confidence MusicBrainz tags to files.- Set
YTDLP_PLEX_URLandYTDLP_PLEX_TOKENto add downloaded audio tracks to theyt-dlp DownloadsPlex playlist by default. SetYTDLP_PLEX_PLAYLISTor pass per-callplex_playlistto override it. Plex playlist failures are reported without failing a completed download. - yt-dlp auto-updates at server startup when stale (configurable), so a fresh session self-heals against extractor breakage.
- yt-dlp and ffmpeg are resolved automatically: explicit env path, then
PATH, then the per-user cache, then runtime download. UseYTDLP_PATHandFFMPEG_PATHonly when you need known local binaries.
Operational controls
YTDLP_TIMEOUT_SECScontrols each yt-dlp probe/download command timeout (default: 1800).YTDLP_TRANSFER_TIMEOUT_SECScontrols each SSH transfer phase timeout (default: 600).YTDLP_PATHandFFMPEG_PATHoverride auto-resolution/auto-download with specific local binaries.YTDLP_SHA256andFFMPEG_SHA256optionally require exact SHA-256 digests for the resolved yt-dlp and ffmpeg executables.YTDLP_EXTRACTOR_ARGSis passed to yt-dlp--extractor-args, for exampleyoutube:player_client=androidwhen the default YouTube clients cannot fetch a video.YTDLP_SSH_OPTSadds extra SSH options using shell-word syntax, for example-i "~/.ssh/ytdl key" -o ProxyJump=media-bastion. Malformed quoting is rejected.YTDLP_PLEX_URL,YTDLP_PLEX_TOKEN, andYTDLP_PLEX_PLAYLISTcontrol optional Plex playlist updates after successful audio transfers.
Requirements (on the host running this plugin)
- For
host:/pathtargets: ssh / openssh-client and passwordless key-based SSH auth to the configured remote. - For
remote:pathorrclone:remote:/pathtargets: rclone onPATHwith the named remote configured. - rsync is optional; SSH transfers fall back to scp when rsync is unavailable, and local transfers fall back to Rust filesystem copy.
- yt-dlp and ffmpeg are auto-resolved/auto-downloaded unless overridden with
YTDLP_PATH/FFMPEG_PATH