Youtube-DL: How to strip video information/description when converting audiofile to MP3?

Solution 1:

I don't believe you can currently control the --add-metadata option.

However you can use the --exec option to execute a command afterwards using the reference to the output file {} and ask ffmpeg to strip the unwanted metadata like so:

--exec "ffmpeg -y -i {} -map 0 -c copy -metadata comment=\"\" -metadata description=\"\" -metadata purl=\"\" temp.mp3"

Performing the "convert" process in place (overwriting the same file) breaks the stream data of the output file but adding an auxiliary temp.mp3 and then overwriting it makes it work like a charm.

I've tested the following command combination:

youtube-dl -o "%(title)s.%(ext)s" -x --audio-format mp3 --audio-quality 320K --embed-thumbnail --add-metadata --metadata-from-title "%(artist)s - %(title)s" <youtube url> --exec "ffmpeg -y -i {} -map 0 -c copy -metadata comment=\"\" -metadata description=\"\" -metadata purl=\"\" temp.mp3;cp -r temp.mp3 {};rm -rf temp.mp3"

I hope this helps!

PS: I know the question is a bit old but posting a working solution might help you and others.