langchain icon indicating copy to clipboard operation
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

Open Gptify opened this issue 1 year ago • 7 comments

The error is random, it only occurs sometimes. loader = YoutubeLoader.from_youtube_url(vidurl, add_video_info=True, language=lang)

Gptify avatar Apr 17 '23 23:04 Gptify

Update : the problem is in : add_video_info=True

ghost avatar Apr 17 '23 23:04 ghost

did you find a way to fix this ?

KasunAb avatar Apr 30 '23 06:04 KasunAb

some error. is there any fix? thanks

sailor723 avatar May 02 '23 02:05 sailor723

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 avatar May 03 '23 17:05 cygkichi

@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 avatar May 07 '23 01:05 shawnesquivel

@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')

cygkichi avatar May 07 '23 12:05 cygkichi

Thanks @cygkichi !!

shawnesquivel avatar May 07 '23 18:05 shawnesquivel

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.

dosubot[bot] avatar Sep 20 '23 16:09 dosubot[bot]