ComfyUI Node

YoutubeDL

Your workflow wants that song off YouTube — this node just grabs it

By christian-byrne·Created 2 years ago·Updated 2 years ago· 5
YoutubeDL
    • AUDIO
    youtube_linkhttps://www.youtube.com/watch?v=6bALJxjL8jw
    playlist_start0
    playlist_end0
    audio_quality5
    delete_afterfalse
    random_from_playlistfalse
    yt_dlp_cli_args

    This is a tiny single-node pack that does one thing, and it does it the boring way that works: paste in a URL, get back a real ComfyUI AUDIO tensor you can wire straight into whatever's downstream. It's yt-dlp wearing a node costume. No API keys, no account, no cloud - it downloads the media to your machine and decodes it into the same {waveform, sample_rate} dict ComfyUI's own audio nodes produce.

    The node's called YoutubeDL, but don't let the name fool you. Because it leans on yt-dlp, that URL can be YouTube, Vimeo, SoundCloud, Bilibili, or any of the hundreds of sites yt-dlp knows. If yt-dlp can fetch it, this node can pull it into your graph.

    Why you'd reach for it

    The crowd this actually serves is the audio-reactive corner of the ecosystem: music-video generation, dance animations that sync to a track, CLAP-style conditioning where the waveform steers the video. That scene lives in ComfyUI precisely because chaining a download, a decode, and an analysis step into one graph is the kind of thing the node system is built for. Without a node like this you're downloading an mp3 by hand, dropping it in ComfyUI/input, and wiring up a load-audio node yourself. This kills the middleman - and it also handles playlists in one shot, which is a pain by hand.

    How it works

    Under the hood it's dead simple and worth knowing because it explains the gotchas. The node tells yt-dlp to grab the best available audio, extracts it to mp3 using an ffmpeg postprocessor, and writes the file into your ComfyUI/input folder using the video title as the filename. Then it decodes that file with torchaudio into the standard AUDIO format and hands the tensor up the graph. If the URL is a playlist, it downloads the slice you asked for and batches the clips into one tensor, zero-padding them to the longest length so they stack.

    The yt_dlp_cli_args text box is the most powerful input here, and it's worth trusting: the pack literally feeds your text through yt-dlp's own CLI argument parser (cli_to_api), so essentially any flag yt-dlp supports works. The README's example is the proxy escape hatch:

    --proxy "socks5://127.0.0.1:1080"
    

    The inputs that matter

    Required, and you only really set the first:

    • youtube_link - the URL. The default is a sample video so you can test the node before pointing it at your real target.
    • playlist_start / playlist_end - both default to 0, which means "the whole playlist." Set them to a 1-based range to grab just a slice.

    Optional, the ones you'll touch:

    • audio_quality - a 0–10 slider (default 5) that maps to yt-dlp's --audio-quality.
    • delete_after - off by default. Flip it on and the mp3 gets deleted from input/ after it's loaded. If you leave it off, your input folder slowly fills with songs. Yes, I've been there.
    • yt_dlp_cli_args - the anything-goes box above.

    Output: one AUDIO slot. It feeds any node that consumes the audio type - SaveAudio/PreviewAudio to check what you grabbed, or whatever audio-analysis node your reactive workflow uses.

    Install

    The standard two paths. Via ComfyUI Manager, search "youtube-dl-comfyui". Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/christian-byrne/youtube-dl-comfyui
    cd youtube-dl-comfyui
    pip install -r requirements.txt
    

    Restart ComfyUI after. The declared dependency is a single line - yt-dlp - so installs are light and conflict-free. But there's a hidden second dependency: ffmpeg has to be on your PATH for the mp3 extraction step to run. If you've got ComfyUI running you almost certainly have ffmpeg available somewhere, but if the node dies right after download with an ffmpeg error, that's the first thing to check.

    Common issues

    • "Sign in to confirm you're not a bot" - the eternal yt-dlp war. YouTube breaks the extractor, everyone panics, and the fix is always the same: pip install -U yt-dlp, restart ComfyUI. If it keeps happening, that --proxy box also works for region blocks, which is exactly why it's in the README.
    • Mysterious mp3s in your input folder - that's delete_after off. Flip it or clean up; you set the default.
    • "Sample rate mismatch in playlist items" - clips in a playlist at different sample rates can't be batched into one tensor, so the node bails. Nudge your playlist range or download the straggler separately.

    It's a small, honest utility - zero hand-holding, zero magic. If you build music-synced or audio-conditioned workflows, it's the one node you'll quietly keep installing on every new setup.

    Categoryaudio

    Inputs (7)

    NameTypeDefaultDescription
    youtube_linkSTRINGhttps://www.youtube.com/watch?v=6bALJxjL8jw
    playlist_startINT00–4096
    playlist_endINT00–4096
    audio_qualityoptFLOAT50–10
    delete_afteroptBOOLEANfalse
    random_from_playlistoptBOOLEANfalse
    yt_dlp_cli_argsoptSTRING

    Outputs (1)

    NameTypeDescription
    AUDIOAUDIO