Rand Stats

WWW::YouTube

zef:antononcube

WWW::YouTube

Raku package for getting metadata and transcripts of YouTube videos.

The Raku implementation closely follows the Wolfram Language function YouTubeTranscript, [AAf1].


Installation

From Zef ecosystem:

zef install WWW::YouTube

From GitHub:

zef install https://github.com/antononcube/Raku-WWW-YouTube.git

Usage

Get the transcript of the YouTube video with identifier $id:

youtube-transcript($id)


Details


Examples

use WWW::YouTube;

my $transcript = youtube-transcript('ewU83vHwN8Y');

say $transcript.chars;

say $transcript.substr(^300);
# 35820
# hi everyone welcome to a wolf from
# language design review for version 14.3
# we are talking about LLM
# graph so
# okay so this is for the purpose of of
# knitting together LLM calls like LLM
# function type calls
# exactly
# to support more complex workflows
# um and and to have asynchronous calls to
# LLMs
# yes to w

Summarize using a Large Language Model (LLM):

use LLM::Functions;
use LLM::Prompts;

llm-synthesize(llm-prompt('Summarize')($transcript), e => 'Gemini')
# This language design review for version 14.3 introduces LLM graphs, which orchestrate LLM calls for complex workflows and asynchronous execution. LLM graphs encapsulate LLM functions within nodes, allowing for chaining and conditional execution. The design includes LLM graph submit for instantiation and information retrieval, offering a powerful update to LLM synthesize and a stepping stone toward more agentic workflows.

CLI

The package provides a Command Line Interface (CLI) script. Here is its usage message:

youtube-transcript --help
# Usage:
#   youtube-transcript <id> -- Get YouTube transcripts.
#   
#     <id>    Video identifier

References

[AAf1] Anton Antonov, YouTubeTranscript, (2025), Wolfram Function Repository.