Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the username? #213

Closed
karambir opened this issue Dec 10, 2013 · 20 comments
Closed

What is the username? #213

karambir opened this issue Dec 10, 2013 · 20 comments
Labels

Comments

@karambir
Copy link

Is it the email address I use to login in coursera or the long string which coursera gives to every user(mine is something like 0f084b7d7cce109d4............57 ) or something else?

I have tried both and they did not work. Please help

@jonasdt
Copy link
Member

jonasdt commented Dec 10, 2013

It is the email address. Coursera.org is down at the moment, maybe try again in a few minutes ...

@karambir
Copy link
Author

I have been downloading some videos manually (even tried signing in using firefox), so I don't think there is a problem with site now. It gives following message when using email:

Could not authenticate: Cannot login on accounts.coursera.org.

@rbrito
Copy link
Member

rbrito commented Dec 10, 2013

Can you please show us the output of the command when you run with the --debug option? Feel free to remove only your personal information (like your password). Leave the rest intact, please.

@rbrito
Copy link
Member

rbrito commented Dec 10, 2013

Hi.

On Tue, Dec 10, 2013 at 12:13 AM, Jonas De Taeye
[email protected] wrote:

It is the email address. But I see that coursera.org is down, maybe try again in a few minutes ...

It may have been a transient situation. It is working for me:

http:https://www.downforeveryoneorjustme.com/coursera.org
http:https://status.coursera.org/

Regards,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http:https://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito
DebianQA: http:https://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

@karambir
Copy link
Author

Sure. I'm using the repo version just cloned in a virtualenv.

(dl)karambir@local:~/coursera$ python coursera-dl -u [email protected] -p <password> --debug algo2-002 
root[main] Downloading class: algo2-002
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "GET /algo2-002 HTTP/1.1" 302 0
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): accounts.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "POST /api/v1/login HTTP/1.1" 401 31
root[main] Could not authenticate: Cannot login on accounts.coursera.org.

@jonasdt
Copy link
Member

jonasdt commented Dec 10, 2013

Try with the --clear-cache option, and change line 110 in cookies.py to:

print(r.text)
raise AuthenticationFailed('Cannot login on accounts.coursera.org.')

@karambir
Copy link
Author

Found it, it was not due to username but the password. I changed my password to a very simple string(just alphabets) and it worked. It was due to my complex password. I don't know what is the correct term for it, but maybe your command is not sending my actual password but leaving something. Note that my actual password contained alphabets, numbers and % & * all these symbols. Maybe it is escaping something.

@jonasdt
Copy link
Member

jonasdt commented Dec 10, 2013

Ok, good catch. I'll try to fix it.

@asiviero
Copy link
Contributor

Is there a way of wrapping the arguments, like it's done on bash scripts with double quotes?

@jonasdt
Copy link
Member

jonasdt commented Dec 10, 2013

Indeed, I temporarily changed my password to #£§("éù&*^¨l°_<!+@\%, and it works fine if you wrap the password in single quotes

coursera-dl course -u user -p '#£§("éù&*^¨l°_<!+@%'

Double quotes works also, but you have to escape some characters (backtick, !, ...).

@akarambir can you try again with your old password using single quotes?

@rbrito
Copy link
Member

rbrito commented Dec 10, 2013

On Dec 10 2013, Jonas De Taeye wrote:

Indeed, I temporarily changed my password to #£§("éù&*^¨l°_<!+@\%,
and it works fine if you wrap the password in single quotes

coursera-dl course -u user -p '#£§("éù&*^¨l°_<!+@%'

Yes.

Double quotes works also, but you have to escape some characters
(backtick, !, ...).

@akarambir

Especially exclamation points, as they may try to invoke history. Backticks,
OTOH, tell the shell to perform interpolation by (trying to) call a program.

What do you get if you simply use something like this (substituting your password,
that is):

echo coursera-dl course -u user -p '#`£`§("éù&*^¨l°_<!+@\%'

Do you get back what you typed?

@akarambir can you try again with your old password using single quotes?

What about putting your password in a netrc file?

Regards,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http:https://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito
DebianQA: http:https://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

@karambir
Copy link
Author

