langchain
langchain copied to clipboard
YoutubeLoader : Error: Exception while accessing title of https://youtube.com/watch?v=XXX. Please file a bug report at https://github.com/pytube/pytube
The error is random, it only occurs sometimes.
loader = YoutubeLoader.from_youtube_url(vidurl, add_video_info=True, language=lang)
Update : the problem is in : add_video_info=True
did you find a way to fix this ?
some error. is there any fix? thanks
The cause appears to be pytube.https://github.com/pytube/pytube/issues/1586
You need modify
yt = YouTube(f"https://www.youtube.com/watch?v={self.video_id}")
to
yt = YouTube(f"https://www.youtube.com/watch?v={self.video_id}", use_oauth=True, allow_oauth_cache=True)
But, this requires browser authentication.
@cygkichi Thanks that fixed it. But I'm still getting a NoTranscript Error.
Is there a way to pass the language into the YoutubeLoader?
No transcripts were found for any of the requested language codes: ['en']
@shawnesquivel
It looks like there are no English subtitles. If you want to get non-English subtitles, you can do it by specifying them in from_youtube_url.
loader = YoutubeLoader.from_youtube_url('https://www.youtube.com/watch?v=xxxxx', language='ja')
Thanks @cygkichi !!
Hi, @Gptify! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
Based on my understanding, the issue you reported regarding the intermittent error when accessing the title of a YouTube video in the Gptify library has been resolved. User cygkichi identified the cause of the issue and provided a fix that requires browser authentication. Additionally, user shawnesquivel encountered a NoTranscript Error and received help from cygkichi on how to specify non-English subtitles.
Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your contribution to the LangChain repository, and please don't hesitate to reach out if you have any further questions or concerns.