skillshare-downloader icon indicating copy to clipboard operation
skillshare-downloader copied to clipboard

Failed to read video ID from data

Open VikasRana opened this issue 4 years ago • 13 comments

Downloading C:\Users...\data\theawwwesomes\boost-personal-branding-by-coding-your-own-website-html-css-basics/01 - intro.mp4... [==================================================]

Traceback (most recent call last): File "C:\Users...\Downloads\skillshare-downloader-master\skillshare-downloader-master\code\example.py", line 10, in dl.download_course_by_url('https://www.skillshare.com/classes/Boost-Personal-Branding-by-Coding-Your-Own-Website-HTML-CSS-Basics/1551945410') File "C:\Users...\Downloads\skillshare-downloader-master\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...\Downloads\skillshare-downloader-master\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

VikasRana avatar Feb 06 '21 09:02 VikasRana

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

Sam-Online avatar Feb 25 '21 11:02 Sam-Online

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

thank you. this worked perfectly.

Please make a pull request so that the dev (hopefully) merge it.

leuldereje avatar Apr 10 '21 10:04 leuldereje

I found that the code change above definitely helped, but about halfway through downloading videos it errors with the following message:

Traceback (most recent call last): File "example.py", line 10, in dl.download_course_by_url('https://www.skillshare.com/classes/Brand-Strategy-Build-a-Business-that-Lasts/2083092514') File "/Users/ravisundram/Sites/skillshare-downloader-python/code/downloader.py", line 36, in download_course_by_url self.download_course_by_class_id(m.group(1)) File "/Users/ravisundram/Sites/skillshare-downloader-python/code/downloader.py", line 100, in download_course_by_class_id self.download_video( File "/Users/ravisundram/Sites/skillshare-downloader-python/code/downloader.py", line 143, in download_video raise Exception('Failed to fetch video meta') Exception: Failed to fetch video meta

Any ideas?

ravinot avatar Apr 20 '21 23:04 ravinot

@ravinot try updating your cookies, that also worked for me

leuldereje avatar Apr 21 '21 13:04 leuldereje

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

I tried this but I'm getting an "IndentationError: expected an indented block". I'm a python noob lol so I'm not sure what's wrong.

Edit: Tried re-pasting it.

raise Exception('Failed to fetch video meta') Exception: Failed to fetch video meta

Now I'm getting that error.

Edit2: I was able to make it work by renewing the cookie but it seems I have to this often since the cookie doesn't last like it used to.

secretmove avatar Apr 23 '21 02:04 secretmove

@ravinot try updating your cookies, that also worked for me

That worked for me! Thanks

mage1k99 avatar Apr 25 '21 04:04 mage1k99

Answer by @Sam-Online Formatted 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 😜

I have formatted the answer by @Sam-Online

mage1k99 avatar Apr 25 '21 05:04 mage1k99

@ravinot try updating your cookies, that also worked for me

Thanks @leuldereje, clearing my cache and re-generating the cookie worked. However, as @secretmove mentioned in his comment, it looks like I have to generate a new cookie after each completed download for the next download to work.

ravinot avatar May 10 '21 23:05 ravinot

I fetched another cookie and the problem was solved for me

ogeeDeveloper avatar May 12 '21 16:05 ogeeDeveloper

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

I'm new to this, how do I replace the code?

THEASH22 avatar Feb 16 '22 08:02 THEASH22

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

Hey bro can u help me pls.i get same error.failed to read video id from data.idk coding even a little bit.fix it for me or make detailed tutorial pls.Would appreciate that.

mayabeggin avatar Mar 11 '22 03:03 mayabeggin

did u found something helpfull ?

mayabeggin avatar Mar 11 '22 04:03 mayabeggin

Traceback (most recent call last): File "/root/.Skillshare-DL/dl.py", line 16, in main() File "/root/.Skillshare-DL/dl.py", line 11, in main dl.download_course_by_url(course_url) File "/root/.Skillshare-DL/skillshare.py", line 32, in download_course_by_url self.download_course_by_class_id(m.group(1)) File "/root/.Skillshare-DL/skillshare.py", line 72, in download_course_by_class_id raise Exception('Failed to read video ID from data') Exception: Failed to read video ID from data anyone can help i want to download https://www.skillshare.com/classes/Contours-Drawing-with-Compelling-Contours-Foreshortening/1618762074 previously it was working but now its showing above error tried with other drive also but nothing happens

nil55 avatar Jul 31 '22 02:07 nil55