mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
Merge branch 'patch-2' of https://github.com/wwqgtxx/you-get into wwqgtxx-patch-2
This commit is contained in:
commit
b487baa256
@ -1215,10 +1215,11 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
||||
-t | --timeout <SECONDS> Set socket timeout.
|
||||
-d | --debug Show traceback and other debug info.
|
||||
-I | --input-file Read non-playlist urls from file.
|
||||
-P | --password <PASSWORD> Set video visit password to PASSWORD.
|
||||
'''
|
||||
|
||||
short_opts = 'Vhfiuc:ndF:O:o:p:x:y:s:t:I:'
|
||||
opts = ['version', 'help', 'force', 'info', 'url', 'cookies', 'no-caption', 'no-merge', 'no-proxy', 'debug', 'json', 'format=', 'stream=', 'itag=', 'output-filename=', 'output-dir=', 'player=', 'http-proxy=', 'socks-proxy=', 'extractor-proxy=', 'lang=', 'timeout=', 'input-file=']
|
||||
short_opts = 'Vhfiuc:ndF:O:o:p:x:y:s:t:I:P:'
|
||||
opts = ['version', 'help', 'force', 'info', 'url', 'cookies', 'no-caption', 'no-merge', 'no-proxy', 'debug', 'json', 'format=', 'stream=', 'itag=', 'output-filename=', 'output-dir=', 'player=', 'http-proxy=', 'socks-proxy=', 'extractor-proxy=', 'lang=', 'timeout=', 'input-file=', 'password=']
|
||||
#dead code? download_playlist is a function and always True
|
||||
#if download_playlist:
|
||||
short_opts = 'l' + short_opts
|
||||
@ -1252,6 +1253,7 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
||||
traceback = False
|
||||
timeout = 600
|
||||
urls_from_file = []
|
||||
password = None
|
||||
|
||||
for o, a in opts:
|
||||
if o in ('-V', '--version'):
|
||||
@ -1330,6 +1332,8 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
||||
lang = a
|
||||
elif o in ('-t', '--timeout'):
|
||||
timeout = int(a)
|
||||
elif o in ('-P', '--password',):
|
||||
password = a
|
||||
elif o in ('-I', '--input-file'):
|
||||
logging.debug('you are trying to load urls from {}'.format(a))
|
||||
if playlist:
|
||||
|
@ -196,7 +196,9 @@ class Youku(VideoExtractor):
|
||||
if data.get('error'):
|
||||
if data['error']['code'] == -2002:
|
||||
self.password_protected = True
|
||||
self.password = input(log.sprint('Password: ', log.YELLOW))
|
||||
self.password = kwargs.get("password", None)
|
||||
if not self.password:
|
||||
self.password = input(log.sprint('Password: ', log.YELLOW))
|
||||
data = youku_ups(self.vid, password=self.password)['data']
|
||||
if data.get('error'):
|
||||
log.wtf(data['error']['note'])
|
||||
|
Loading…
Reference in New Issue
Block a user