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
400 Client Error: while using --list-courses #773
Comments
Create a file coursera-dl.conf in the same directory of the coursera-dl with the text below: cauth value will be available only if you login to coursera and then check in cookies. If you don't know how to use coursera-dl, you can check following video: |
I have this problem too. But when added --list-courses only . |
I have fixed it. And I can use it without a problem. Here is my fixing code: |
I have the same problem. @mararkeri - Thank you for those links however, to be clear, login using cauth works when you download a specific course/ciourses, but not when you try to list your current courses using |
Please submit a pull request so the maintainers will see your solution and everyone can benefit. |
@bhrgunatha I can't push my new branch into their repo. remote: Permission to coursera-dl/coursera-dl.git denied to zorone. |
@mararkeri Please Check my code, https://github.com/zorone/coursera-dl I have edit some code in coursera/coursera-dl. |
No, you won't have permission to push code to this repository. Instead you submit a pull request that bundles up the changes that you have made to your repository. Then the devs here can review the changes you've made and decide whether to accept it or not. |
It works, thank you! |
Is the current version supposed to fix
when using |
Is cauth still supposed to solve the problem? I tried following the instructions here using version 0.11.4 but I get:
If I correctly understood cauth option was added from version 0.11.5, so I retried re-installing from scratch in a new environment but still 0.11.4 seem to be the latest version found. Then I also tried downloading 0.11.5 zip file from github but surprisingly I still see:
Do you have any suggestion? |
I found that auth function aren't applied to --list-courses . Please check this https://github.com/zorone/coursera-dl. I have fix that long time ago. But beacause it doesn't pass test cases, so I didn't commit it to the project. Give it a try. |
Just for the record, you need to provide your CAUTH value after |
Same here |
Subject of the issue
Got error while trying to use --list-courses.
Your environment
Steps to reproduce
Tell us how to reproduce this issue, please don't forget to include
enough information so that you can help us help you:
Just use cookies and --list-courses flag:
coursera-dl -ca cookie-from-browser-xxxx --list-courses
replacing cookie-from-browser-xxxx from my original cookie value to protect privacy and security reasons
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?
I was just trying to list them all.
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 -ca cookie-from-browser-xxxx --list-courses
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.
root[main] coursera_dl version 0.11.5
root[main] Listing enrolled courses
root[login] Initiating login.
root[login] There were no .coursera.org cookies to be cleared.
root[prepare_auth_headers] Forging cookie header: csrftoken=fPRydo2dr7zChF1dK3iN; csrf2_token_WDJzh5ph=8hnrtIYn1wYv0DfRrlt9S9FK.
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): api.coursera.org:443
urllib3.connectionpool[_make_request] https://api.coursera.org:443 "POST /api/login/v3 HTTP/1.1" 400 None
Traceback (most recent call last):
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\coursera\cookies.py", line 148, in login
r.raise_for_status()
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 941, 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 "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\coursera-dl-script.py", line 11, in
load_entry_point('coursera-dl==0.11.5', 'console_scripts', 'coursera-dl')()
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\coursera\coursera_dl.py", line 232, in main
list_courses(args)
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\coursera\coursera_dl.py", line 108, in list_courses
login(session, args.username, args.password)
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\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
Expected behaviour
Tell us what should happen.
It should have print the list of courses that i have enrolled
Actual behaviour
Tell us what happens instead. If the script fails, please copy the entire
output of the command or the stacktrace (don't forget to obfuscate your
username and password). If you cannot copy the exception, attach a screenshot.
coursera_dl version 0.11.5
Traceback (most recent call last):
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\coursera\cookies.py", line 148, in login
r.raise_for_status()
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 "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\coursera-dl-script.py", line 11, in
load_entry_point('coursera-dl==0.11.5', 'console_scripts', 'coursera-dl')()
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\coursera\coursera_dl.py", line 232, in main
list_courses(args)
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\coursera\coursera_dl.py", line 108, in list_courses
login(session, args.username, args.password)
File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\coursera_dl-0.11.5-py3.8.egg\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: