Youtube tool youtube-transcript lib never works #6653
Replies: 2 comments 1 reply
-
relevant issue for the lib: Kakulukian/youtube-transcript#11 I also do have a solution. Swapping the library 'youtube-transcript' to 'youtubei' fixes the issue but i am not sure if this is a good solution as i am not sure if this library is maintained. Also only tested locally so far i dont know if there will be different issues on cloud env. LibreChat\api\app\clients\tools\structured\YouTube.js const { Client } = require('youtubei'); // replace line 166
const client = new Client();
const video = await client.getVideo(videoId);
const captions = await video.captions.get('en');
return parseTranscript(captions); |
Beta Was this translation helpful? Give feedback.
-
We can't enable transcripts if they are disabled, and I was unaware we could work around it to get the captions. This seems hacky and is not officially supported by YT: https://stackoverflow.com/a/73290079 You shouldn't need to swap the library for this, as you could take a look at how the library does it. PRs welcome. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
I always get error no matter what video i use:
YoutubeTranscriptDisabledError: [YoutubeTranscript] 🚨 Transcript is disabled on this video
Version Information
9b6fa89
Steps to Reproduce
I created an Agent with youtube tool.
Then asked "get me video transcription for ZHhqwBwmRkI"(This video has captions)
i get response:
The transcript is disabled for the video with the ID "ZHhqwBwmRkI," so I'm unable to retrieve the subtitles. If there's anything else you need help with, feel free to let me know!
What browsers are you seeing the problem on?
Chrome
Relevant log output
error: [api/server/controllers/agents/client.js #chatCompletion] Tool Error Failed to fetch transcript: [YoutubeTranscript] 🚨 Transcript is disabled on this video (ZHhqwBwmRkI)
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions