YouTube Transcript
List a video's caption tracks and download one as timed segments and text (videos the account can edit, no scraping, see its README), or parse VTT/SRT you already have
Beta v0.1.0 Node.js 3 actions ToS risk low
About
A Graphrt plugin for YouTube captions through the official YouTube Data API v3 only. It lists a video's caption tracks and downloads one as timed segments and plain text, and it parses WebVTT/SRT caption files you already have.
What it can do
- list_caption_tracks: captions.list (50 quota units): id, language, name, track_kind (standard, asr auto-generated, forced), CC, draft and status.
- get_transcript: picks the best published track (in language when given, standard, then forced, then auto-generated) or uses caption_id, then captions.download (200 quota units). With caption_id, video is not needed and video_id in the result is null, since the track's video is not checked. format: segments (default) returns segments (start_seconds, end_seconds, text) and one text, max_chars bounds both (rolling auto-captions repeat lines, so segments can be longer than the text) and truncated says either was cut, vtt, srt, ttml or sbv return the file as caption_file. translate_to asks YouTube for a machine translation (tlang).
- parse_captions: WebVTT or SRT text (at most YOUTUBE_TRANSCRIPT_MAX_CAPTION_BYTES) to segments and text, with no network or credentials. Repeated lines from rolling auto-captions are collapsed in text. Cues with impossible timestamps (minutes or seconds of 60 or more, or ending before they start) are skipped.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- List caption tracks
youtube-transcript.list_caption_tracks - Get a transcript
youtube-transcript.get_transcript - Parse a caption file
youtube-transcript.parse_captions
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
YOUTUBE_ACCESS_TOKENA ready OAuth access token (expires after about an hour) -
YOUTUBE_REFRESH_TOKENRefresh trio, access tokens are fetched and cached automatically -
YOUTUBE_TRANSCRIPT_MAX_CAPTION_BYTESLargest caption file downloaded or parsed (default 5 MiB, 65536 to 64 MiB) -
YOUTUBE_CLIENT_ID -
YOUTUBE_CLIENT_SECRET
How to use it
In Graphrt Desktop
- Open Plugins and search for YouTube Transcript.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install youtube-transcript workflow.yaml
- { id: transcript, type: youtube-transcript.get_transcript, video: "https://youtu.be/VIDEO_ID", language: en }
- { id: parsed, type: youtube-transcript.parse_captions, content: "{{#read.data.content#}}" }