added md5 calculation param

This commit is contained in:
kabaakaba 2015-08-28 15:45:18 +03:00
parent afa17379a4
commit 31b6346cbc
2 changed files with 12 additions and 4 deletions

View File

@ -189,6 +189,8 @@ def _real_main(argv=None):
if opts.allsubtitles and not opts.writeautomaticsub: if opts.allsubtitles and not opts.writeautomaticsub:
opts.writesubtitles = True opts.writesubtitles = True
outtmpl = ((opts.outtmpl is not None and opts.outtmpl) or outtmpl = ((opts.outtmpl is not None and opts.outtmpl) or
(opts.format == '-1' and opts.usetitle and '%(title)s-%(id)s-%(format)s.%(ext)s') or (opts.format == '-1' and opts.usetitle and '%(title)s-%(id)s-%(format)s.%(ext)s') or
(opts.format == '-1' and '%(id)s-%(format)s.%(ext)s') or (opts.format == '-1' and '%(id)s-%(format)s.%(ext)s') or
@ -372,6 +374,7 @@ def _real_main(argv=None):
'external_downloader_args': external_downloader_args, 'external_downloader_args': external_downloader_args,
'postprocessor_args': postprocessor_args, 'postprocessor_args': postprocessor_args,
'cn_verification_proxy': opts.cn_verification_proxy, 'cn_verification_proxy': opts.cn_verification_proxy,
'md5': opts.md5
} }
with YoutubeDL(ydl_opts) as ydl: with YoutubeDL(ydl_opts) as ydl:

View File

@ -162,9 +162,9 @@ def parseOpts(overrideArguments=None):
'--ignore-config', '--ignore-config',
action='store_true', action='store_true',
help='Do not read configuration files. ' help='Do not read configuration files. '
'When given in the global configuration file /etc/youtube-dl.conf: ' 'When given in the global configuration file /etc/youtube-dl.conf: '
'Do not read the user configuration in ~/.config/youtube-dl/config ' 'Do not read the user configuration in ~/.config/youtube-dl/config '
'(%APPDATA%/youtube-dl/config.txt on Windows)') '(%APPDATA%/youtube-dl/config.txt on Windows)')
general.add_option( general.add_option(
'--flat-playlist', '--flat-playlist',
action='store_const', dest='extract_flat', const='in_playlist', action='store_const', dest='extract_flat', const='in_playlist',
@ -175,6 +175,11 @@ def parseOpts(overrideArguments=None):
action='store_true', dest='no_color', action='store_true', dest='no_color',
default=False, default=False,
help='Do not emit color codes in output') help='Do not emit color codes in output')
general.add_option(
'--md5',
action='store_true', dest='md5',
default=False,
help='Calculate md5 of video and save in file')
network = optparse.OptionGroup(parser, 'Network Options') network = optparse.OptionGroup(parser, 'Network Options')
network.add_option( network.add_option(
@ -204,7 +209,7 @@ def parseOpts(overrideArguments=None):
'--cn-verification-proxy', '--cn-verification-proxy',
dest='cn_verification_proxy', default=None, metavar='URL', dest='cn_verification_proxy', default=None, metavar='URL',
help='Use this proxy to verify the IP address for some Chinese sites. ' help='Use this proxy to verify the IP address for some Chinese sites. '
'The default proxy specified by --proxy (or none, if the options is not present) is used for the actual downloading. (experimental)' 'The default proxy specified by --proxy (or none, if the options is not present) is used for the actual downloading. (experimental)'
) )
selection = optparse.OptionGroup(parser, 'Video Selection') selection = optparse.OptionGroup(parser, 'Video Selection')