Nodes/ComfyUI-Ytdpl/YT-DLP Downloader (Auto-Quality) 📥
ComfyUI Node

YT-DLP Downloader (Auto-Quality) 📥

Your ComfyUI graph can download YouTube videos now

By Meisoftcoltd·Created 8 months ago·Updated 5 months ago· 0
YT-DLP Downloader (Auto-Quality) 📥
    • video_path
    • info
    • title
    • description
    • thumbnail_url
    • channel
    â—„urlâ–º
    â—„cookies_textâ–º
    ◄cookies_file▾►
    â—„browser_sourceNingunoâ–º
    â—„update_yt_dlpfalseâ–º
    â—„qualitybestâ–º
    â—„formatmp4â–º

    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. quality offers best, 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 (prioritizing h264 over avc, since TikTok labels it differently), explicitly blocks TikTok's famously broken bytevc1 HEVC stream, and eventually lands on best. If your chosen quality can't be found, it silently retries with best.
    • Video merge without re-encoding. Video downloads use bestvideo+bestaudio and merge with --merge-output-format in copy mode - no re-encode, no GPU, basically no RAM cost.
    • Audio mode. Pick mp3, m4a, wav, flac, ogg, opus, aac, or mka and it runs -x --audio-format, which needs ffmpeg on your system.
    • Metadata pass-through. It has yt-dlp write a .info.json next 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 .txt file you dropped in ComfyUI/input/cookies/ (the folder is created for you), or set browser_source to Chrome/Firefox/Safari/Edge to use curl-cffi's --impersonate and 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_dlp is a boolean that pip-installs nightly yt-dlp plus the yt-dlp-ejs and bgutil-ytdlp-pot-provider plugins 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.
    • quality and format - set once; the defaults (best, mp4) are sensible.
    • cookies_text / cookies_file / browser_source - leave cookies_file at its Spanish Ninguno (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.

    Categoryvideo/download

    Inputs (7)

    NameTypeDefaultDescription
    urlSTRING—
    cookies_textSTRING—
    cookies_fileCOMBO1 options: Ninguno
    browser_sourceCOMBONinguno5 options: Ninguno, Chrome, Firefox, Safari, Edge
    update_yt_dlpBOOLEANfalse—
    qualityCOMBObest5 options: best, 1080p, 720p, 480p, 360p
    formatCOMBOmp414 options: mp4, mkv, webm, mov, avi, flv, +8

    Outputs (6)

    NameTypeDescription
    video_path*—
    infoSTRING—
    titleSTRING—
    descriptionSTRING—
    thumbnail_urlSTRING—
    channelSTRING—