langchain.js
    Preparing search index...

    A document loader for loading data from YouTube videos. It uses the youtubei.js library to fetch the transcript and video metadata.

    const loader = new YoutubeLoader(
    "https:
    "en",
    true,
    );
    const docs = await loader.load();

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • config: YoutubeConfig

      Returns YoutubeLoader

    Methods

    • Loads the transcript and video metadata from the specified YouTube video. It uses the youtubei.js library to fetch the video metadata and transcripts.

      Returns Promise<Document[]>

      An array of Documents representing the retrieved data.

    • Creates a new instance of the YoutubeLoader class from a YouTube video URL.

      Parameters

      • url: string

        The URL of the YouTube video.

      • Optionalconfig: Omit<YoutubeConfig, "videoId">

        Optional configuration options for the YoutubeLoader instance, excluding the videoId.

      Returns YoutubeLoader

      A new instance of the YoutubeLoader class.