projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/master'
[youtube-dl]
/
youtube_dl
/
__init__.py
diff --git
a/youtube_dl/__init__.py
b/youtube_dl/__init__.py
index bc6a6d180dbf20059e414ad7e557b36427c34c5f..431460c5790fadd46e6880004465c1eda87e290d 100644
(file)
--- a/
youtube_dl/__init__.py
+++ b/
youtube_dl/__init__.py
@@
-45,6
+45,7
@@
import sys
import warnings
import platform
import warnings
import platform
+
from .utils import *
from .update import update_self
from .version import __version__
from .utils import *
from .update import update_self
from .version import __version__
@@
-99,6
+100,16
@@
def parseOpts(overrideArguments=None):
pass
return None
pass
return None
+ def _hide_login_info(opts):
+ opts = list(opts)
+ for private_opt in ['-p', '--password', '-u', '--username']:
+ try:
+ i = opts.index(private_opt)
+ opts[i+1] = '<PRIVATE>'
+ except ValueError:
+ pass
+ return opts
+
max_width = 80
max_help_position = 80
max_width = 80
max_help_position = 80
@@
-357,9
+368,9
@@
def parseOpts(overrideArguments=None):
argv = systemConf + userConf + commandLineConf
opts, args = parser.parse_args(argv)
if opts.verbose:
argv = systemConf + userConf + commandLineConf
opts, args = parser.parse_args(argv)
if opts.verbose:
- sys.stderr.write(u'[debug] System config: ' + repr(
systemConf
) + '\n')
- sys.stderr.write(u'[debug] User config: ' + repr(
userConf
) + '\n')
- sys.stderr.write(u'[debug] Command-line args: ' + repr(
commandLineConf
) + '\n')
+ sys.stderr.write(u'[debug] System config: ' + repr(
_hide_login_info(systemConf)
) + '\n')
+ sys.stderr.write(u'[debug] User config: ' + repr(
_hide_login_info(userConf)
) + '\n')
+ sys.stderr.write(u'[debug] Command-line args: ' + repr(
_hide_login_info(commandLineConf)
) + '\n')
return parser, opts, args
return parser, opts, args
@@
-611,7
+622,7
@@
def _real_main(argv=None):
sys.exc_clear()
except:
pass
sys.exc_clear()
except:
pass
- sys.stderr.write(u'[debug] Python version %s - %s' %(platform.python_version(), platform
.platform
()) + u'\n')
+ sys.stderr.write(u'[debug] Python version %s - %s' %(platform.python_version(), platform
_name
()) + u'\n')
sys.stderr.write(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n')
ydl.add_default_info_extractors()
sys.stderr.write(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n')
ydl.add_default_info_extractors()