]> jfr.im git - yt-dlp.git/blobdiff - youtube_dlc/options.py
Add --write-*-link by h-h-h-h
[yt-dlp.git] / youtube_dlc / options.py
index 9ad8a6dddea6b2807be5f2de781bba021e3fc8a5..bd85abd3a850d229c4e008815c87a66db5a9f589 100644 (file)
@@ -397,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',
@@ -797,7 +830,25 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
         action='store_true', dest='list_thumbnails', default=False,
         help='Simulate and list all available thumbnail formats')
 
-    postproc = optparse.OptionGroup(parser, 'Post-processing Options')
+    link = optparse.OptionGroup(parser, 'Internet Shortcut Options')
+    link.add_option(
+        '--write-link',
+        action='store_true', dest='writelink', default=False,
+        help='Write an internet shortcut file, depending on the current platform (.url/.webloc/.desktop). The URL may be cached by the OS.')
+    link.add_option(
+        '--write-url-link',
+        action='store_true', dest='writeurllink', default=False,
+        help='Write a Windows internet shortcut file (.url). Note that the OS caches the URL based on the file path.')
+    link.add_option(
+        '--write-webloc-link',
+        action='store_true', dest='writewebloclink', default=False,
+        help='Write a macOS internet shortcut file (.webloc)')
+    link.add_option(
+        '--write-desktop-link',
+        action='store_true', dest='writedesktoplink', default=False,
+        help='Write a Linux internet shortcut file (.desktop)')
+
+    postproc = optparse.OptionGroup(parser, 'Post-Processing Options')
     postproc.add_option(
         '-x', '--extract-audio',
         action='store_true', dest='extractaudio', default=False,
@@ -899,6 +950,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)