mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Change pytube to yt-dlp for youtube loader

Open KobaKhit opened this issue 1 year ago • 5 comments

🐛 Describe the bug

pytube has an issue where it will refuse to download a video saying it is age restricted even though it is not https://github.com/pytube/pytube/issues/1712 . yt-dlp does not have that problem and actually returns more data about the video, like most replayed segments. Below code has the link to the video that pytube refused to download

from embedchain import Pipeline as App
import os

os.environ["OPENAI_API_KEY"] = "xxx"

app = App()
app.add('https://www.youtube.com/watch?v=4cUtpiDwU0s', data_type='youtube_video')
app.query("What is the video about?")

Even this Langchain tutorial uses yt-dlp .

It is an easy fix and would require change in this file https://github.com/langchain-ai/langchain/blob/c2d1d903fa35b91018b4d777db2b008fcbaa9fbc/langchain/document_loaders/youtube.py#L59C18-L59C24 .

Let me know and I can make PR.

KobaKhit avatar Nov 01 '23 18:11 KobaKhit

Hey, thanks for opening the issue. Definitely in support of this.

Please feel free to open a PR. Thanks!

deshraj avatar Nov 01 '23 18:11 deshraj

Hey @KobaKhit any updates on this? Would be great to migrate to yt_dlp soon. Thanks!

deshraj avatar Nov 08 '23 09:11 deshraj

Hey @KobaKhit any updates on this? Would be great to migrate to yt_dlp soon. Thanks!

@deshraj @Dev-Khant I have resolved this issue and created a pull request by the name fix/migrate-pytube-to-ytdlp but its been 11 hours and CI has not completed any build checks. Is there anything wrong I am doing or is there some sort of queue?

MoizKhuzema avatar Jun 10 '24 05:06 MoizKhuzema

Hey @KobaKhit any updates on this? Would be great to migrate to yt_dlp soon. Thanks!

@deshraj @Dev-Khant I have resolved this issue and created a pull request by the name fix/migrate-pytube-to-ytdlp but its been 11 hours and CI has not completed any build checks. Is there anything wrong I am doing or is there some sort of queue?

Hi @MoizKhuzema thanks for working on this issue, will review the PR and CI build checks were yet to be started.

Dev-Khant avatar Jun 10 '24 05:06 Dev-Khant

Hey @KobaKhit any updates on this? Would be great to migrate to yt_dlp soon. Thanks!

@deshraj @Dev-Khant I have resolved this issue and created a pull request by the name fix/migrate-pytube-to-ytdlp but its been 11 hours and CI has not completed any build checks. Is there anything wrong I am doing or is there some sort of queue?

Hi @MoizKhuzema thanks for working on this issue, will review the PR and CI build checks were yet to be started.

Noted

MoizKhuzema avatar Jun 10 '24 06:06 MoizKhuzema