RahulShaw / LinuxAcademy-DL

Download videos from your LinuxAcademy account for offline viewing
MIT License
65 stars 44 forks source link

AttributeError: 'NoneType' object has no attribute 'text' #24

Closed ac289 closed 4 years ago

ac289 commented 4 years ago

Hi, I have tried a couple of courses but i am getting the same issue as closed issue #18 but with all courses i have tried.

Could you please help?

C:\Users\Admin\LinuxAcademy-DL>python driver.py https://linuxacademy.com/cp/modules/view/id/340 Requesting download of https://linuxacademy.com/cp/modules/view/id/340

DevTools listening on ws://127.0.0.1:49718/devtools/browser/944e3e41-9e10-4301-8a64-613151008b7b Sleeping for 15 seconds.. Attempting to login.. Login successful... Getting lesson links... Traceback (most recent call last): File "driver.py", line 85, in title = parsed_html.find('span', attrs={'class', 'course-title'}).text AttributeError: 'NoneType' object has no attribute 'text'

C:\Users\Admin\LinuxAcademy-DL>python driver.py https://linuxacademy.com/cp/modules/view/id/329 Requesting download of https://linuxacademy.com/cp/modules/view/id/329

DevTools listening on ws://127.0.0.1:50012/devtools/browser/85114cb4-bcb9-4657-9824-fbb1749e6c7f Sleeping for 15 seconds.. Attempting to login.. Login successful... Getting lesson links... Traceback (most recent call last): File "driver.py", line 85, in title = parsed_html.find('span', attrs={'class', 'course-title'}).text AttributeError: 'NoneType' object has no attribute 'text'

bi7je commented 4 years ago

The problem is that on line 85 of the script, the course title is expected to be in a span element but they seem to have changed it. Im not really familiar with beautiful soup and the author isnt paying attention to the issues it seems so it hasnt been fixed yet.

The workaround solution here is to set the title manually. The only thing the title variable is used for is the creation of the folder the course will be downloaded in to.

Solution: Open the script and edit line 85 to assign the course title yourself. Example: title = "course title"

Do mind your operating system's restriction for directory names.

Hope this helps

RahulShaw commented 4 years ago

This has now been fixed! Apologies for the delay.