ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.58k stars 9.97k forks source link

Embed thumbnail in post-processed file, instead of refusing due to original filetype #16360

Closed qwertystop closed 6 years ago

qwertystop commented 6 years ago

Please follow the guide below


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.05.01. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?


Description of your issue, suggested solution and other information

When downloading a video for audio extraction with cover/thumbnail embedding, youtube-dl fails to embed a cover image when the downloaded file is not mp3, m4a, or mp4, even if the extracted audio file would be.

Sample command and output:

youtube-dl -o "./newglitch/%(autonumber)s - %(title)s.%(ext)s" -f bestaudio/best --audio-format mp3 --audio-quality 0 --add-metadata --autonumber-start 181 --write-thumbnail --sleep-interval 1 --embed-thumbnail --playlist-start 1 --playlist-end 10 --playlist-reverse "https://www.youtube.com/playlist?list=PL9793A30C55CED7F6"
[youtube:playlist] PL9793A30C55CED7F6: Downloading webpage
[download] Downloading playlist: Video Game Remixes ♫
[youtube:playlist] playlist Video Game Remixes ♫: Downloading 10 videos
[download] Downloading video 1 of 10
[youtube] _hTU9u-DK1g: Downloading webpage
[youtube] _hTU9u-DK1g: Downloading video info webpage
[youtube] _hTU9u-DK1g: Extracting video information
[youtube] _hTU9u-DK1g: Downloading thumbnail ...
[youtube] _hTU9u-DK1g: Writing thumbnail to: ./newglitch/00181 - Red and Blue Lavender Town Remix v.II.jpg
[download] Sleeping 1 seconds...
[download] Destination: ./newglitch/00181 - Red and Blue Lavender Town Remix v.II.webm
[download] 100% of 4.18MiB in 00:01
[ffmpeg] Adding metadata to './newglitch/00181 - Red and Blue Lavender Town Remix v.II.webm'
ERROR: Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.

In this case, the format selector bestaudio/best chose webm, and youtube-dl refuses to embed a thumbnail in webm, where the expected/useful action would be to extract the audio into the requested mp3 format, then embed the thumbnail in that.

qwertystop commented 6 years ago

Cancel this. I had a typo in my command; I forgot to include -x. My sincerest apologies for wasting your time.