csyezheng / edx-helper

A command line tool for downloading courses from edx.org.
GNU Lesser General Public License v3.0
33 stars 12 forks source link

Script starts failing with 400 Bad Request after the first course gets downloaded #2

Closed aalhour closed 10 months ago

aalhour commented 10 months ago

๐ŸšจPlease review the Troubleshooting section before reporting any issue. Don't forget also to check the current issues to avoid duplicates.

Subject of the issue

I downloaded one course successfully, then tried to download another one and I got HTTP 400 error.

Your environment

Steps to reproduce

  1. Create a Python venv: python3 -m venv venv
  2. Activate the venv: source venv/bin/activate
  3. Install edx-helper and youtube-dl: pip install edx-helper youtube-dl
  4. List courses: edx-helper -u <email> --list-courses <--- ๐Ÿ‘ succeeds
  5. Download a course: edx-helper -u <email> https://learning.edx.org/course/course-v1:HarvardX+FC1x+1T2023/home <--- ๐Ÿ‘ succeeds
  6. Download another course: edx-helper -u <email> https://learning.edx.org/course/course-v1:StanfordOnline+SOE-YCVX0001+1T2020/home <--- โŒ fails โŒ
  7. Error:
    edx_helper version 0.6.3
    Password:
    Building initial headers for future requests.
    Getting initial CSRF token.
    Found CSRF token.
    Logging into Open edX site: https://courses.edx.org/login_ajax
    Error, cannot login: HTTP Error 400: Bad Request
    Wrong Email or Password.
  8. Yes, I tried other courses and other URLs in my browser and re-checked my password and it failed several times with the same error

Expected behaviour

The 2nd time I try to download a course it should succeed.

Actual behaviour

Entire output:

edx_helper version 0.6.3
Password:
Building initial headers for future requests.
Getting initial CSRF token.
Found CSRF token.
Logging into Open edX site: https://courses.edx.org/login_ajax
Error, cannot login: HTTP Error 400: Bad Request
Wrong Email or Password.
csyezheng commented 10 months ago

@aalhour

This seems to be due to too many failed login attempts and your edx account is locked, just try again later. This may take 30 minutes or an hour.

At this time, you can try to login at edx.org, but you probably won't be able to login either. This problem has nothing to do with this edx-helper.

If you can login at edx.org but cannot login using this download tool, please tell me.

Why is my account locked?

aalhour commented 10 months ago

The issue is fixed. Thanks and sorry for the hassle.