edx-dl icon indicating copy to clipboard operation
edx-dl copied to clipboard

edx-dl not working

Open anonymous008 opened this issue 4 years ago • 5 comments

edx-dl not downloading my courses

Your environment

  • Operating System (Ubuntu 20):
  • Python 3:
  • youtube-dl version: latest
  • edx-dl version: latest

Steps to reproduce edx-dl is not downloading any course. I have tried all the urls. help me fix edx-problems WhatsApp Image 2021-01-26 at 3 03 39 PM WhatsApp Image 2021-01-26 at 3 03 40 PM

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

anonymous008 avatar Jan 26 '21 12:01 anonymous008

Hi, thank you for coursera-dl & edx-dl! :tada: I can verify errors when trying to download a course.

--list-courses is working fine for me as well, and my environment is similar to that of @anonymous008.

See system details and error
$ lsb_release -d
Description:    Ubuntu 20.04.1 LTS

$ python --version
Python 3.8.5

$ pip --version
pip 21.0 from /home/redtux/.local/lib/python3.8/site-packages/pip (python 3.8)

$ youtube-dl --version
2021.01.24.1

$ edx-dl --version
0.1.13

$ edx-dl -u "[email protected]" https://courses.edx.org/courses/course-v1:LinuxFoundationX+LFS101x+1T2020/course/ -o LFS101-Linux
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/redtux/.local/bin/edx-dl", line 8, in <module>
    sys.exit(main())
  File "/home/redtux/.local/lib/python3.8/site-packages/edx_dl/edx_dl.py", line 1020, in main
    all_selections = {selected_course:
  File "/home/redtux/.local/lib/python3.8/site-packages/edx_dl/edx_dl.py", line 1021, in <dictcomp>
    get_available_sections(selected_course.url.replace('info', 'course'),
  File "/home/redtux/.local/lib/python3.8/site-packages/edx_dl/edx_dl.py", line 184, in get_available_sections
    page = get_page_contents(url, headers)
  File "/home/redtux/.local/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

redtux avatar Jan 29 '21 00:01 redtux

same problem

wanzhiyu avatar Feb 03 '21 12:02 wanzhiyu

Same problem.

ahmad-aboelnasr avatar Feb 05 '21 07:02 ahmad-aboelnasr

i tried what is written on this page https://github.com/coursera-dl/edx-dl/issues/649

the comments of the user @RJFeddeler helped. edx-dl is downloading only videos for now. but sometimes giving error "no downloadable video found." when i get this error i run script code over and over again. it worked after a few tries.

Ekran görüntüsü 2021-02-05 160553

taluk48 avatar Feb 05 '21 12:02 taluk48

change line 425 of edx_dl.py to 'User-Agent': 'Chrome/88.0.4324.190' input your chrome version

mobiiin avatar Feb 25 '21 06:02 mobiiin