mirror of
https://github.com/alexta69/metube.git
synced 2026-09-21 13:35:01 +00:00
Add parse-metadata and video+audio extraction recipes
@@ -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<meta_description>)"`):
|
||||
|
||||
YTDL_OPTIONS={"postprocessors":[{"key":"MetadataFromField","formats":[":(?P<meta_description>)"],"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.
|
||||
|
||||
Reference in New Issue
Block a user