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.92k stars 638 forks source link

TypeError: 'NoneType' object is not subscriptable #617

Open gbalaji80 opened 4 years ago

gbalaji80 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

TypeError: 'NoneType' object is not subscriptable

Describe your issue here. When i run the download program i get the following result python edx-dl.py -u xxx -p xxx https://courses.edx.org/courses/course-v1:ColumbiaX+BAMM.101x+1T2020/course/ edx_dl version 0.1.13 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. gbtest https://courses.edx.org Traceback (most recent call last): File "edx-dl.py", line 8, in edx_dl.main() File "D:\columbia_analytics\edx_dl\edx_dl.py", line 1021, in main for selected_course in selected_courses} File "D:\columbia_analytics\edx_dl\edx_dl.py", line 1021, in for selected_course in selected_courses} File "D:\columbia_analytics\edx_dl\edx_dl.py", line 185, in get_available_sections sections = page_extractor.extract_sections_from_html(page, BASE_URL) File "D:\columbia_analytics\edx_dl\parsing.py", line 402, in extract_sections_from_html for i, section_soup in enumerate(sections_soup, 1)] File "D:\columbia_analytics\edx_dl\parsing.py", line 402, in for i, section_soup in enumerate(sections_soup, 1)] File "D:\columbia_analytics\edx_dl\parsing.py", line 372, in _make_url return section_soup.a['href'] TypeError: 'NoneType' object is not subscriptable

Your environment

Steps to reproduce

Tell us how to reproduce this issue. Please provide us the course URL, and the specific subsection or unit if possible. see the description

Expected behaviour

should have downloaded the courses

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.

python edx-dl.py -u xxx -p xxx https://courses.edx.org/courses/course-v1:ColumbiaX+BAMM.101x+1T2020/course/ edx_dl version 0.1.13 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. gbtest https://courses.edx.org Traceback (most recent call last): File "edx-dl.py", line 8, in edx_dl.main() File "D:\columbia_analytics\edx_dl\edx_dl.py", line 1021, in main for selected_course in selected_courses} File "D:\columbia_analytics\edx_dl\edx_dl.py", line 1021, in for selected_course in selected_courses} File "D:\columbia_analytics\edx_dl\edx_dl.py", line 185, in get_available_sections sections = page_extractor.extract_sections_from_html(page, BASE_URL) File "D:\columbia_analytics\edx_dl\parsing.py", line 402, in extract_sections_from_html for i, section_soup in enumerate(sections_soup, 1)] File "D:\columbia_analytics\edx_dl\parsing.py", line 402, in for i, section_soup in enumerate(sections_soup, 1)] File "D:\columbia_analytics\edx_dl\parsing.py", line 372, in _make_url return section_soup.a['href'] TypeError: 'NoneType' object is not subscriptable

fioreug commented 4 years ago

I have the exact same problem with the same course. Could it have something to do with the fact that users will lose access to the course on certain date? (in this case June 9th) I tried downloading two other courses, one that is still open and the other finished years ago but I still have access, and it worked just fine in both cases. Hope someone knows how to fix it.

mor3dr3ad commented 4 years ago

possible duplicate with issue #595