Conversion done for subtitles options; secondary option names were dropped (only one option name per option now); multiple position arguments enabled for --sub-langs which may result in needed changes with URL, perhaps URL(s) should always be first
This commit is contained in:
parent
d297814621
commit
6211b1a635
@ -23,13 +23,13 @@ Usage:
|
|||||||
[--verbose] [--dump-intermediate-pages] [--format FORMAT]
|
[--verbose] [--dump-intermediate-pages] [--format FORMAT]
|
||||||
[--all-formats] [--prefer-free-formats] [--max-quality FORMAT]
|
[--all-formats] [--prefer-free-formats] [--max-quality FORMAT]
|
||||||
[--list-formats] [--write-sub] [--write-auto-sub] [--all-subs]
|
[--list-formats] [--write-sub] [--write-auto-sub] [--all-subs]
|
||||||
[--list-subs] [--sub-format FORMAT] [--sub-lang LANGS]
|
[--list-subs] [--sub-format FORMAT] [--sub-lang LANGS ...]
|
||||||
[--username USERNAME --password PASSWORD | --netrc]
|
[--username USERNAME --password PASSWORD | --netrc]
|
||||||
[--video-password PASSWORD] [--extract-audio]
|
[--video-password PASSWORD] [--extract-audio]
|
||||||
[--audio-format FORMAT] [--audio-quality QUALITY]
|
[--audio-format FORMAT] [--audio-quality QUALITY]
|
||||||
[--recode-video FORMAT] [--keep-video] [--no-post-overwrites]
|
[--recode-video FORMAT] [--keep-video] [--no-post-overwrites]
|
||||||
[--embed-subs]
|
[--embed-subs]
|
||||||
URL [url...]
|
URL [url ...]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
General Options:
|
General Options:
|
||||||
@ -155,10 +155,10 @@ Options:
|
|||||||
--all-subs downloads all the available subtitles of the
|
--all-subs downloads all the available subtitles of the
|
||||||
video
|
video
|
||||||
--list-subs lists all available subtitles for the video
|
--list-subs lists all available subtitles for the video
|
||||||
--sub-format FORMAT subtitle format (default=srt) ([sbv/vtt] youtube
|
--sub-format FORMAT subtitle format ([sbv/vtt] youtube only)
|
||||||
only)
|
[default: srt]
|
||||||
--sub-lang LANGS languages of the subtitles to download (optional)
|
--sub-lang LANGS ... languages of the subtitles to download (optional,
|
||||||
separated by commas, use IETF language tags like
|
multiple arguments) use IETF language tags like
|
||||||
'en,pt'
|
'en,pt'
|
||||||
|
|
||||||
Authentication Options:
|
Authentication Options:
|
||||||
@ -389,25 +389,25 @@ def parseOpts(overrideArguments=None):
|
|||||||
#video_format.add_option('-F', '--list-formats',
|
#video_format.add_option('-F', '--list-formats',
|
||||||
# action='store_true', dest='listformats', help='list all available formats (currently youtube only)')
|
# action='store_true', dest='listformats', help='list all available formats (currently youtube only)')
|
||||||
|
|
||||||
subtitles.add_option('--write-sub', '--write-srt',
|
#subtitles.add_option('--write-sub', '--write-srt',
|
||||||
action='store_true', dest='writesubtitles',
|
# action='store_true', dest='writesubtitles',
|
||||||
help='write subtitle file', default=False)
|
# help='write subtitle file', default=False)
|
||||||
subtitles.add_option('--write-auto-sub', '--write-automatic-sub',
|
#subtitles.add_option('--write-auto-sub', '--write-automatic-sub',
|
||||||
action='store_true', dest='writeautomaticsub',
|
# action='store_true', dest='writeautomaticsub',
|
||||||
help='write automatic subtitle file (youtube only)', default=False)
|
# help='write automatic subtitle file (youtube only)', default=False)
|
||||||
subtitles.add_option('--all-subs',
|
#subtitles.add_option('--all-subs',
|
||||||
action='store_true', dest='allsubtitles',
|
# action='store_true', dest='allsubtitles',
|
||||||
help='downloads all the available subtitles of the video', default=False)
|
# help='downloads all the available subtitles of the video', default=False)
|
||||||
subtitles.add_option('--list-subs',
|
#subtitles.add_option('--list-subs',
|
||||||
action='store_true', dest='listsubtitles',
|
# action='store_true', dest='listsubtitles',
|
||||||
help='lists all available subtitles for the video', default=False)
|
# help='lists all available subtitles for the video', default=False)
|
||||||
subtitles.add_option('--sub-format',
|
#subtitles.add_option('--sub-format',
|
||||||
action='store', dest='subtitlesformat', metavar='FORMAT',
|
# action='store', dest='subtitlesformat', metavar='FORMAT',
|
||||||
help='subtitle format (default=srt) ([sbv/vtt] youtube only)', default='srt')
|
# help='subtitle format (default=srt) ([sbv/vtt] youtube only)', default='srt')
|
||||||
subtitles.add_option('--sub-lang', '--sub-langs', '--srt-lang',
|
#subtitles.add_option('--sub-lang', '--sub-langs', '--srt-lang',
|
||||||
action='callback', dest='subtitleslangs', metavar='LANGS', type='str',
|
# action='callback', dest='subtitleslangs', metavar='LANGS', type='str',
|
||||||
default=[], callback=_comma_separated_values_options_callback,
|
# default=[], callback=_comma_separated_values_options_callback,
|
||||||
help='languages of the subtitles to download (optional) separated by commas, use IETF language tags like \'en,pt\'')
|
# help='languages of the subtitles to download (optional) separated by commas, use IETF language tags like \'en,pt\'')
|
||||||
|
|
||||||
#downloader.add_option('-r', '--rate-limit',
|
#downloader.add_option('-r', '--rate-limit',
|
||||||
# dest='ratelimit', metavar='LIMIT', help='maximum download rate (e.g. 50k or 44.6m)')
|
# dest='ratelimit', metavar='LIMIT', help='maximum download rate (e.g. 50k or 44.6m)')
|
||||||
@ -781,12 +781,12 @@ def _real_main(argv=None):
|
|||||||
'writedescription': opts.writedescription,
|
'writedescription': opts.writedescription,
|
||||||
'writeinfojson': opts.writeinfojson,
|
'writeinfojson': opts.writeinfojson,
|
||||||
'writethumbnail': opts.writethumbnail,
|
'writethumbnail': opts.writethumbnail,
|
||||||
'writesubtitles': opts.writesubtitles,
|
'writesubtitles': opts['--write-sub'],
|
||||||
'writeautomaticsub': opts.writeautomaticsub,
|
'writeautomaticsub': opts['--write-auto-sub'],
|
||||||
'allsubtitles': opts.allsubtitles,
|
'allsubtitles': opts['--all-subs'],
|
||||||
'listsubtitles': opts.listsubtitles,
|
'listsubtitles': opts['--list-subs'],
|
||||||
'subtitlesformat': opts.subtitlesformat,
|
'subtitlesformat': opts['--sub-format'],
|
||||||
'subtitleslangs': opts.subtitleslangs,
|
'subtitleslangs': opts['--sub-lang'],
|
||||||
'matchtitle': decodeOption(opts['--match-title']),
|
'matchtitle': decodeOption(opts['--match-title']),
|
||||||
'rejecttitle': decodeOption(opts['--reject-title']),
|
'rejecttitle': decodeOption(opts['--reject-title']),
|
||||||
'max_downloads': opts['--max-downloads'],
|
'max_downloads': opts['--max-downloads'],
|
||||||
@ -827,7 +827,7 @@ def _real_main(argv=None):
|
|||||||
if opts.recodevideo:
|
if opts.recodevideo:
|
||||||
ydl.add_post_processor(FFmpegVideoConvertor(preferedformat=opts.recodevideo))
|
ydl.add_post_processor(FFmpegVideoConvertor(preferedformat=opts.recodevideo))
|
||||||
if opts.embedsubtitles:
|
if opts.embedsubtitles:
|
||||||
ydl.add_post_processor(FFmpegEmbedSubtitlePP(subtitlesformat=opts.subtitlesformat))
|
ydl.add_post_processor(FFmpegEmbedSubtitlePP(subtitlesformat=opts['--sub-format']))
|
||||||
|
|
||||||
# Update version
|
# Update version
|
||||||
if opts['--update']:
|
if opts['--update']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user