From 6a69101bff645feef6d3d0f964967f2bd5c7a54d Mon Sep 17 00:00:00 2001 From: Alex Shnitman Date: Sat, 18 Jul 2026 10:14:19 +0300 Subject: [PATCH] Add parse-metadata and video+audio extraction recipes --- YTDL_OPTIONS-Cookbook.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/YTDL_OPTIONS-Cookbook.md b/YTDL_OPTIONS-Cookbook.md index e70600e..7349c41 100644 --- a/YTDL_OPTIONS-Cookbook.md +++ b/YTDL_OPTIONS-Cookbook.md @@ -62,3 +62,30 @@ global, define it as a named preset via `YTDL_OPTIONS_PRESETS`. Note: postprocessors only run on **success** — there is currently no hook for failed downloads. + +## Using --parse-metadata (MetadataParser) from JSON + +yt-dlp's `--parse-metadata` normally builds Python tuples that JSON can't +express. Use the `MetadataFromField` postprocessor instead — it takes plain +`"FROM:TO"` strings and behaves identically. For example, to clear the +description (the equivalent of `--parse-metadata ":(?P)"`): + + YTDL_OPTIONS={"postprocessors":[{"key":"MetadataFromField","formats":[":(?P)"],"when":"pre_process"}]} + +Each entry in `formats` is one `FROM:TO` expression, exactly as you would +write it on the yt-dlp command line. + +## Download video and extract audio in one go + +`keepvideo` plus `FFmpegExtractAudio` gives you both the video file and an +audio file from a single download: + + YTDL_OPTIONS={"keepvideo":true,"postprocessors":[{"key":"FFmpegExtractAudio","preferredcodec":"mp3"}]} + +To convert the video container instead (e.g. everything as MKV): + + YTDL_OPTIONS={"postprocessors":[{"key":"FFmpegVideoConvertor","preferedformat":"mkv"}]} + +(Note: yt-dlp's option is really spelled `preferedformat`, with one `r`.) +Define these as named presets via `YTDL_OPTIONS_PRESETS` to pick them +per-download in the UI instead of applying them globally.