kallqvist/skillshare-downloader

Traceback (most recent call last):

Opened this issue · 1 comments

Traceback (most recent call last):
File "C:\Users\test\Desktop\skillshare-downloader\skillshare-downloader-master\code\example.py", line 10, in
dl.download_course_by_url('https://www.skillshare.com/classes/Learn-Adobe-Photoshop-Like-a-Pro-Advanced-Techniques/1959580090')
File "C:\Users\test\Desktop\skillshare-downloader\skillshare-downloader-master\code\downloader.py", line 36, in download_course_by_url
self.download_course_by_class_id(m.group(1))
File "C:\Users\test\Desktop\skillshare-downloader\skillshare-downloader-master\code\downloader.py", line 83, in download_course_by_class_id
raise Exception('Failed to read video ID from data')
Exception: Failed to read video ID from data

C:\Users\test\Desktop\skillshare-downloader\skillshare-downloader-master\code>pause
Press any key to continue . . .

Someone posted this in another issue post and it worked for me::::::

I found that replacing
if 'video_hashed_id' in s and s['video_hashed_id']:
video_id = s['video_hashed_id'].split(':')[1]

with

if 'video_hashed_id' in s and s['video_hashed_id']:
video_id = s['video_hashed_id'].split(':')[1]
elif 'video_thumbnail_url' in s and s['video_thumbnail_url']:
video_id = s['video_thumbnail_url'].split('/')[6]

in download.py did the trick which is a simple fix, if the video_hashed_id is empty, use the id from the thumbnail :P