mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 00:52:01 +00:00
Allow --no-write-thumbnail
to override --write-all-thumbnail
Closes #1900
This commit is contained in:
parent
146cc4114a
commit
acc0d6a411
@ -559,13 +559,12 @@ def report_unplayable_conflict(opt_name, arg, default=False, allowed=None):
|
|||||||
'_from_cli': True,
|
'_from_cli': True,
|
||||||
})
|
})
|
||||||
if opts.embedthumbnail:
|
if opts.embedthumbnail:
|
||||||
already_have_thumbnail = opts.writethumbnail or opts.write_all_thumbnails
|
|
||||||
postprocessors.append({
|
postprocessors.append({
|
||||||
'key': 'EmbedThumbnail',
|
'key': 'EmbedThumbnail',
|
||||||
# already_have_thumbnail = True prevents the file from being deleted after embedding
|
# already_have_thumbnail = True prevents the file from being deleted after embedding
|
||||||
'already_have_thumbnail': already_have_thumbnail
|
'already_have_thumbnail': opts.writethumbnail
|
||||||
})
|
})
|
||||||
if not already_have_thumbnail:
|
if not opts.writethumbnail:
|
||||||
opts.writethumbnail = True
|
opts.writethumbnail = True
|
||||||
opts.outtmpl['pl_thumbnail'] = ''
|
opts.outtmpl['pl_thumbnail'] = ''
|
||||||
if opts.split_chapters:
|
if opts.split_chapters:
|
||||||
@ -695,8 +694,8 @@ def report_deprecation(val, old, new=None):
|
|||||||
'allow_playlist_files': opts.allow_playlist_files,
|
'allow_playlist_files': opts.allow_playlist_files,
|
||||||
'clean_infojson': opts.clean_infojson,
|
'clean_infojson': opts.clean_infojson,
|
||||||
'getcomments': opts.getcomments,
|
'getcomments': opts.getcomments,
|
||||||
'writethumbnail': opts.writethumbnail,
|
'writethumbnail': opts.writethumbnail is True,
|
||||||
'write_all_thumbnails': opts.write_all_thumbnails,
|
'write_all_thumbnails': opts.writethumbnail == 'all',
|
||||||
'writelink': opts.writelink,
|
'writelink': opts.writelink,
|
||||||
'writeurllink': opts.writeurllink,
|
'writeurllink': opts.writeurllink,
|
||||||
'writewebloclink': opts.writewebloclink,
|
'writewebloclink': opts.writewebloclink,
|
||||||
|
@ -1187,7 +1187,10 @@ def _dict_from_options_callback(
|
|||||||
thumbnail = optparse.OptionGroup(parser, 'Thumbnail Options')
|
thumbnail = optparse.OptionGroup(parser, 'Thumbnail Options')
|
||||||
thumbnail.add_option(
|
thumbnail.add_option(
|
||||||
'--write-thumbnail',
|
'--write-thumbnail',
|
||||||
action='store_true', dest='writethumbnail', default=False,
|
action='callback', dest='writethumbnail', default=False,
|
||||||
|
# Should override --no-write-thumbnail, but not --write-all-thumbnail
|
||||||
|
callback=lambda option, _, __, parser: setattr(
|
||||||
|
parser.values, option.dest, getattr(parser.values, option.dest) or True),
|
||||||
help='Write thumbnail image to disk')
|
help='Write thumbnail image to disk')
|
||||||
thumbnail.add_option(
|
thumbnail.add_option(
|
||||||
'--no-write-thumbnail',
|
'--no-write-thumbnail',
|
||||||
@ -1195,7 +1198,7 @@ def _dict_from_options_callback(
|
|||||||
help='Do not write thumbnail image to disk (default)')
|
help='Do not write thumbnail image to disk (default)')
|
||||||
thumbnail.add_option(
|
thumbnail.add_option(
|
||||||
'--write-all-thumbnails',
|
'--write-all-thumbnails',
|
||||||
action='store_true', dest='write_all_thumbnails', default=False,
|
action='store_const', dest='writethumbnail', const='all',
|
||||||
help='Write all thumbnail image formats to disk')
|
help='Write all thumbnail image formats to disk')
|
||||||
thumbnail.add_option(
|
thumbnail.add_option(
|
||||||
'--list-thumbnails',
|
'--list-thumbnails',
|
||||||
|
Loading…
Reference in New Issue
Block a user