Chillee / coursera-dl-all

MIT License
190 stars 54 forks source link

Symbols in password causes authentication errors #15

Closed charlesbickel closed 8 years ago

charlesbickel commented 8 years ago

Environment: Windows 7 64-bit Python 3.5

Python dependencies look up to date.

python -m pip install --upgrade coursera-dl
Requirement already up-to-date: coursera-dl in c:\python35\lib\site-packages
Requirement already up-to-date: beautifulsoup4>=4.1.3 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: html5lib>=1.0b2 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: requests>=2.4.3 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: six>=1.5.0 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: urllib3>=1.10 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: pyasn1>=0.1.7 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: keyring>=4.0 in c:\python35\lib\site-packages (from coursera-dl)
Requirement already up-to-date: pywin32-ctypes; sys_platform == "win32" in c:\python35\lib\site-packages (from keyring>=4.0->coursera-dl)

Authentication occurs with some symbols such as !@#$%*

python dl_all.py -u username -p Easypassword1@#$%* -v -a -q --headless
https://class.coursera.org/androidpart1-014/ androidpart1-014
coursera_dl version 0.6.1
Downloading class: androidpart1-014
Starting new HTTPS connection (1): class.coursera.org
Starting new HTTPS connection (1): class.coursera.org
Starting new HTTPS connection (1): www.coursera.org
Logged in on coursera.org.
Found authentication cookies.

Authentication fails with ^ in the password.

python dl_all.py -u username -p Easypassword1^ -v -a -q --headless
https://class.coursera.org/androidpart1-014/ androidpart1-014
coursera_dl version 0.6.1
Downloading class: androidpart1-014
Starting new HTTPS connection (1): class.coursera.org
Starting new HTTPS connection (1): class.coursera.org
Starting new HTTPS connection (1): www.coursera.org
Could not authenticate: Cannot login on coursera.org.

Authentication with & in the password seems to ignore --headless option and tries to start Firefox which automatically updated itself to v47.

python dl_all.py -u username -p Easypassword1& -v -a -q --headless
https://class.coursera.org/androidpart1-014/ androidpart1-014
Traceback (most recent call last):
  File "dl_all.py", line 317, in <module>
    session = webdriver.Firefox()
  File "C:\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 81, in __init__
    self.binary, timeout)
  File "C:\Python35\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 51, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "C:\Python35\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "C:\Python35\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 98, in _wait_until_connectable
    raise WebDriverException("The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

'-v' is not recognized as an internal or external command,
operable program or batch file.
lightbrush commented 8 years ago

I think the best way to solve this problem is to change your password temporarily. U know today is June 27th... We don't have much time to waste on such easy-to-handle problem. Yet it is a bug as we know.

Chillee commented 8 years ago

The way to get around this is by using quotes in your command line arguments. For example, if you do

python dl_all.py -u username -p "Easypassword1@%$&"

it should work.