algolia / youtube-captions-scraper

Fetch youtube user submitted or fallback to auto-generated captions
249 stars 67 forks source link

Some IDS return error #11

Open pcktlwyrcode opened 3 years ago

pcktlwyrcode commented 3 years ago

throw new Error(Could not find captions for video: ${videoID}); Error: Could not find captions for video: pR5q0ajW8Ko&has_verified=1

This particular one has visible captions. I am wondering under what other circumstances this error may be thrown.

seanwessmith commented 3 years ago

I think this issue is due to copyrighted content in the video. Digging into the youtube-captions-scraper code you can see it gets data by using "https://youtube.com/get_video_info"

The videos with errors return "status=fail&errorcode=2&reason=Invalid+parameters."

Youtube's comment on this API states: https://developers.google.com/youtube/v3/docs/videos

All videos uploaded via the videos.insert endpoint from unverified API projects created after 28 July 2020 will be restricted to private viewing mode. To lift this restriction, each API project must undergo an audit to verify compliance with the Terms of Service. Please see the API Revision History for more details.

working: https://youtube.com/get_video_info?video_id=QJ3YfBMrVlsz not working: https://youtube.com/get_video_info?video_id=1AMYr01rkHE

andrii1 commented 2 years ago

Hello, I'm using this package in pipedream, is there to avoid error, when there are no captions in YouTube video?

ErrorCould not find captions for video: ejSm7B2gyk8 at null.null (/opt/ee/node_modules/youtube-captions-scraper/dist/index.js:21:48) at Generator.next (null:null:null) at null.step (/opt/ee/node_modules/youtube-captions-scraper/dist/index.js:103:191) at null.null (/opt/ee/node_modules/youtube-captions-scraper/dist/index.js:103:361) at process.processTicksAndRejections (internal/process/task_queues.js:95:5)