@eduardo888 after playing around here it is 🙂 its working 🙂
import { getSubtitles } from 'youtube-captions-scraper';
export const code = async (inputs) => {
const videoID = 'YOUR ID';
try {
const captions = await getSubtitles({ videoID: videoID, lang: 'YOUR LANG' });
const fullTranscript = captions.map(caption => caption.text).join('\n');
return fullTranscript;
} catch (error) {
console.error('Failed to fetch subtitles:', error);
return null;
}
};