yt2pdf

yt2pdf is a command for Claude Code from osisdie/claude-code-channels. It costs 0 tokens per session (2,739 once invoked), scanned A, original, MIT.

A command that turns a YouTube video into a downloadable PDF summary in English, Traditional Chinese, or both, then uploads the file to Backblaze B2 cloud storage.

In plain words
What is it for?
Use it to create shareable PDF summaries from YouTube videos, with an optional language choice and date-based output folders.
Why use it?
It saves you from summarizing a video and preparing and storing the resulting document by hand.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/osisdie/claude-code-channels/yt2pdf
Clone the repo
git clone --depth 1 https://github.com/osisdie/claude-code-channels

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for yt2pdf

README.md
[![agentmods](https://agentmods.dev/badge/commands/osisdie/claude-code-channels/yt2pdf.svg)](https://agentmods.dev/commands/osisdie/claude-code-channels/yt2pdf)
Your own site
<a href="https://agentmods.dev/commands/osisdie/claude-code-channels/yt2pdf"><img src="https://agentmods.dev/badge/commands/osisdie/claude-code-channels/yt2pdf.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02739
Opus 5 $0.00000 $0.01370
Sonnet 5 $0.00000 $0.00548
Haiku 4.5 $0.00000 $0.00274

Measured 4d ago against content hash 04bf47c9a7c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

yt2pdf scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sL "https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg" -o output/youtube/YYYY-MM-DD/VIDEO_ID/thumb.jpg
.claude/commands/yt2pdf.md · 278 lines

How it starts

The opening of the file, as written. The whole thing — 278 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Convert a YouTube video into a downloadable PDF summary and upload to B2 Cloud Storage.

Input: $ARGUMENTS — A YouTube URL, optionally followed by --lang en or --lang zh-tw (default: both)

Examples:

  • /yt2pdf https://youtube.com/watch?v=xxx → generates EN + zh-TW PDFs
  • /yt2pdf https://youtube.com/watch?v=xxx --lang en → English PDF only
  • /yt2pdf https://youtube.com/watch?v=xxx --lang zh-tw → Traditional Chinese PDF only

Step 1: Parse & Acknowledge

Extract the video ID and optional --lang flag from input. Supported URL formats:

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://youtube.com/shorts/VIDEO_ID
  • https://www.youtube.com/live/VIDEO_ID

Default language: both en and zh-tw. If --lang is specified, only generate that one.

Compute today's date as YYYY-MM-DD for the output directory.

If running in a channel (Telegram/Slack), reply immediately:

Processing YouTube video... this may take a few minutes.

Save the reply message ID so you can edit it later with progress updates.

Step 2: Download Thumbnail

Download the YouTube video thumbnail to the output directory:

mkdir -p output/youtube/YYYY-MM-DD/VIDEO_ID
curl -sL "https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg" -o output/youtube/YYYY-MM-DD/VIDEO_ID/thumb.jpg

If hqdefault.jpg fails, try mqdefault.jpg. If both fail, continue without thumbnail.

Step 3: Fetch Metadata & Extract Transcript

First, fetch video metadata (title, publish date, channel name, language) via yt-dlp:

yt-dlp --dump-json --skip-download "https://youtube.com/watch?v=VIDEO_ID" 2>/dev/null | python3 -c "
import json,sys; d=json.load(sys.stdin)
print(json.dumps({'title':d.get('title',''),'uploader':d.get('uploader',''),'upload_date':d.get('upload_date',''),'duration':d.get('duration',0),'language':d.get('language','en')}))"

Parse the JSON to get: title, uploader, upload_date (YYYYMMDD → YYYY-MM-DD), language.

Then extract transcript with timestamps and the video's original language:

Read the full file on GitHub · 278 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 278 lines · 0 tokens per session scan A 04bf47c9a7c6

Subscribe to this mod's changes

yt2pdf is a command published in the GitHub repository osisdie/claude-code-channels (5 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,739 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.