dgorissen / coursera-dl

A script for downloading course material (video's, pdfs, quizzes, etc) from coursera.org
http://dirkgorissen.com/2012/09/07/coursera-dl-a-coursera-download-script/
GNU General Public License v3.0
1.74k stars 299 forks source link

Credentials not found in .netrc yet they're there #148

Closed nick-s-b closed 9 years ago

nick-s-b commented 9 years ago

After updating to the latest coursera-dl (worst mistake I made with this script… 2.x is broken on so many levels), it does not read credentials from .netrc anymore even though they're in there and valid.


Coursera-dl v2.0.2 (html.parser)Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==2.0.2', 'console_scripts', 'coursera-dl')() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/coursera_dl-2.0.2-py2.7.egg/courseradownloader/courseradownloader.py", line 608, in main "No username passed and no .netrc credentials found (check a netrc file exists and has the correct permissions), unable to login") Exception: No username passed and no .netrc credentials found (check a netrc file exists and has the correct permissions), unable to login

Tomilla commented 9 years ago

For this error, please use command ll ~/.netrc ensure the ~/.netrc has the correct permissions (only owner can read and write, but not need execute)

The output should be:

-rw------- 1 username username size time address

If your ~/.netrc don't have r\w permissions, then you an set permissions of ~/.netrc to 600, as following code:

$ chmod 600 ~/.netrc
nick-s-b commented 9 years ago

@Tomilla That doesn't seem to be the issue.

$ ls -la .netrc [23:37:08] -rw------- 1 nick-s-b staff 63 Jul 27 23:06 .netrc

Tomilla commented 9 years ago

Hi, I just try install coursera-dl on my laptop (Ubuntu 14.04), program is running well.

successful

Your .netrc isn't in home directory?

-rw------- 1 user user 75 Aug  2 20:26 /home/user/.netrc
nick-s-b commented 9 years ago

Your .netrc isn't in home directory?

It sure is. But for some reason, 2.0.2 doesn't seem to be able to use it. Passing username/pass on command line seems to do the trick but other issues ("download.mp4" creation, "over 100%" downloads etc.) persist.

I used to use 1.x version of coursera-dl for a very long time without any issues. It was really great. But then Coursera website changed and I had to upgrade to 2.x branch. After the upgrade, nothing seems to be working properly anymore. I have no idea what changed with coursera-dl 2.x branch but it's basically killed it for me. I'm back to "download through the browser" mode because 2.x is completely FUBARed and full of issues.

dgorissen commented 9 years ago

Please use the mechanize branch from github for now. It is the same version as 1.5 but updated with the auth changes. Will update the pip pacakges.

Edit: follow at #126 as well