coursera-dl / edx-dl

A simple tool to download video lectures from edx.org (and other openedx sites)
GNU Lesser General Public License v3.0
1.93k stars 640 forks source link

Course Download Failure #625

Closed seq112215 closed 4 years ago

seq112215 commented 4 years 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 cannot download the course

Your environment

Steps to reproduce

edx-dl -u user@mail.net -p password https://courses.edx.org/courses/course-v1:MITx+3.054.3x+1T2020/course/

Expected behaviour

Download the course

Actual behaviour

edx_dl version 0.1.13 Building initial headers for future requests. Getting initial CSRF token. Traceback (most recent call last): File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "c:\Program Files\Python38\Scripts\edx-dl.exe__main__.py", line 7, in File "c:\program files\python38\lib\site-packages\edx_dl\edx_dl.py", line 1005, in main headers = edx_get_headers() File "c:\program files\python38\lib\site-packages\edx_dl\edx_dl.py", line 430, in edx_get_headers 'X-CSRFToken': _get_initial_token(EDX_HOMEPAGE), File "c:\program files\python38\lib\site-packages\edx_dl\edx_dl.py", line 167, in _get_initial_token opener.open(url) File "c:\program files\python38\lib\urllib\request.py", line 531, in open response = meth(req, response) File "c:\program files\python38\lib\urllib\request.py", line 640, in http_response response = self.parent.error( File "c:\program files\python38\lib\urllib\request.py", line 569, in error return self._call_chain(args) File "c:\program files\python38\lib\urllib\request.py", line 502, in _call_chain result = func(args) File "c:\program files\python38\lib\urllib\request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

seq112215 commented 4 years ago

It happens with every other course on edx.

wpav commented 4 years ago

I am getting the same error when I have used this package for a while...

zareami10 commented 4 years ago

Getting the same error, can't even list my courses let alone download.

mokandil commented 4 years ago

Same problem here.

THolding commented 4 years ago

I'm also getting this.

MATRIX30 commented 4 years ago

Having thesame problem too

ulissesBR commented 4 years ago

Same error here. Something is telling me that edx API's have changed, and the project has not been updated.

THolding commented 4 years ago

I'm not an author of the tool, but you can fix it by changing line 425 of edx_dl.py which specifies the User-Agent attribute of the http request header. Change 'User-Agent': 'edX-downloader/0.01', to 'User-Agent': 'Mozilla/5.0', and it will work.

MATRIX30 commented 4 years ago

I'm not an author of the tool, but you can fix it by changing line 425 of edx_dl.py which specifies the User-Agent attribute of the http request header. Change 'User-Agent': 'edX-downloader/0.01', to 'User-Agent': 'Mozilla/5.0', and it will work.

Thanks fix works like magic

ichit commented 4 years ago

@THolding Thanks a lot. It works like magic indeed.

wpav commented 4 years ago

Worked for me too! Thank you!!

ulissesBR commented 4 years ago

Thank you! At first it didn't work for me because I was trying to run it using Python version 2.7. But when I did it using Python 3.8 it worked like a charm!

phaneshavr commented 4 years ago

I'm not an author of the tool, but you can fix it by changing line 425 of edx_dl.py which specifies the User-Agent attribute of the http request header. Change 'User-Agent': 'edX-downloader/0.01', to 'User-Agent': 'Mozilla/5.0', and it will work.

Unfortunately, it did not work me.