'Set metadata based on the output filename in yt-dlp

I can extract audio from video:

yt-dlp -x --audio-format vorbis --audio-quality 256k --embed-thumbnail -P ~/Music -o "John Doe - Cool song.%(ext)s" tubelink.kom

Now, I would like to embed metadata based on the filename format output, possible? In my example code would be artist John Doe and Song name Cool song. Thanks.



Solution 1:[1]

Look for "metadata" in documentation.

https://github.com/yt-dlp/yt-dlp#modifying-metadata-examples

# Interpret the title as "Artist - Title"

yt-dlp --parse-metadata "title:%(artist)s - %(title)s"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Doe