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

raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden #660

Closed Sapan-Ravidas closed 3 years ago

Sapan-Ravidas commented 3 years ago

raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

Steps to reproduce

edx-dl -u user@user.com https://courses.edx.org/courses/course-v1:UCSanDiegoX+DSE210x+3T2020/course/

Expected behaviour

should startt doenloading

Actual behaviour

edx_dl version 0.1.13 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 Extracting course information from dashboard. Traceback (most recent call last): File "/home/sapan/edx/bin/edx-dl", line 8, in sys.exit(main()) File "/home/sapan/edx/lib/python3.8/site-packages/edx_dl/edx_dl.py", line 1020, in main all_selections = {selected_course: File "/home/sapan/edx/lib/python3.8/site-packages/edx_dl/edx_dl.py", line 1021, in get_available_sections(selected_course.url.replace('info', 'course'), File "/home/sapan/edx/lib/python3.8/site-packages/edx_dl/edx_dl.py", line 184, in get_available_sections page = get_page_contents(url, headers) File "/home/sapan/edx/lib/python3.8/site-packages/edx_dl/utils.py", line 58, in get_page_contents result = urlopen(Request(url, None, headers)) File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.8/urllib/request.py", line 531, in open response = meth(req, response) File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response response = self.parent.error( File "/usr/lib/python3.8/urllib/request.py", line 569, in error return self._call_chain(args) File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(args) File "/usr/lib/python3.8/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

aammfe commented 3 years ago

facing same issue 👍

aammfe commented 3 years ago

solution : https://github.com/coursera-dl/edx-dl/issues/631#issuecomment-667852988 edx_dl.py location: C:\Users\hp4\AppData\Local\Programs\Python\Python38\Lib\site-packages\edx_dl.py