rg3/youtube-dl — Issue #283: getpass import screwy
Author: storkk
Created: 2012-01-28 23:23:53+00:00
State: open

Using version 2012.01.08b, with a command line such as:

youtube-dl.py -t http://www.youtube.com/watch?v= -u

results in:

Traceback (most recent call last):
File "/usr/local/bin/youtube-dl.py", line 4625, in
main()
File "/usr/local/bin/youtube-dl.py", line 4616, in main
_real_main()
File "/usr/local/bin/youtube-dl.py", line 4508, in _real_main
opts.password = getpass.getpass(u'Type account password and press return:')
NameError: global name 'getpass' is not defined

I know it's probably not the most pythonic solution, but adding "import getpass" to the very top, rather than at the deferred import location fixes this.