devhims / youtube-caption-extractor

A lightweight package to scrape and parse captions (subtitles) from YouTube videos, supporting both user-submitted and auto-generated captions with language options.
https://youtube-caption-extractor.vercel.app
53 stars 8 forks source link

Incorrect Video ID #5

Closed anshgupta2000 closed 3 months ago

anshgupta2000 commented 3 months ago

I am getting this error each time I use this API: 'Received request for captions with Video ID: undefined and language: en No captions found for video: undefined'

If the YouTube video link is: https://www.youtube.com/watch?v=cFLjudWTuGQ, then I am using video ID = 'cFLjudWTuGQ'.

What am I doing wrong?

Edit: I understood the mistake. Just changes this: 'const { videoID, lang = 'en' } = req.query;' to this: 'const videoID = req.query.videoId;
const lang = req.query.lang || 'en';' And this fixed the issue.