magicai / resources /views /default /js /youtubeTranscript.js
Softin Trading
Initial commit from Github
5f32fbd
Raw History Blame Contribute Delete
409 Bytes
import { YoutubeTranscript } from 'youtube-transcript';
export function fetchAndLogTranscript(videoIdOrURL) {
return YoutubeTranscript.fetchTranscript(videoIdOrURL)
.then(transcript => {
console.log(transcript);
return transcript;
})
.catch(error => {
console.error('Error fetching transcript:', error);
throw error;
});
}