Skip to main content

Overview

yt-dlp can extract, parse, modify, and embed metadata in your downloaded files. This is useful for organizing media libraries, fixing incorrect information, or adding custom metadata fields.

Understanding Metadata Flow

Metadata modification happens in this order:
  1. Extraction: Metadata obtained from the website
  2. Parsing: Custom parsing with --parse-metadata
  3. Replacement: Text replacement with --replace-in-metadata
  4. Format selection: Uses modified metadata
  5. Post-processing: Embedding metadata in files
  6. Final output: File with embedded metadata
Metadata modification happens before format selection and post-processing. Some fields may be added or changed during these steps, potentially overriding your changes.

Parsing Metadata

Basic syntax

The --parse-metadata FROM:TO option extracts data from one field and creates or modifies another:

Extract from title

Extract from description

1

Simple pattern matching

2

Multi-line matching

3

Extract URLs

Modifying File Metadata

Use the meta_ prefix to set metadata that will be embedded in the file:

Common metadata fields

Default Metadata Mappings

yt-dlp automatically maps these fields to file metadata:
You can override any of these defaults using --parse-metadata with the meta_ prefix.

Replacing Text in Metadata

Use --replace-in-metadata to find and replace text:

Removing Metadata Fields

Set fields to empty to remove them:

Advanced Metadata Examples

Music downloads

TV series episodes

Podcast episodes

Clean YouTube titles

Metadata for Different Streams

Set metadata for individual streams using meta<n>_ prefix:

Copy Metadata Between Fields

Timing and Execution

Control when metadata parsing happens:

Embedding Metadata

After parsing and modifying metadata, embed it in the file:
1

Enable metadata embedding

This also embeds chapters and infojson (in MKV) unless disabled.
2

Control what gets embedded

3

Verify embedded metadata

Regular Expression Tips

Common patterns

Example patterns

Troubleshooting

Metadata not embedding

Regex not matching

Wrong metadata in file

Metadata might be overwritten during post-processing. Use meta_ prefix to ensure your values are used.

Next Steps

Output Templates

Use metadata in filename templates

Post-Processing

Learn about post-processing options

Audio Extraction

Embed metadata in audio files

Format Selection

Use metadata in format selection