Skip to content

API Reference parrot_loaders.youtube

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_loaders.youtube

View source

Alias VideoLoader

Re-exported from parrot_loaders.video.VideoLoader.

Class YoutubeLoader

Loader for Youtube videos.

Parameter Type Default Description
*args ()
**kwargs {}

Method YoutubeLoader.get_video_info

get_video_info(url: str) -> dict

Parameter Type Default Description
url str

Returns: dict

Method YoutubeLoader.download_audio_wav

Download best audio and convert to WAV (16 kHz mono) via ffmpeg (required by yt-dlp). Returns the final .wav Path.

download_audio_wav(url: str, path: Optional[Union[str, Path]] = None) -> Path

Parameter Type Default Description
url str
path Optional[Union[str, Path]] None

Returns: Path

Method YoutubeLoader.download_video

Downloads a video from a URL using yt-dlp with enhanced error handling.

download_video(url: str, path: Path) -> Path

Parameter Type Default Description
url str The URL of the video to download.
path Path The directory where the video will be saved.

Returns: Path

Method YoutubeLoader.save_file_async

Async file saving utility.

save_file_async(file_path: Path, content: Union[str, bytes]) -> None

Parameter Type Default Description
file_path Path
content Union[str, bytes]

Method YoutubeLoader.read_file_async

Async file reading utility.

read_file_async(file_path: Path) -> str

Parameter Type Default Description
file_path Path

Returns: str

Method YoutubeLoader.load_video

Async method to load video and create documents.

Emits a parent/child Document set:

  • one parent content_kind='video_transcript' carrying the full transcript and the WEBVTT string in metadata['vtt']
  • N children content_kind='video_dialog', one per Whisper turn, each linked to the parent via parent_document_id

Both kinds are atomic for the splitter (see _ATOMIC_CONTENT_KINDS in parrot.loaders.abstract), so Whisper-aligned segments are never re-split.

load_video(url: str, video_title: str, transcript: Optional[Union[str, None]] = None) -> List[Document]

Parameter Type Default Description
url str
video_title str
transcript Optional[Union[str, None]] None

Returns: List[Document]

Method YoutubeLoader.extract_video

Extract video and return metadata with file paths.

extract_video(url: str) -> dict

Parameter Type Default Description
url str

Returns: dict

Method YoutubeLoader.extract

Extract all videos and return metadata.

extract() -> List[dict]

Returns: List[dict]

Function extract_video_id

extract_video_id(url: str) -> Optional[str]

Parameter Type Default Description
url str

Returns: Optional[str]

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally