From 31d0a9806d8e0c26a8793022631a622161ee1378 Mon Sep 17 00:00:00 2001 From: MajorLinux Date: Sat, 14 Mar 2026 00:33:58 -0400 Subject: [PATCH] wiki: add yt-dlp article to media-creative section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cover installation, Plex-optimized format selection, playlist downloading, config file, and background session usage. Cross-reference existing JS challenge troubleshooting article. Article count: 32 → 33. Open source section: 5 → 6. Co-Authored-By: Claude Sonnet 4.6 --- 03-opensource/index.md | 2 +- 03-opensource/media-creative/yt-dlp.md | 131 +++++++++++++++++++++++++ MajorWiki-Deploy-Status.md | 2 +- README.md | 9 +- SUMMARY.md | 1 + index.md | 9 +- 6 files changed, 146 insertions(+), 8 deletions(-) create mode 100644 03-opensource/media-creative/yt-dlp.md diff --git a/03-opensource/index.md b/03-opensource/index.md index 1549781..957eeed 100644 --- a/03-opensource/index.md +++ b/03-opensource/index.md @@ -11,7 +11,7 @@ A curated collection of my favorite open-source tools and privacy-respecting alt - [rsync: Fast, Resumable File Transfers](dev-tools/rsync.md) ## 🎨 Media & Creative -- *Coming soon* +- [yt-dlp: Video Downloading](media-creative/yt-dlp.md) ## 🔐 Privacy & Security - [Vaultwarden: Self-Hosted Password Manager](privacy-security/vaultwarden.md) diff --git a/03-opensource/media-creative/yt-dlp.md b/03-opensource/media-creative/yt-dlp.md new file mode 100644 index 0000000..c1a4d72 --- /dev/null +++ b/03-opensource/media-creative/yt-dlp.md @@ -0,0 +1,131 @@ +# yt-dlp — Video Downloading + +## What It Is + +`yt-dlp` is a feature-rich command-line video downloader, forked from youtube-dl with active maintenance and significantly better performance. It supports YouTube, Twitch, and hundreds of other sites. + +--- + +## Installation + +### Fedora +```bash +sudo dnf install yt-dlp +# or latest via pip: +sudo pip install yt-dlp --break-system-packages +``` + +### Update +```bash +sudo pip install -U yt-dlp --break-system-packages +# or if installed as standalone binary: +yt-dlp -U +``` + +Keep it current — YouTube pushes extractor changes frequently and old versions break. + +--- + +## Basic Usage + +```bash +# Download a single video (best quality) +yt-dlp https://www.youtube.com/watch?v=VIDEO_ID + +# Download to a specific directory with title as filename +yt-dlp -o "/path/to/output/%(title)s.%(ext)s" URL +``` + +--- + +## Plex-Optimized Download + +For Plex direct play, you want H.264 video in an MP4 container with embedded subtitles: + +```bash +yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' \ + --merge-output-format mp4 \ + -o "/plex/plex/%(title)s.%(ext)s" \ + --write-auto-subs --embed-subs \ + URL +``` + +- `-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/...'` — prefer MP4 video + M4A audio; fall back to best available +- `--merge-output-format mp4` — merge streams into MP4 container (requires ffmpeg) +- `--write-auto-subs --embed-subs` — download auto-generated subtitles and bake them in + +--- + +## Playlists and Channels + +```bash +# Download a full playlist +yt-dlp -o "%(playlist_index)s - %(title)s.%(ext)s" PLAYLIST_URL + +# Download only videos not already present +yt-dlp --download-archive archive.txt PLAYLIST_URL +``` + +`--download-archive` maintains a file of completed video IDs — re-running the command skips already-downloaded videos automatically. + +--- + +## Format Selection + +```bash +# List all available formats for a video +yt-dlp --list-formats URL + +# Download best video + best audio, merge to mp4 +yt-dlp -f 'bestvideo+bestaudio' --merge-output-format mp4 URL + +# Download audio only (MP3) +yt-dlp -x --audio-format mp3 URL +``` + +--- + +## Config File + +Persist your preferred flags so you don't repeat them every command: + +```bash +mkdir -p ~/.config/yt-dlp +cat > ~/.config/yt-dlp/config << 'EOF' +-f bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio +--merge-output-format mp4 +--write-auto-subs +--embed-subs +--remote-components ejs:github +EOF +``` + +After this, a bare `yt-dlp URL` uses all your preferred settings automatically. + +--- + +## Running Long Downloads in the Background + +For large downloads or playlists, run inside `screen` or `tmux` so they survive SSH disconnects: + +```bash +screen -dmS yt-download bash -c \ + "yt-dlp -o '/plex/plex/%(title)s.%(ext)s' PLAYLIST_URL 2>&1 | tee ~/yt-download.log" + +# Check progress +screen -r yt-download +# or +tail -f ~/yt-download.log +``` + +--- + +## Troubleshooting + +For YouTube JS challenge errors, missing formats, and n-challenge failures on Fedora — see [yt-dlp YouTube JS Challenge Fix](../../05-troubleshooting/yt-dlp-fedora-js-challenge.md). + +--- + +## Tags + +#yt-dlp #youtube #video #plex #linux #media #dev-tools diff --git a/MajorWiki-Deploy-Status.md b/MajorWiki-Deploy-Status.md index f8d93cb..6874199 100644 --- a/MajorWiki-Deploy-Status.md +++ b/MajorWiki-Deploy-Status.md @@ -31,7 +31,7 @@ DNS record and Caddy entry have been removed. ## Content -- 32 articles across 5 domains +- 33 articles across 5 domains - Source of truth: `MajorVault/20-Projects/MajorTwin/08-Wiki/` - Deployed via Gitea webhook (push from MajorAir → auto-pull on majorlab) diff --git a/README.md b/README.md index 427fc79..7aa9035 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > A growing reference of Linux, self-hosting, open source, streaming, and troubleshooting guides. Written by MajorLinux. Used by MajorTwin. > **Last updated:** 2026-03-13 -**Article count:** 32 +**Article count:** 33 ## Domains @@ -11,7 +11,7 @@ |---|---|---| | 🐧 Linux & Sysadmin | `01-linux/` | 9 | | 🏠 Self-Hosting & Homelab | `02-selfhosting/` | 8 | -| 🔓 Open Source Tools | `03-opensource/` | 5 | +| 🔓 Open Source Tools | `03-opensource/` | 6 | | 🎙️ Streaming & Podcasting | `04-streaming/` | 1 | | 🔧 General Troubleshooting | `05-troubleshooting/` | 9 | @@ -81,6 +81,9 @@ ### Privacy & Security - [Vaultwarden: Self-Hosted Password Manager](03-opensource/privacy-security/vaultwarden.md) — Bitwarden-compatible server in a single Docker container, passwords stay on your hardware +### Media & Creative +- [yt-dlp: Video Downloading](03-opensource/media-creative/yt-dlp.md) — download from YouTube and hundreds of other sites, Plex-optimized format selection + --- ## 🎙️ Streaming & Podcasting @@ -107,6 +110,7 @@ | Date | Article | Domain | |---|---|---| +| 2026-03-14 | [yt-dlp: Video Downloading](03-opensource/media-creative/yt-dlp.md) | Open Source | | 2026-03-13 | [Vaultwarden: Self-Hosted Password Manager](03-opensource/privacy-security/vaultwarden.md) | Open Source | | 2026-03-13 | [tmux: Persistent Terminal Sessions](03-opensource/dev-tools/tmux.md) | Open Source | | 2026-03-13 | [screen: Simple Persistent Sessions](03-opensource/dev-tools/screen.md) | Open Source | @@ -115,7 +119,6 @@ | 2026-03-13 | [rmlint: Duplicate File Scanning](03-opensource/productivity/rmlint-duplicate-scanning.md) | Open Source | | 2026-03-13 | [SnapRAID & MergerFS Storage Setup](01-linux/storage/snapraid-mergerfs-setup.md) | Linux | | 2026-03-13 | [Qwen2.5-14B OOM on RTX 3080 Ti (12GB)](05-troubleshooting/gpu-display/qwen-14b-oom-3080ti.md) | Troubleshooting | -| 2026-03-13 | [Apache Outage: Fail2ban Self-Ban + Missing iptables Rules](05-troubleshooting/networking/fail2ban-self-ban-apache-outage.md) | Troubleshooting | --- diff --git a/SUMMARY.md b/SUMMARY.md index 726bd0a..8bd77ed 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -9,6 +9,7 @@ * [screen: Simple Persistent Sessions](03-opensource/dev-tools/screen.md) * [rsync: Fast, Resumable File Transfers](03-opensource/dev-tools/rsync.md) * [Vaultwarden: Self-Hosted Password Manager](03-opensource/privacy-security/vaultwarden.md) + * [yt-dlp: Video Downloading](03-opensource/media-creative/yt-dlp.md) * [Streaming](04-streaming/index.md) * [Introduction](04-streaming/index.md) * [Troubleshooting](05-troubleshooting/index.md) diff --git a/index.md b/index.md index d3b49b0..6b647fb 100644 --- a/index.md +++ b/index.md @@ -3,7 +3,7 @@ > A growing reference of Linux, self-hosting, open source, streaming, and troubleshooting guides. Written by MajorLinux. Used by MajorTwin. > > **Last updated:** 2026-03-13 -> **Article count:** 32 +> **Article count:** 33 ## Domains @@ -11,7 +11,7 @@ |---|---|---| | 🐧 Linux & Sysadmin | `01-linux/` | 9 | | 🏠 Self-Hosting & Homelab | `02-selfhosting/` | 8 | -| 🔓 Open Source Tools | `03-opensource/` | 5 | +| 🔓 Open Source Tools | `03-opensource/` | 6 | | 🎙️ Streaming & Podcasting | `04-streaming/` | 1 | | 🔧 General Troubleshooting | `05-troubleshooting/` | 9 | @@ -81,6 +81,9 @@ ### Privacy & Security - [Vaultwarden: Self-Hosted Password Manager](03-opensource/privacy-security/vaultwarden.md) — Bitwarden-compatible server in a single Docker container, passwords stay on your hardware +### Media & Creative +- [yt-dlp: Video Downloading](03-opensource/media-creative/yt-dlp.md) — download from YouTube and hundreds of other sites, Plex-optimized format selection + --- ## 🎙️ Streaming & Podcasting @@ -107,6 +110,7 @@ | Date | Article | Domain | |---|---|---| +| 2026-03-14 | [yt-dlp: Video Downloading](03-opensource/media-creative/yt-dlp.md) | Open Source | | 2026-03-13 | [Vaultwarden: Self-Hosted Password Manager](03-opensource/privacy-security/vaultwarden.md) | Open Source | | 2026-03-13 | [tmux: Persistent Terminal Sessions](03-opensource/dev-tools/tmux.md) | Open Source | | 2026-03-13 | [screen: Simple Persistent Sessions](03-opensource/dev-tools/screen.md) | Open Source | @@ -115,7 +119,6 @@ | 2026-03-13 | [rmlint: Duplicate File Scanning](03-opensource/productivity/rmlint-duplicate-scanning.md) | Open Source | | 2026-03-13 | [SnapRAID & MergerFS Storage Setup](01-linux/storage/snapraid-mergerfs-setup.md) | Linux | | 2026-03-13 | [Qwen2.5-14B OOM on RTX 3080 Ti (12GB)](05-troubleshooting/gpu-display/qwen-14b-oom-3080ti.md) | Troubleshooting | -| 2026-03-13 | [Apache Outage: Fail2ban Self-Ban + Missing iptables Rules](05-troubleshooting/networking/fail2ban-self-ban-apache-outage.md) | Troubleshooting | ---