-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
HTTPError: 400 Client Error: Bad Request for url: https://api.coursera.org/api/login/v3 #702
Comments
I'm having the same issue, under Debian Stretch. I tried it with Python and Python 3, also using virtualenv. This is my debug output: root[main] coursera_dl version 0.11.4 During handling of the above exception, another exception occurred: Traceback (most recent call last): It worked some months ago. I had the version 0.9.0, so I checked if it works by upgrading to the new version 0.11.4. |
Yep, tried virtualenv with Python 3 - doesn't work either. |
Something tells me that Coursera has terminated the access to its resources via the API. |
Now it's working! I'm using the same command I used last days:
I also had problems trying to loggin in the website, using the new formulary, from several browsers, several OS... Even I reset my password several times, until I could join using the loggin button from this URL (https://learner.coursera.help/hc/en-us), being that enough to start the session for the whole site. @aakuptsov, try now if it works for you, as well. |
I encounter the same problem too, on Window10 using python 3.6. I checked everything in the requirements.txt |
@gerardbm |
@gerardbm 's advice helped me: log in at https://learner.coursera.help/hc/en-us, wait for a minute (that was my case, at least) and after that try to run coursera-dl. I'm writing that comment now while one of the courses I need is downloading. |
@aakuptsov |
This method isn't working. Kindly suggest new one.
Tried changing the password; yet its failing |
Well, to be honest it was not a method to fix it. It only was a description of a Coursera behaviour related with this. I explained that to suggest that the problem is not about coursera-dl, but coursera.org. It worked yesterday because 'correlation does not imply causation'. It was only a coincidence... At this moment, downloads are not working, again. Coursera-dl has not changed, and I'm using the same installation, so clearly the problem comes from coursera.org. There's no solutions for that. Just wait and keep trying until it works. |
@aakuptsov thanks for helping |
@aakuptsov, @gerardbm thanks for helping it worked! Just have to log in with the link you provided. However, for me it takes about 10 minutes for it to work. Thanks anyway. |
For anyone looking for help I want to point out that after logging in with (https://learner.coursera.help/hc/en-us), you must wait for a few minute than just keep trying. By keep trying I mean spamming your command over and over again and it will somehow work (at least it works for me, I need to retry the command about 10 times before it will work). |
One more important thing I notice - you cannot open your browser to coursera while downloading. I closed all my coursera tabs and run the script then it works. |
I had this page https://learner.coursera.help/hc/en-us) open, I guess. Not sure about other Coursera pages. |
That's what I did now and it worked after 8 attempts. It looks like the problem is on the server. |
At the end of the day I managed to download 2 courses that I needed. I'm gonna check later on if others that I might need can be downloaded through coursera-dl. But since yes, we all managed to download something, the problem is on the server. I wonder what that is and why the Coursera team either not deny access completely or fix that. |
I'm having the same issue |
amazing! it indeed works! thanks @gerardbm |
I tried 18 login attempts before the download started... I imagine all these retries from automated tools must be taking a toll on coursera's current login issue. |
I think its Coursera Server Issue, i tried around 10 times then is worked!! |
I am also experiencing this issue but despite many retries, its not working. I have looked at the Coursera support page that others (above) have mentioned. https://learner.coursera.help/hc/en-us I would suggest that the message across the top of the page is rather important and provides some clue that the devs need to follow up on:
Hypothesis: Coursera has code that tries to detect automated agents and challenges them with a captcha. Humans don't typically see it but the support message is indicating that some people do and just need to use the captcha to prove they're human. Some people using Coursera-DL are able to get past the captcha trap with repeated attempts as the "automated agent detection" code by coursera is not fool proof. @devs please help us. This isn't working. Can someone look into this? [Update]
So how should the coursera-dl code handle this? |
If you don't mind a bit of hacking... Login to Coursera once through the browser. Find your installed Modify
Please google how to inspect cookie values for your browser. You may get some clues here. Run Do note that cookies expire, though it's quite long in this particular cookie's case. In case it does, do login through the browser again to get a new cookie. |
Tried to change the cookie parameter as above. Has the AUTH_URL_V3 changed to That is teh URl I see when inspecting in chrome. Also the cookies does not seem to contain
|
Hey all, just found coursera-dl and was surprised to see it failing. Ended up here; tried @Isaac-the-Man , @dhruvil009 , @constantlycoding , and @jethar 's solutions. None seem to work, but I'll continue poking around. Probably the same as all of you, I have all of the requirements, the correct interpreter, etc. Working on it, but would like to stay posted on this. On Debian 9, newest version. Edit: After clearing my cookies and re-signing in, I do see the CAUTH token. Long string of alphanumeric characters, not much use for me to put it- but at least it reappears for me. Edit 2: Interesting. Pulled a Windows user trick and repeatedly banged in the command. Got this on the ~7th try: Anyone have any ideas? It logged in, so it might be server weight. |
It works with CAUTH parameter which you can get from cookies by logging into Coursera via browser. There is no need of passing username and password to the command via this method.
How to get CAUTH cookie value in Chrome: Inspect > Application > Cookies |
Getting the CAUTH parameter from my cookies worked for me. The user+password combination doesn't work for me and it gives the HTTPError 400 Client error. Thanks! |
I tried with CAUTH and it didnt worked, someone else has this problem? |
i got that problem too, and it was fixed... |
Thanks for the reply! I tried that because I also was using conda but it didnt worked, it wont let me log into coursera, don't know why |
I was having similar issue which was posted in #702. But this solved it :). Thank you |
great! this works! just login into [https://learner.coursera.help/hc/en-us] and wait for a couple of minutes(I had to wait 10mins) and then later try the command..happy learning! |
best answer. it worked for me. |
it works |
You don't need to set username and password in the config file if you have the cauth parameter |
Okay, so at the beginning it didn´t work for me. I was taking the CAUTH value directly from Chrome settings. However I tried this other approach to get the CAUTH value.
Hope it helps somebody! 😄 |
awesome worked for me |
The cauth method works. The auth value can be copied from the chrome developer options itself.
|
I used the --cauth method the download seems to start but soon I see the below error, any help is appreciated Unsupported typename "discussionPrompt" in lecture "meet-greet" (lecture id "pPew6") |
@SG75 |
I used the AUTH method too:
BTW, I think our nice python program should handle the Then it will make less confused and more satisfied users... :> Anyway, thank you for this great tool! |
If you are using chrome just press this link chrome://settings/cookies/detail?site=coursera.org, open the CAUTH field, copy it then paste it after
|
On Windows 10, just upgraded coursera-dl, didn't work previous version same error and: G:\Coursera>coursera-dl -u xyz@gmail.com -ca mgmc6yheYS9ZFlQbLKyTMWvk8vWDsDFRbHFLaB99LEyVuy8WnUco0CJA4MnC3mJixeZ5ZlRE1utwX_hp7NVXg.kKLS5wYyFf-48BljvqWLJQ.4fIyXL41zYfOvJkjncG7m04zUmrwrFMGI5dACx8zTDrb76gIWiVz_KqvpA3TdQGnUMBuh7mZN2ETlgrL8zIC21CWauKA5JHrl9cLfD93i5Ob5xaNS3lPSOLXrgBpKw_b8aIhK-44B5oqNkAhQ6mxsTTaN_qTdNQrkGNQC4TuwTD5O7DcIdz2C2WseHGtdmgsN6rGAnwGbjaJ564EVQfl-P6KQoeMIXpXH2jju2JHfp0hlH85yqNCvQIoId_OS9mM-KwcrgHUl4A1Gl2oAuxTF1wh4g2qY13xaXZUo31M0MCusUX-SAfcFYdwGgFB-AIkxOicgYRxj-Qitkrp1ZIhc4-08NyyWSIngmHGS1EWE0o6bW2Mepjc7iirmziLPemtNyR9qhU7mYGPB2xajRMujiCV7jBuFgxZ8HKAV0j89Zo --list-courses |
Hello, Same issue on Debian Buster (python 3.7) with a fresh install of coursera-dl. I tried the two methods for downloading which raised two distinct exceptions:
After the command with -ca option, I am logged out from Coursera. NOTE: I also tried to put the certificate in my coursera-dl.conf file instead of the -ca option but it still did not work (403 Client Error + logout from Coursera). Regards, |
Thanks Its works for me. |
Thanks this works perfectly for me |
I'm commenting this two years later. Adding the argument |
@gerardbm how does it work for you i just tried it and it didn't work ? Error 403 Client Error: |
27th July 2022, This works perfectly fine with me, thank you for the great tools! |
This solution used to work for me on other systems, but of late, my CAUTH cookie value got much larger (~500 characters) and that seems to break argument parsing in the script. I'm using FF on Ubuntu 22.04. Wondering if anyone else is experiencing the same. I've tried to pass both at the command line and also through the When passing through the command line I get:
|
I've had no issues with a 558 character CAUTH field on coursera-dl 0.11.5. |
I can get to chrome://settings/cookies, but the full path or chrome://settings/cookies/detail dont work for me and I dont see anything site specific at chrome://settings/cookies. |
🚨Please review the Troubleshooting section
before reporting any issue. Don't forget to check also the current issues to
avoid duplicates.
Subject of the issue
Describe your issue here.
Your environment
Steps to reproduce
I created a coursera_dl folder on my Desktop
I created coursera-dl.conf file in that folder as required
My email contains only letters and a dot, it's a gmail.com account
My password has only letters and numbers
Is the problem happening with the latest version of the script?
YES
Do you have all the recommended versions of the modules? See them in the
file
requirements.txt
.YES
What is the course that you are trying to access?
understanding-visualization-data
https://www.coursera.org/learn/understanding-visualization-data/home/welcome
What is the precise command line that you are using (don't forget to obfuscate
your username and password, but leave all other information untouched).
coursera-dl understanding-visualization-data
What are the precise messages that you get? Please, use the
--debug
option before posting the messages as a bug report. Please, copy and paste
them. Don't reword/paraphrase the messages.
Expected behaviour
The download should begin
Actual behaviour
coursera_dl version 0.11.4
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/coursera/cookies.py", line 148, in login
r.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.coursera.org/api/login/v3
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/coursera-dl", line 10, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/coursera/coursera_dl.py", line 236, in main
login(session, args.username, args.password)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/coursera/cookies.py", line 155, in login
raise AuthenticationFailed('Cannot login on coursera.org: %s' % e)
coursera.cookies.AuthenticationFailed: Cannot login on coursera.org: 400 Client Error: Bad Request for url: https://api.coursera.org/api/login/v3
The text was updated successfully, but these errors were encountered: