Compare commits

..

4 Commits

Author SHA1 Message Date
sepro
77ec2bbdde Use full name for --remux-video 2025-04-19 21:49:21 +02:00
sepro
89fdacdce0 Improve format selection 2025-04-19 21:44:24 +02:00
sepro
15e3a9f603
Apply suggestions from code review
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2025-04-19 20:47:28 +02:00
sepro
cd807498b4
Add -t sleep
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2025-04-19 20:36:28 +02:00

View File

@ -151,10 +151,11 @@ class _YoutubeDLHelpFormatter(optparse.IndentedHelpFormatter):
_PRESET_ALIASES = { _PRESET_ALIASES = {
'mp3': ['-f', 'ba[acodec=mp3]/ba/b', '-x', '--audio-format', 'mp3'], 'mp3': ['-f', 'ba[acodec^=mp3]/ba/b', '-x', '--audio-format', 'mp3'],
'aac': ['-f', 'ba[acodec*=aac]/ba[acodec^=mp4a.40.]/ba/b', '-x', '--audio-format', 'aac'], 'aac': ['-f', 'ba[acodec^=aac]/ba[acodec^=mp4a.40.]/ba/b', '-x', '--audio-format', 'aac'],
'mp4': ['--merge-output-format', 'mp4', '--remux', 'mp4', '-S', 'vcodec:h264,lang,quality,res,fps,hdr:12,acodec:aac'], 'mp4': ['--merge-output-format', 'mp4', '--remux-video', 'mp4', '-S', 'vcodec:h264,lang,quality,res,fps,hdr:12,acodec:aac'],
'mkv': ['--merge-output-format', 'mkv', '--remux', 'mkv'], 'mkv': ['--merge-output-format', 'mkv', '--remux-video', 'mkv'],
'sleep': ['--sleep-subtitles', '5', '--sleep-requests', '0.75', '--sleep-interval', '10', '--max-sleep-interval', '20'],
} }
@ -227,7 +228,7 @@ class _YoutubeDLOptionParser(optparse.OptionParser):
assert formatter, 'Formatter can not be None' assert formatter, 'Formatter can not be None'
formatted_help = super().format_option_help(formatter=formatter) formatted_help = super().format_option_help(formatter=formatter)
formatter.indent() formatter.indent()
heading = formatter.format_heading('Preset aliases') heading = formatter.format_heading('Preset Aliases')
formatter.indent() formatter.indent()
result = [] result = []
for name, args in _PRESET_ALIASES.items(): for name, args in _PRESET_ALIASES.items():
@ -554,10 +555,10 @@ def create_parser():
metavar='PRESET', dest='_', type='str', metavar='PRESET', dest='_', type='str',
action='callback', callback=_preset_alias_callback, action='callback', callback=_preset_alias_callback,
help=( help=(
'Applies a predefined preset. e.g. --preset-alias mp3. ' 'Applies a predefined set of options. e.g. --preset-alias mp3. '
f'The following presets are available: {", ".join(_PRESET_ALIASES)}. ' f'The following presets are available: {", ".join(_PRESET_ALIASES)}. '
'See the "Preset aliases" section at the end for more infos. ' 'See the "Preset Aliases" section at the end for more info. '
'This option can be used multiple times.')) 'This option can be used multiple times'))
network = optparse.OptionGroup(parser, 'Network Options') network = optparse.OptionGroup(parser, 'Network Options')
network.add_option( network.add_option(