mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-21 12:01:47 +00:00
Updating YoutubeLoader.from_youtube_channel name and doc to reflect actual usage (#2734)
the function actually updates video_id from URL not channel. The docs still reflect the previous old function name `from_youtube_url`. Resolves #1962 https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/youtube.html
This commit is contained in:
parent
0ab364404e
commit
744c25cd0a
@ -106,8 +106,8 @@ class YoutubeLoader(BaseLoader):
|
|||||||
self.language = language
|
self.language = language
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_youtube_channel(cls, youtube_url: str, **kwargs: Any) -> YoutubeLoader:
|
def from_youtube_url(cls, youtube_url: str, **kwargs: Any) -> YoutubeLoader:
|
||||||
"""Given a channel name, load all videos."""
|
"""Given youtube URL, load video."""
|
||||||
video_id = youtube_url.split("youtube.com/watch?v=")[-1]
|
video_id = youtube_url.split("youtube.com/watch?v=")[-1]
|
||||||
return cls(video_id, **kwargs)
|
return cls(video_id, **kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user