@jonasdt Yes, it is working with single quotes.
@rbrito netrc file way is also working fine. With double quotes I had to escape some symbols as @jonasdt said.
I think it should be recommended to always use single quotes around password and mentioned in readme/docs.

Btw Thanks all for the great tool

@rbrito rbrito closed this as completed in 28d7586 Dec 13, 2013
rbrito pushed a commit that referenced this issue Dec 13, 2013
This is inspired by the discussion in issue #213.
@chenlinwang
Copy link

Hi, guys, I have been experiencing the same problem with authentication errors like:

Could not authenticate: Cannot login on accounts.coursera.org.

I have tried to use --clear-cache and change password to pure string or numbers and also wrap my email and password with single quotation marks, but it is still not working. The --debug option results show as followed:

chenlin@coursera$ ./coursera-dl --debug -u '[email protected]' -p 'password' datascitoolbox-005
root[main] Downloading class: datascitoolbox-005
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "GET /datascitoolbox-005 HTTP/1.1" 302 0
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): accounts.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "POST /api/v1/login HTTP/1.1" 400 18
root[main] Could not authenticate: Cannot login on accounts.coursera.org.

Any thought? Thx a lot!

@nalbyuites
Copy link

I get the same error as chenlinwang; tried what he tried as well -

~> ./coursera/coursera-dl --clear-cache --debug --aria2 -n --path=study/datascitoolbox-005/ datascitoolbox-005
root[authenticate_through_netrc] Trying netrc file None
root[main] Downloading class: datascitoolbox-005
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
urllib3.connectionpool[_make_request] Setting read timeout to None
urllib3.connectionpool[_make_request] "GET /datascitoolbox-005 HTTP/1.1" 302 0
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): accounts.coursera.org
urllib3.connectionpool[_make_request] Setting read timeout to None
urllib3.connectionpool[_make_request] "POST /api/v1/login HTTP/1.1" 400 18
root[main] Could not authenticate: Cannot login on accounts.coursera.org.

@kshitijdholakia
Copy link

hey, I'm getting the " Could not authenticate: Cannot login on accounts.coursera.org." issue when I changed my password yesterday. I changed it back to the original one and the issue persists.

Here's the trace using the debug option:

python coursera-dl -u (username) -p (password) hwswinterface-002 --debug
root[main] Downloading class: hwswinterface-002
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
urllib3.connectionpool[_make_request] Setting read timeout to None
urllib3.connectionpool[_make_request] "GET /hwswinterface-002 HTTP/1.1" 302 0
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): accounts.coursera.org
urllib3.connectionpool[_make_request] Setting read timeout to None
urllib3.connectionpool[_make_request] "POST /api/v1/login HTTP/1.1" 400 18
root[main] Could not authenticate: Cannot login on accounts.coursera.org.

@2power10
Copy link

Hey, I'm also getting the authentication error:

Could not authenticate: Cannot login on accounts.coursera.org

My password only contain alphabets, after turn on the --debug, --clear-cache and change to print the text in cookies.py, the output looks like that:

python coursera_dl.py -u [email protected] -p xxx "algs4partI-005" --debug --clear-cache
root[main] Downloading class: algs4partI-005
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "GET /algs4partI-005 HTTP/1.1" 302 0
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): accounts.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "POST /api/v1/login HTTP/1.1" 400 18
Malformed request.
root[main] Could not authenticate: Cannot login on accounts.coursera.org.

@rbrito
Copy link
Member

rbrito commented Jul 10, 2014

Hi. This problem is already fixed with the latest version of coursera-dl.

Also, a kind request: please, don't "revive" old, closed bugs. If needed, please file new bugs.

Regards,

Rogério Brito.

@zhouna
Copy link

zhouna commented Jul 10, 2014

Hi, I also encountered the problem. And finally solved by warping the username and password with double quotation marks(not single). Hope can help you. @chenlinwang

@tasnim2487
Copy link

when I run the command
~/coursera-dl$ ./coursera-dl -u -p class
terminal says,
bash: email:no such file/directory .
what can I do?

@Khun111
Copy link

Khun111 commented Dec 24, 2022

Not working. Tried the options in this thread. Still doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests