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

Please provide a username with the -u option, or a .netrc file with the -n option. #845

Open
talhanaimrao opened this issue Jan 14, 2023 · 3 comments

Comments

@talhanaimrao
Copy link

🚨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

When I try to download,, this message appears. Please provide a username with the -u option, or a .netrc file with the -n option.

I am using it for the first time

Your environment

  • Operating System (name/version): Windows 10
  • Python version: 3.11
  • coursera-dl version:

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:

  • Is the problem happening with the latest version of the script?
  • Do you have all the recommended versions of the modules? See them in the
    file requirements.txt.
  • What is the course that you are trying to access?
  • 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).
  • 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

Tell us what should happen.

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.

@talhanaimrao
Copy link
Author

D:\coursera_courses>coursera-dl data-visualization-tableau -u [email protected] -p shsggfga
coursera_dl version 0.11.5
Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\cookies.py", line 148, in login
r.raise_for_status()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 1021, 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 "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Scripts\coursera-dl.exe_main
.py", line 7, in
File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\coursera_dl.py", line 239, in main
login(session, args.username, args.password)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\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

@ykhan21
Copy link

ykhan21 commented Jan 17, 2023

I had the same errors. What worked for me was to use the --cauth COOKIES_CAUTH instead of the username and password.
This works:

coursera-dl -ca COOKIES_CAUTH cs101

This doesn't work:

coursera-dl -username myname cs101

See this answer and thread #816 (comment).

@AbdurRahman-Khan
Copy link

I had the same errors. What worked for me was to use the --cauth COOKIES_CAUTH instead of the username and password. This works:

coursera-dl -ca COOKIES_CAUTH cs101

This doesn't work:

coursera-dl -username myname cs101

See this answer and thread #816 (comment).

Still the same error

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

No branches or pull requests

3 participants