Download resources/views/default/js/youtubeTranscript.js from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 409 Bytes
-
https://huggingface.co/pnacorp/magicai/resolve/main/resources/views/default/js/youtubeTranscript.js
- Command line
-
hf download hf://pnacorp/magicai/resources/views/default/js/youtubeTranscript.js
-
curl -L -o youtubeTranscript.js https://huggingface.co/pnacorp/magicai/resolve/main/resources/views/default/js/youtubeTranscript.js
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; | |
| }); | |
| } | |