Add option --convert-thumbnails

Closes: https://github.com/yt-dlp/yt-dlp/issues/99 https://github.com/yt-dlp/yt-dlp/issues/102
This commit is contained in:
pukkandan
2021-04-11 03:48:52 +05:30
parent 56d868dbb7
commit 8fa43c73d8
6 changed files with 124 additions and 60 deletions

View File

@@ -230,6 +230,9 @@ def _real_main(argv=None):
if opts.convertsubtitles is not None:
if opts.convertsubtitles not in ('srt', 'vtt', 'ass', 'lrc'):
parser.error('invalid subtitle format specified')
if opts.convertthumbnails is not None:
if opts.convertthumbnails not in ('jpg', ):
parser.error('invalid thumbnail format specified')
if opts.date is not None:
date = DateRange.day(opts.date)
@@ -332,6 +335,13 @@ def _real_main(argv=None):
# Run this before the actual video download
'when': 'before_dl'
})
if opts.convertthumbnails:
postprocessors.append({
'key': 'FFmpegThumbnailsConvertor',
'format': opts.convertthumbnails,
# Run this before the actual video download
'when': 'before_dl'
})
if opts.extractaudio:
postprocessors.append({
'key': 'FFmpegExtractAudio',