]> jfr.im git - yt-dlp.git/blobdiff - youtube_dlc/options.py
Better Format Selection
[yt-dlp.git] / youtube_dlc / options.py
index e6873c703ffe5260143e44d603453d2dc2296e97..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',
@@ -580,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(
@@ -771,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(