mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-11 12:25:12 +03:00
- made notebooks consistent: titles, service/format descriptions. - corrected short names to full names, for example, `Word` -> `Microsoft Word` - added missed descriptions - renamed notebook files to make ToC correctly sorted
4.6 KiB
4.6 KiB
In [ ]:
from langchain.document_loaders import YoutubeLoader
In [ ]:
# !pip install youtube-transcript-apiIn [ ]:
loader = YoutubeLoader.from_youtube_url("https://www.youtube.com/watch?v=QsYGlZkevEg", add_video_info=True)In [ ]:
loader.load()In [ ]:
# ! pip install pytubeIn [ ]:
loader = YoutubeLoader.from_youtube_url("https://www.youtube.com/watch?v=QsYGlZkevEg", add_video_info=True)In [ ]:
loader.load()In [ ]:
from langchain.document_loaders import GoogleApiClient, GoogleApiYoutubeLoader
# Init the GoogleApiClient
from pathlib import Path
google_api_client = GoogleApiClient(credentials_path=Path("your_path_creds.json"))
# Use a Channel
youtube_loader_channel = GoogleApiYoutubeLoader(google_api_client=google_api_client, channel_name="Reducible",captions_language="en")
# Use Youtube Ids
youtube_loader_ids = GoogleApiYoutubeLoader(google_api_client=google_api_client, video_ids=["TrdevFK_am4"], add_video_info=True)
# returns a list of Documents
youtube_loader_channel.load()