A lightweight package to scrape and parse captions (subtitles) from YouTube videos, supporting both user-submitted and auto-generated captions with language options.
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'
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.
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.