X-Git-Url: https://jfr.im/git/yt-dlp.git/blobdiff_plain/044ecf795d155ff8bea995fa769a177b0a638a7b..6fd35a110138b027113d5dfedc96ae5d3cfc3dae:/youtube_dlc/options.py diff --git a/youtube_dlc/options.py b/youtube_dlc/options.py index 1d7a7fed2..41ad8a579 100644 --- a/youtube_dlc/options.py +++ b/youtube_dlc/options.py @@ -140,15 +140,15 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): general.add_option( '-U', '--update', action='store_true', dest='update_self', - help='Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)') + help='[BROKEN] Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)') general.add_option( - '-i', '--ignore-errors', - action='store_true', dest='ignoreerrors', default=False, - help='Continue on download errors, for example to skip unavailable videos in a playlist') + '-i', '--ignore-errors', '--no-abort-on-error', + action='store_true', dest='ignoreerrors', default=True, + help='Continue on download errors, for example to skip unavailable videos in a playlist (default)') general.add_option( - '--abort-on-error', + '--abort-on-error', '--no-ignore-errors', action='store_false', dest='ignoreerrors', - help='Abort downloading of further videos (in the playlist or the command line) if an error occurs') + help='Abort downloading of further videos if an error occurs') general.add_option( '--dump-user-agent', action='store_true', dest='dump_user_agent', default=False, @@ -168,23 +168,31 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): general.add_option( '--default-search', dest='default_search', metavar='PREFIX', - help='Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for youtube-dlc "large apple". Use the value "auto" to let youtube-dlc guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching.') + help='Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for youtube-dl "large apple". Use the value "auto" to let youtube-dl guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching.') general.add_option( - '--ignore-config', + '--ignore-config', '--no-config', action='store_true', - help='Do not read configuration files. ' - 'When given in the global configuration file /etc/youtube-dlc.conf: ' - 'Do not read the user configuration in ~/.config/youtube-dlc/config ' - '(%APPDATA%/youtube-dlc/config.txt on Windows)') + help=( + 'Do not read configuration files. ' + 'When given in the global configuration file /etc/youtube-dl.conf: ' + 'Do not read the user configuration in ~/.config/youtube-dl/config ' + '(%APPDATA%/youtube-dl/config.txt on Windows)')) general.add_option( '--config-location', dest='config_location', metavar='PATH', help='Location of the configuration file; either the path to the config or its containing directory.') general.add_option( '--flat-playlist', - action='store_const', dest='extract_flat', const='in_playlist', - default=False, + action='store_const', dest='extract_flat', const='in_playlist', default=False, help='Do not extract the videos of a playlist, only list them.') + general.add_option( + '--flat-videos', + action='store_true', dest='extract_flat', + help='Do not resolve the video urls') + general.add_option( + '--no-flat-playlist', + action='store_false', dest='extract_flat', + help='Extract the videos of a playlist') general.add_option( '--mark-watched', action='store_true', dest='mark_watched', default=False, @@ -192,7 +200,7 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): general.add_option( '--no-mark-watched', action='store_false', dest='mark_watched', default=False, - help='Do not mark videos watched (YouTube only)') + help='Do not mark videos watched') general.add_option( '--no-color', '--no-colors', action='store_true', dest='no_color', @@ -203,10 +211,11 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): network.add_option( '--proxy', dest='proxy', default=None, metavar='URL', - help='Use the specified HTTP/HTTPS/SOCKS proxy. To enable ' - 'SOCKS proxy, specify a proper scheme. For example ' - 'socks5://127.0.0.1:1080/. Pass in an empty string (--proxy "") ' - 'for direct connection') + help=( + 'Use the specified HTTP/HTTPS/SOCKS proxy. To enable ' + 'SOCKS proxy, specify a proper scheme. For example ' + 'socks5://127.0.0.1:1080/. Pass in an empty string (--proxy "") ' + 'for direct connection')) network.add_option( '--socket-timeout', dest='socket_timeout', type=float, default=None, metavar='SECONDS', @@ -231,8 +240,9 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): geo.add_option( '--geo-verification-proxy', dest='geo_verification_proxy', default=None, metavar='URL', - help='Use this proxy to verify the IP address for some geo-restricted sites. ' - 'The default proxy specified by --proxy (or none, if the option is not present) is used for the actual downloading.') + help=( + 'Use this proxy to verify the IP address for some geo-restricted sites. ' + 'The default proxy specified by --proxy (or none, if the option is not present) is used for the actual downloading.')) geo.add_option( '--cn-verification-proxy', dest='cn_verification_proxy', default=None, metavar='URL', @@ -290,15 +300,22 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): selection.add_option( '--date', metavar='DATE', dest='date', default=None, - help='Download only videos uploaded in this date') + help=( + 'Download only videos uploaded in this date.' + 'The date can be "YYYYMMDD" or in the format' + '"(now|today)[+-][0-9](day|week|month|year)(s)?"')) selection.add_option( '--datebefore', metavar='DATE', dest='datebefore', default=None, - help='Download only videos uploaded on or before this date (i.e. inclusive)') + help=( + 'Download only videos uploaded on or before this date. ' + 'The date formats accepted is the same as --date')) selection.add_option( '--dateafter', metavar='DATE', dest='dateafter', default=None, - help='Download only videos uploaded on or after this date (i.e. inclusive)') + help=( + 'Download only videos uploaded on or after this date. ' + 'The date formats accepted is the same as --date')) selection.add_option( '--min-views', metavar='COUNT', dest='min_views', default=None, type=int, @@ -326,8 +343,11 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): '100 times and disliked less than 50 times (or the dislike ' 'functionality is not available at the given service), but who ' 'also have a description, use --match-filter ' - '"like_count > 100 & dislike_count 100 & dislike_count .+?) - (?P.+)"') + help=( + 'Parse additional metadata like song title / artist from the video title. ' + 'The format syntax is the same as --output. Regular expression with ' + 'named capture groups may also be used. ' + 'The parsed parameters replace existing values. ' + 'Example: --metadata-from-title "%(artist)s - %(title)s" matches a title like ' + '"Coldplay - Paradise". ' + 'Example (regex): --metadata-from-title "(?P<artist>.+?) - (?P<title>.+)"')) postproc.add_option( '--xattrs', action='store_true', dest='xattrs', default=False, @@ -854,15 +1036,16 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): postproc.add_option( '--fixup', metavar='POLICY', dest='fixup', default='detect_or_warn', - help='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)') + help=( + '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)')) postproc.add_option( - '--prefer-avconv', + '--prefer-avconv', '--no-prefer-ffmpeg', action='store_false', dest='prefer_ffmpeg', help='Prefer avconv over ffmpeg for running the postprocessors') postproc.add_option( - '--prefer-ffmpeg', + '--prefer-ffmpeg', '--no-prefer-avconv', action='store_true', dest='prefer_ffmpeg', help='Prefer ffmpeg over avconv for running the postprocessors (default)') postproc.add_option( @@ -878,13 +1061,48 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): metavar='FORMAT', dest='convertsubtitles', default=None, help='Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc)') + sponskrub = optparse.OptionGroup(parser, 'SponSkrub Options (SponsorBlock)') + sponskrub.add_option( + '--sponskrub', + action='store_true', dest='sponskrub', default=None, + help=( + 'Use sponskrub to mark sponsored sections with the data available in SponsorBlock API. ' + 'This is enabled by default if the sponskrub binary exists (Youtube only)')) + sponskrub.add_option( + '--no-sponskrub', + action='store_false', dest='sponskrub', + help='Do not use sponskrub') + sponskrub.add_option( + '--sponskrub-cut', default=False, + action='store_true', dest='sponskrub_cut', + help='Cut out the sponsor sections instead of simply marking them') + sponskrub.add_option( + '--no-sponskrub-cut', + action='store_false', dest='sponskrub_cut', + help='Simply mark the sponsor sections, not cut them out (default)') + sponskrub.add_option( + '--sponskrub-force', default=False, + action='store_true', dest='sponskrub_force', + help='Run sponskrub even if the video was already downloaded') + sponskrub.add_option( + '--no-sponskrub-force', + action='store_true', dest='sponskrub_force', + help='Do not cut out the sponsor sections if the video was already downloaded (default)') + sponskrub.add_option( + '--sponskrub-location', metavar='PATH', + dest='sponskrub_path', default='', + help='Location of the sponskrub binary; either the path to the binary or its containing directory.') + sponskrub.add_option( + '--sponskrub-args', dest='sponskrub_args', metavar='ARGS', + help=optparse.SUPPRESS_HELP) + extractor = optparse.OptionGroup(parser, 'Extractor Options') extractor.add_option( - '--allow-dynamic-mpd', + '--allow-dynamic-mpd', '--no-ignore-dynamic-mpd', action='store_true', dest='dynamic_mpd', default=True, - help=optparse.SUPPRESS_HELP) + help='Process dynamic DASH manifests (default)') extractor.add_option( - '--ignore-dynamic-mpd', + '--ignore-dynamic-mpd', '--no-allow-dynamic-mpd', action='store_false', dest='dynamic_mpd', help='Do not process dynamic DASH manifests') @@ -895,6 +1113,7 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): parser.add_option_group(downloader) parser.add_option_group(filesystem) parser.add_option_group(thumbnail) + parser.add_option_group(link) parser.add_option_group(verbosity) parser.add_option_group(workarounds) parser.add_option_group(video_format) @@ -902,6 +1121,7 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser): parser.add_option_group(authentication) parser.add_option_group(adobe_pass) parser.add_option_group(postproc) + parser.add_option_group(sponskrub) parser.add_option_group(extractor) if overrideArguments is not None: