There seems to be almost no documentation on the youtube-dl python library and the parameters for the cli tool don't translate 1:1...
I was able to find some parameters in the YoutubeDL.py
that is linked in the Readme, but definitely not all of them.
For instance, it is not clear to me how I can embed the video thumbnail into the video file I'm downloading. With the cli tool, I can use --embed-thumbnail
, but when I try to use it in the config object it doesn't work. I don't even get an error
ydl_opts = {
'format': 'bestvideo[height<=480]+bestaudio[ext=m4a]/best', # works
'embed-thumbnail': True, # not working
'embedthumbnail': True, # not working
'updatetime': False # works
}
youtube_dl.YoutubeDL(ydl_opts)
Here is a cli example that worked for me:
youtube-dl --format "bestvideo[height<=480]+bestaudio[ext=m4a]/best" --embed-thumbnail https://www.youtube.com/watch?v=Co2KIYmaeTY
I verified it by running this on the resulting .mp4 file to extract the thumbnail:
AtomicParsley "thumbnail test-Co2KIYmaeTY.mp4" -E
This file is the closest I got: https://github.com/rg3/youtube-dl/blob/master/youtube_dl/postprocessor/embedthumbnail.py
But I'm not sure what to make out of it...