youtube-downloader

Download YouTube videos and HLS streams (m3u8) from platforms like Mux, Vimeo, etc. using yt-dlp and ffmpeg. Use this skill when users request downloading videos, extracting audio, handling protected streams with authentication headers, or troubleshooting download issues like nsig extraction failure

By daymade · 1,178 installs

npx skills add daymade/claude-code-skills --skill youtube-downloader

Source repository · Upstream listing

YouTube Downloader Overview Enable reliable video and audio downloads from YouTube and HLS streaming platforms (Mux, Vimeo, etc.) using yt dlp and ffmpeg. This skill provides workflows for: YouTube downloads at available quality, with optional PO token and authorized cookie recovery HLS stream downloads with authentication headers Handling protected content and troubleshooting common download failures Goal Split: File vs. Text (Read First) Before downloading anything, classify the request: User wants the video/audio file itself (save it, edit it, watch offline) → continue with the download flow below, unchanged. User wants the spoken content as text (transcript, subtitles, meeting notes, archive, "what was said") → follow references/text first.md FIRST: existing archived transcripts → platform transcript APIs → yt dlp subtitle only → authorized audio track + ASR. Do not download the full video just to obtain text. The text first route never blocks a file request: when the user wants the file, download it with the unchanged flow below. Non Technical User Experience (Default) Assume the user is non technical. Do not ask them to run commands. Execute everything yourself and report progress in plain language. Avoid mentioning tooling unless the user asks. Default flow: 1. Ask for the URL (if not provided). 2. Fetch video metadata (title/uploader/duration/thumbnail) and confirm it matches the user's intent. If yt dlp is blocked by “confirm you’re not a bot”, fall back to YouTube oEmbed for title/uploader/thumbnail (duration may be unknown). 3. Offer simple choices (video vs. audio only, quality, subtitles, save location). 4. Proceed with sensible defaults if the user does not specify: Video download at best quality MP4 merged output Single video only (no playlists) 5. Download and report the final file path, file size, and resolution (if video). Offer choices in user friendly terms: “Download the video in best quality (default)” “Download audio only (MP3)” “Pick a quality: 1080p / 720p / 480p / 360p” “Include subtitles (if available)” “Save to the Downloads folder (default) or tell me another folder” Always render the thumbnail when available: If metadata includes a thumbnail URL, include it using Markdown image syntax: ![Thumbnail](URL) . Ask before doing extra work: Confirm playlist downloads (can be large). Confirm installing/upgrading dependencies if missing. Ask before extracting browser cookies. If using cookies, never mention cookie counts or raw cookie details in user facing responses. Say “used your Chrome login session”. Set up a PO Token helper only after an explicit token diagnostic or a user request, and within existing installation/service authorization. If that authorization is already present, execute the recovery and resume the download. Otherwise request only the missing permission. Do not install Docker as a fallback; use the authorized browser provider when appropriate. Legal/Safety reminder (brief): Proceed only if the user has the rights or permission to download the content. Response template (use plain language, no commands): If the user says “just download”: Proceed with defaults and confirm when the download finishes. If blocked, classify the actual diagnostic using the SOP below and execute the applicable authorized recovery. Reliable Download SOP (Internal) Read [the download SOP](references/internal sop.md) before retrying a failure. Start with the current yt dlp default clients and the existing network configuration. Do not require a provider, switch to Android, or extract browser cookies merely to begin a download. Agent Execution Checklist (Internal) Run scripts/download video.py URL info for metadata. It never starts a provider; its oEmbed fallback supplies limited fields when extraction fails. Render the thumbnail when available. Use the requested file/audio, quality, subtitles and save location; proceed with defaults when already specified or implied. Run the ordinary download first. With an installed Node runtime, pass js runtimes node when yt dlp needs it; runtime installation still follows dependency authorization. On failure, read the actual error and F output. An absent requested format, images only output, 403 or low resolution alone does not establish a token problem. If a failed request explicitly reports a missing/required PO Token, read [provider setup](references/po token setup.md). Within existing setup authorization, execute auto po token and finish the original download; do not stop at giving the user a command. This option attempts the native route first, then permits a bounded provider retry and WPC recovery. Request browser cookie permission before supplying either cookie option. Preserve the authorized cookie session and a compatible client throughout retries. For an isolated 403/fragment failure, the wrapper can retry a quality preset once with progressive formats. Verify the resulting resolution; the fallback may be lower quality. Custom formats and audio only requests keep their explicit selection. Verify the final file with ffprobe and report its path, size and actual resolution or audio properties. Provider health or a format listing alone is not a completed download. When to Use This Skill This skill should be invoked when users: Request downloading YouTube videos or playlists Want to extract audio from YouTube videos Experience yt dlp download failures or limited format availability Need help with format selection or quality options Report only low quality (360p) formats available Ask about downloading YouTube content in specific quality (1080p, 4K, etc.) Need to convert downloaded WebM videos to MP4 format for wider compatibility Request downloading HLS streams (m3u8) from platforms like Mux, Vimeo, or other streaming services Need to download protected streams that require authentication headers Prerequisites 1. Verify yt dlp Installation (Run this yourself) If missing or a current extraction diagnostic requires an update, obtain any missing install/upgrade authorization, then use the existing installation owner: Check the current [EJS setup guide](https://github.com/yt dlp/yt dlp/wiki/EJS) for the JavaScript runtime and challenge solver requirements of the installed distribution. An installed Node binary may need explicit js runtimes node ; do not treat an EJS/nsig failure as a PO Token failure. 2. Check Current Quality Access (Run this yourself) Before downloading, check available formats: Compare the listed media streams with the requested quality. If only a low resolution format appears, inspect extraction/runtime warnings and the source availability before choosing recovery. High Quality Download Workflow Step 1: Try the Native Client Selection Keep player client unset unless there is a specific diagnostic or explicit request. The [official extractor guide](https://github.com/yt dlp/yt dlp/wiki/Extractors youtube) describes yt dlp's default attempt with clients that do not require tokens. Available formats depend on the video, account, client, network and current YouTube enforcement. Step 2: Download and Escalate Only When Needed For installation and provider specific recovery, load [PO Token setup](references/po token setup.md). Do not infer a provider requirement from resolution alone. Step 3: Verify Download Quality Expected output for 1080p: Authorized Browser Cookies Method Use cookies when the content requires the authorized account or a bot check persists, after cookie permission is granted. Cookies authenticate a session; they do not replace a missing PO Token: Benefits : Access to age restricted and members only content. Requirements : Must be logged into YouTube in the specified browser. Browser and yt dlp must use the same IP/proxy. Preserve yt dlp's default cookie compatible clients; use web safari only as a targeted retry. Do not combine account cookies with Android/iOS clients that do not support them. Common Tasks Audio Only Download (Run this yourself) Extract audio as MP3: Custom Output Directory (Run this yourself) Download with Subtitles (Run this yourself) Playlist Download (Run this yourself) Convert WebM to MP4 (Run this yourself) YouTube high quality downloads often use WebM format (VP9 codec). Convert to MP4 for wider compatibility: Parameters explained: c:v libx264 : Use H.264 video codec (widely compatible) preset medium : Balance between encoding speed and file size crf 23 : Constant Rate Factor for quality (18 28 range, lower = better quality) c:a aac : Use AAC audio codec b:a 128k : Audio bitrate 128 kbps Tip : Conversion maintains 1080p resolution and provides ~6x encoding speed on modern hardware. Troubleshooting Quick Reference Missing Quality / Only Images / Requested Format Not Available Inspect F , the selected format expression, current yt dlp/EJS/runtime warnings and source availability. These messages have multiple causes. Enter provider setup only when a failed extraction or media request also names a missing/required PO Token. Do not install a provider because a requested height or format ID is absent. Sign in to Confirm You’re Not a Bot Check that the intended proxy/network is in use. If the challenge persists and cookies are needed, obtain cookie authorization, retain that session, and retry. Stop with the exact authorization gap if it is unavailable; do not silently read browser cookies. nsig / JavaScript Challenge Failure Check the installed yt dlp version and the [EJS runtime and solver instructions](https://github.com/yt dlp/yt dlp/wiki/EJS). Repair the diagnosed prerequisite within authorization. Android or AndroidVR can be selected explicitly for a bounded diagnostic, but neither is the default recovery or a guaranteed solution. 403 / SSL EOF / Fragment Errors Distinguish a media 403 from TLS, timeout, proxy and provider health errors. A generic 403 does not prove a Token requirement. Check the network path first for SSL/timeout failures; retry only after a relevant change. The wrapper's single progressive retry applies to 403/fragment failures with quality presets, and may reduce quality. Slow Downloads or Network Errors For users in China or behind restrictive proxies: Downloads may be slow due to network conditions Allow sufficient time for completion yt dlp automatically retries on transient failures PO Token Warning (Harmless) Action : A successful, verified download needs no repair for an unused client warning. On failure, read the full diagnostic and actual formats before choosing a token branch. Bundled Script Reference scripts/download video.py Use this wrapper for native client downloads and bounded diagnostic recovery. It does not install/start providers or read cookies by default. Execute it yourself and report the verified file. Basic usage: Arguments: url YouTube video URL (required) o, output dir Output directory output template Output filename template (yt dlp syntax) f, format Format specification q, quality Quality preset (best, 1080p, 720p, 480p, 360p, worst). Default: best (skipped for audio only ) a, audio only Extract audio as MP3 subtitles Download subtitles if available sub lang Subtitle languages (comma separated, default: en) cookies from browser Load cookies from a browser (e.g., chrome, firefox) cookies file Load cookies from a cookies.txt file player client Use a specific YouTube player client (e.g., web safari) auto po token Authorize provider setup after a failed explicit missing/required token diagnostic; try native clients first, then Docker bgutil or browser WPC no auto po token Disable provider setup (default); doe