]> jfr.im git - yt-dlp.git/blobdiff - youtube_dlc/options.py
Better Format Selection
[yt-dlp.git] / youtube_dlc / options.py
index 2cc5eee742dcef08553b12082c10b0e9f23248fb..44eba3e9c7359cde7f36fcbe01f39183d214186f 100644 (file)
@@ -344,6 +344,10 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
         '--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(
+        '--break-on-existing',
+        action='store_true', dest='break_on_existing', default=False,
+        help="Stop the download process after attempting to download a file that's in the archive.")
     selection.add_option(
         '--include-ads',
         dest='include_ads', action='store_true',
@@ -393,7 +397,40 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
     video_format.add_option(
         '-f', '--format',
         action='store', dest='format', metavar='FORMAT', default=None,
-        help='Video format code, see the "FORMAT SELECTION" for all the info')
+        help='Video format code, see "FORMAT SELECTION" for more details')
+    video_format.add_option(
+        '-S', '--format-sort',
+        dest='format_sort', default=[],
+        action='callback', callback=_comma_separated_values_options_callback, type='str',
+        help='Sort the formats by the fields given, see "Sorting Formats" for more details')
+    video_format.add_option(
+        '--format-sort-force', '--S-force',
+        action='store_true', dest='format_sort_force', metavar='FORMAT', default=False,
+        help=(
+            'Force user specified sort order to have precedence over all fields, '
+            'see "Sorting Formats" for more details'))
+    video_format.add_option(
+        '--no-format-sort-force',
+        action='store_false', dest='format_sort_force', metavar='FORMAT', default=False,
+        help=(
+            'Some fields have precedence over the user specified sort order (default), '
+            'see "Sorting Formats" for more details'))
+    video_format.add_option(
+        '--video-multistreams',
+        action='store_true', dest='allow_multiple_video_streams', default=True,
+        help='Allow multiple video streams to be merged into a single file (default)')
+    video_format.add_option(
+        '--no-video-multistreams',
+        action='store_false', dest='allow_multiple_video_streams',
+        help='Only one video stream is downloaded for each output file')
+    video_format.add_option(
+        '--audio-multistreams',
+        action='store_true', dest='allow_multiple_audio_streams', default=True,
+        help='Allow multiple audio streams to be merged into a single file (default)')
+    video_format.add_option(
+        '--no-audio-multistreams',
+        action='store_false', dest='allow_multiple_audio_streams',
+        help='Only one audio stream is downloaded for each output file')
     video_format.add_option(
         '--all-formats',
         action='store_const', dest='format', const='all',
@@ -414,6 +451,14 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
         '--youtube-skip-dash-manifest',
         action='store_false', dest='youtube_include_dash_manifest',
         help='Do not download the DASH manifests and related data on YouTube videos')
+    video_format.add_option(
+        '--youtube-include-hls-manifest',
+        action='store_true', dest='youtube_include_hls_manifest', default=True,
+        help=optparse.SUPPRESS_HELP)
+    video_format.add_option(
+        '--youtube-skip-hls-manifest',
+        action='store_false', dest='youtube_include_hls_manifest',
+        help='Do not download the HLS manifests and related data on YouTube videos')
     video_format.add_option(
         '--merge-output-format',
         action='store', dest='merge_output_format', metavar='FORMAT', default=None,
@@ -572,6 +617,10 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
             'Upper bound of a range for randomized sleep before each download '
             '(maximum possible number of seconds to sleep). Must only be used '
             'along with --min-sleep-interval.'))
+    workarounds.add_option(
+        '--sleep-subtitles',
+        dest='sleep_interval_subtitles', default=0, type=int,
+        help='Enforce sleep interval on subtitles as well')
 
     verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')
     verbosity.add_option(
@@ -763,6 +812,9 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
         '--rm-cache-dir',
         action='store_true', dest='rm_cachedir',
         help='Delete all filesystem cache files')
+    filesystem.add_option(
+        '--trim-file-name', dest='trim_file_name', default=0, type=int,
+        help='Limit the filename length (extension excluded)')
 
     thumbnail = optparse.OptionGroup(parser, 'Thumbnail images')
     thumbnail.add_option(
@@ -790,6 +842,10 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
         '--audio-quality', metavar='QUALITY',
         dest='audioquality', default='5',
         help='Specify ffmpeg/avconv audio quality, insert a value between 0 (better) and 9 (worse) for VBR or a specific bitrate like 128K (default %default)')
+    postproc.add_option(
+        '--remux-video',
+        metavar='FORMAT', dest='remuxvideo', default=None,
+        help='Remux the video to another container format if necessary (currently supported: mp4|mkv, target container format must support video / audio encoding, remuxing may fail)')
     postproc.add_option(
         '--recode-video',
         metavar='FORMAT', dest='recodevideo', default=None,
@@ -859,6 +915,16 @@ 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)')
 
+    extractor = optparse.OptionGroup(parser, 'Extractor Options')
+    extractor.add_option(
+        '--allow-dynamic-mpd',
+        action='store_true', dest='dynamic_mpd', default=True,
+        help=optparse.SUPPRESS_HELP)
+    extractor.add_option(
+        '--ignore-dynamic-mpd',
+        action='store_false', dest='dynamic_mpd',
+        help='Do not process dynamic DASH manifests')
+
     parser.add_option_group(general)
     parser.add_option_group(network)
     parser.add_option_group(geo)
@@ -873,6 +939,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(extractor)
 
     if overrideArguments is not None:
         opts, args = parser.parse_args(overrideArguments)