'--reject-title',
dest='rejecttitle', metavar='REGEX',
help=optparse.SUPPRESS_HELP)
- selection.add_option(
- '--max-downloads',
- dest='max_downloads', metavar='NUMBER', type=int, default=None,
- help='Abort after downloading NUMBER files')
selection.add_option(
'--min-filesize',
metavar='SIZE', dest='min_filesize', default=None,
'--download-archive', metavar='FILE',
dest='download_archive',
help='Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it')
+ selection.add_option(
+ '--no-download-archive',
+ dest='download_archive', action="store_const", const=None,
+ help='Do not use archive file (default)')
+ selection.add_option(
+ '--max-downloads',
+ dest='max_downloads', metavar='NUMBER', type=int, default=None,
+ help='Abort after downloading NUMBER files')
selection.add_option(
'--break-on-existing',
action='store_true', dest='break_on_existing', default=False,
'--skip-playlist-after-errors', metavar='N',
dest='skip_playlist_after_errors', default=None, type=int,
help='Number of allowed failures until the rest of the playlist is skipped')
- selection.add_option(
- '--no-download-archive',
- dest='download_archive', action="store_const", const=None,
- help='Do not use archive file (default)')
selection.add_option(
'--include-ads',
dest='include_ads', action='store_true',
filesystem.add_option(
'--cookies',
dest='cookiefile', metavar='FILE',
- help='File to read cookies from and dump cookie jar in')
+ help='Netscape formatted file to read cookies from and dump cookie jar in')
filesystem.add_option(
'--no-cookies',
action='store_const', const=None, dest='cookiefile', metavar='FILE',
thumbnail = optparse.OptionGroup(parser, 'Thumbnail Options')
thumbnail.add_option(
'--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')
thumbnail.add_option(
'--no-write-thumbnail',
help='Do not write thumbnail image to disk (default)')
thumbnail.add_option(
'--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')
thumbnail.add_option(
'--list-thumbnails',
'Automatically correct known faults of the file. '
'One of never (do nothing), warn (only emit a warning), '
'detect_or_warn (the default; fix file if we can, warn otherwise), '
- 'force (try fixing even if file already exists'))
+ 'force (try fixing even if file already exists)'))
postproc.add_option(
'--prefer-avconv', '--no-prefer-ffmpeg',
action='store_false', dest='prefer_ffmpeg',
current_path = os.path.join(path, '%s.conf' % package)
config = _readOptions(current_path, default=None)
if config is not None:
+ current_path = os.path.realpath(current_path)
+ if current_path in paths.values():
+ return False
configs[name], paths[name] = config, current_path
return parser.parse_args(config)[0].ignoreconfig
return False