This is my code:
const {YoutubeTranscript} = require('youtube-transcript')
const ret = await YoutubeTranscript.fetchTranscript(argument_1)
Error : throws the exception:
ReferenceError: fetch is not defined
middleware:youtube at Function. (C:_svn_praxis\code\ui\node_modules\youtube-transcript\dist\youtube-
transcript.common.js:70:39)
Version Used:
"youtube-transcript": "^1.2.1"
"node": 16.20.0
Perhaps we need to add
const fetch = require('node-fetch')
When I add the import in node_modules/youtube-transcript/dist/youtube-transcripts.common.js
This is my code: const {YoutubeTranscript} = require('youtube-transcript') const ret = await YoutubeTranscript.fetchTranscript(argument_1)
Error : throws the exception: ReferenceError: fetch is not defined middleware:youtube at Function. (C:_svn_praxis\code\ui\node_modules\youtube-transcript\dist\youtube-
transcript.common.js:70:39)
Version Used: "youtube-transcript": "^1.2.1" "node": 16.20.0
Perhaps we need to add const fetch = require('node-fetch')
When I add the import in node_modules/youtube-transcript/dist/youtube-transcripts.common.js![image](https://github.com/user-attachments/assets/b7ff889b-4c20-46f9-926d-01fa8a693674)
everything works![image](https://github.com/user-attachments/assets/5f24c9b1-ddc6-4327-9728-1565d445ea47)