YT-DLP Downloader (Auto-Quality) 📥
Your ComfyUI graph can download YouTube videos now
- video_path
- info
- title
- description
- thumbnail_url
- channel
YT-DLP Downloader (Auto-Quality) 📥 is a single node that wraps yt-dlp and drops it onto your canvas. Paste a YouTube, TikTok, or any-of-the-1000-other-supported-sites URL in, and it downloads the video or audio to your ComfyUI folder, then hands you the file path plus title, description, thumbnail URL, and channel as outputs you can wire into the rest of the graph.
Is that overkill? Probably. The Reddit reaction to the first yt-dlp-in-ComfyUI pack was "ComfyUI is the new Emacs" - and it is. But if you're building a pipeline that needs fresh source media as its input, this beats alt-tabbing to a terminal. Grab a clip, feed its frames into an image-to-video model or an upscaler, pull the audio track out for a vocal-split pack - the download becomes just another step in the workflow instead of a thing you do by hand.
How it works
It's yt-dlp under the hood, invoked as python -m yt_dlp via subprocess. Nothing fancy, but the wrapper is smarter than a plain shell call:
- Auto-quality with a safety net.
qualityoffersbest,1080p,720p,480p,360p. For a non-best target it builds a format filter like[height<=720], then runs a long fallback chain that prefers H.264 (prioritizingh264overavc, since TikTok labels it differently), explicitly blocks TikTok's famously brokenbytevc1HEVC stream, and eventually lands onbest. If your chosen quality can't be found, it silently retries withbest. - Video merge without re-encoding. Video downloads use
bestvideo+bestaudioand merge with--merge-output-formatin copy mode - no re-encode, no GPU, basically no RAM cost. - Audio mode. Pick
mp3,m4a,wav,flac,ogg,opus,aac, ormkaand it runs-x --audio-format, which needsffmpegon your system. - Metadata pass-through. It has yt-dlp write a
.info.jsonnext to the file, reads title/description/thumbnail/uploader from it, then deletes the JSON. That's where the string outputs come from. - Cookies, three ways (the reason this node exists, honestly): paste Netscape-format cookie text into
cookies_text, pick a.txtfile you dropped inComfyUI/input/cookies/(the folder is created for you), or setbrowser_sourceto Chrome/Firefox/Safari/Edge to use curl-cffi's--impersonateand borrow a real browser's TLS fingerprint. There's even an interactive Playwright flow: on a 403/captcha it opens a browser so you can solve it, exports the session as Netscape cookies, and retries. update_yt_dlpis a boolean that pip-installs nightlyyt-dlpplus theyt-dlp-ejsandbgutil-ytdlp-pot-providerplugins before downloading. YouTube breaks yt-dlp constantly; this is the "I just got hit by an extraction error, refresh everything" button.
The inputs you actually set
All seven inputs are technically required, but six are default-safe:
url- the only thing you must touch every time.qualityandformat- set once; the defaults (best,mp4) are sensible.cookies_text/cookies_file/browser_source- leavecookies_fileat its SpanishNinguno(None) default until a download fails, then add cookies. You'll only need them for YouTube/TikTok under anti-bot pressure or private content.update_yt_dlp- flip it on when you hit an extraction error.
Install
ComfyUI Manager → search ComfyUI-Ytdpl, or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Meisoftcoltd/ComfyUI-Ytdpl
cd ComfyUI-Ytdpl
pip install -r requirements.txt
Then restart ComfyUI. Be warned: it's not a lean pack. requirements.txt pulls yt-dlp, yt-dlp-ejs, curl-cffi, websockets, and bgutil-ytdlp-pot-provider, and the module auto-installs numpy, opencv-python, and playwright on import - which triggers a full Chromium download. The install script also wants Deno installed for YouTube's JS-challenge solving (it tries to install it for you, but needs unzip). If you want audio extraction, you also need ffmpeg:
sudo apt update && sudo apt install ffmpeg libavcodec-extra -y
Where files go, and other gotchas
Files land in ComfyUI/output/ytdpl/ - the README claims input/ as the default, but the shipped code hardcodes the output folder. Check there before you go hunting. --yes-playlist is on by default, so a playlist URL downloads the whole thing, and --no-overwrites means re-runs skip existing files. Each node run writes a fresh .info.json and the IS_CHANGED hash means it re-downloads whenever you edit the URL - fine, just know a graph run can take a while and block the queue.
The common failure modes are the ones the author built defenses for: 403/captcha on TikTok or YouTube (add cookies, or flip update_yt_dlp), a "Permission denied" error on a cookie file (the fix is to paste the file's contents into cookies_text instead), and mute/audio-missing output when the source genuinely has no audio track. The node even runs a post-download ffprobe check so you'll see a clear warning rather than a mysteriously silent clip.
It's niche, and you'll reach for it once a week at most - but when you need source video inside a graph, it's the node that actually works.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | — | |
| cookies_text | STRING | — | |
| cookies_file | COMBO | 1 options: Ninguno | |
| browser_source | COMBO | Ninguno | 5 options: Ninguno, Chrome, Firefox, Safari, Edge |
| update_yt_dlp | BOOLEAN | false | — |
| quality | COMBO | best | 5 options: best, 1080p, 720p, 480p, 360p |
| format | COMBO | mp4 | 14 options: mp4, mkv, webm, mov, avi, flv, +8 |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| video_path | * | — |
| info | STRING | — |
| title | STRING | — |
| description | STRING | — |
| thumbnail_url | STRING | — |
| channel | STRING | — |