josefeg / cloudacademy-dl

A utility for downloading Cloud Academy lecture videos.
MIT License
11 stars 6 forks source link

TypeError: 'NoneType' object is not subscriptable #1

Open arajendr opened 7 years ago

arajendr commented 7 years ago

Hi Josef Galea,

Greetings...

I'm trying to use your python script, I may need you help to fix the error i got during the execution.

Downloading course: https://cloudacademy.com/amazon-web-services/aws-sysops-administrator-course/ Traceback (most recent call last): File "C:\Python34\Scripts\cloudacademy-dl-script.py", line 9, in load_entry_point('cloudacademy-dl==0.1.1', 'console_scripts', 'cloudacademy-dl')() File "C:\Python34\lib\site-packages\cloudacademy\cloudacademy_dl.py", line 113, in main download_course(course_url, username, password, video_res, output_dir) File "C:\Python34\lib\site-packages\cloudacademy\cloudacademy_dl.py", line 93, in download_course video_url = get_video_url(video_page_url, auth_cookies, video_res) File "C:\Python34\lib\site-packages\cloudacademy\cloudacademy_dl.py", line 72, in get_video_url return source['src'] TypeError: 'NoneType' object is not subscriptable

Can you help me to fix this ?

Regards, Ashok Rajendran.

danieleplgr commented 6 years ago

The problem I think happens due to the javascript layer that "adds" the html element on top of the page where previously the video-src was on the "plain" html code, so a simple http request with no js rendering engine previously works fine..

The solution for fixing the script I think it's not trivial.. the good news is that you can do it manually.. "view source html code" and search "data-res=" to finding the cloudfront-signed video src to download.