Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'mp4VideoUrl' #22

Open
websponse opened this issue Dec 21, 2023 · 1 comment
Open

KeyError: 'mp4VideoUrl' #22

websponse opened this issue Dec 21, 2023 · 1 comment

Comments

@websponse
Copy link

I am having trouble downloading a particular course but it works perfectly fine with other courses.
The course I had issue downloading is data-analysis-and-visualization-with-power-bi.
Can anyone please shine me some lights on how to fix it?

2023-12-21 15:52:35 Traceback (most recent call last):
2023-12-21 15:52:35 File "/usr/local/bin/cs-dlp", line 8, in
2023-12-21 15:52:35 sys.exit(main())
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/coursera_dl.py", line 283, in main
2023-12-21 15:52:35 error_occurred, completed = download_class(
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/coursera_dl.py", line 253, in download_class
2023-12-21 15:52:35 return download_on_demand_class(session, args, class_name)
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/coursera_dl.py", line 173, in download_on_demand_class
2023-12-21 15:52:35 error_occurred, modules = extractor.get_modules(
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/extractors.py", line 53, in get_modules
2023-12-21 15:52:35 error_occurred, modules = self._parse_on_demand_syllabus(
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/extractors.py", line 155, in _parse_on_demand_syllabus
2023-12-21 15:52:35 links = course.extract_links_from_lecture(
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/api.py", line 880, in extract_links_from_lecture
2023-12-21 15:52:35 links = self._extract_videos_and_subtitles_from_lecture(
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/api.py", line 1044, in _extract_videos_and_subtitles_from_lecture
2023-12-21 15:52:35 videos = VideosV1.from_json(dom)
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/api.py", line 523, in from_json
2023-12-21 15:52:35 videos = [VideoV1(resolution, links['mp4VideoUrl'])
2023-12-21 15:52:35 File "/usr/local/lib/python3.10/dist-packages/cs_dlp/api.py", line 523, in
2023-12-21 15:52:35 videos = [VideoV1(resolution, links['mp4VideoUrl'])
2023-12-21 15:52:35 KeyError: 'mp4VideoUrl'

@poppopret
Copy link

Replace links['mp4VideoUrl'] with links.get('mp4VideoUrl', '') and have another try, I bypassed the same problem in this way. Maybe some resources will got lost, good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants