System Status: Online
FREE

PDF GENERATOR

轉錄稿 → 精裝 PDF — 由 LLM 智能代理驅動

0/20 PDFs this month20 remaining

CLI Reference

Complete argument reference for transcript_to_pdf.py — the PDF generation engine powering this app.

Overview

Markdowninstant

Direct render, no LLM

Smart~30s

2 LLM calls, title + summaries

Full Pipeline1-3 min

Multi-agent LLM analysis

Pipeline Flow
InputStructureMetadataTonesWriterTranslatorValidatorRenderBackground

Input Modes

Pick one input source. When --youtube is given alone (no other input), the transcript is auto-fetched from YouTube.

--inputfiledefault:

Path to a transcript file (.txt .vtt .srt). Triggers the full multi-agent LLM pipeline.

--input-dirdirdefault:

Directory of transcript files. Batch-processes every .txt/.vtt/.srt found inside.

--textstringdefault:

Direct transcript text as a CLI string. Useful for piping short content.

--markdownfiledefault:

Markdown file for direct PDF rendering. No LLM calls — instant conversion.

--smartfiledefault:

Transcript file for the lightweight Smart pipeline (2 LLM calls: title generation + per-section summaries).

--youtubeurldefault:

YouTube URL. When used as the sole input, auto-fetches the transcript via youtube-transcript-api (free, no API key). When combined with --input/--text, only embeds the link in the PDF.

stdinpipedefault:

Pipe content via stdin: cat file.txt | python3 transcript_to_pdf.py

Output Options

--titlestringdefault: auto-detected

Document title. In YouTube mode, auto-extracted from the video page if not provided.

--output-dirpathdefault: ./output

Output directory for generated PDFs and intermediate markdown files.

--langstringdefault: auto / zh-Hant

Target language code. In YouTube mode, auto-detected from the video title: Chinese title → zh-Hant, English title → en. Explicit --lang always overrides auto-detection.

--no-bgflagdefault: false

Skip the yellow Deep-Research background template. Outputs a clean white PDF.

LLM Tuning Parameters

These control the SIM (Standardized Intent Management) pipeline — how deeply the LLM analyzes, how faithfully it preserves the source, and how freely it translates.

--richnessfloatrange: 0.0 – 10.0  |  default: 7.0

Thinking depth scale. Controls how much the LLM expands beyond the source material.

0 · 1:12.55 · threshold7 · default10 · max
0.0
Transcription

Absolute loyalty — 1:1 mapping of source

< 5.0
Paraphrase

Paraphrasing zone — restructures without adding

≥ 5.0
Inference

Inference zone — adds analysis and context

≥ 7.0
Enrichment

Triggers brainstormer + researcher agents

--loyaltyfloatrange: 0.0 – 1.0  |  default: 0.8

Faithfulness validation threshold. The loyalty validator checks if the output stays true to the source.

0 · strict0.50.8 · default1.0 · skip

At 1.0, the validation step is skipped entirely.

--expressivefloatrange: 0.0 – 1.0  |  default: 0.5

Translation freedom. How freely the translator can rephrase when converting between languages.

0 · literal0.5 · balanced1.0 · free
--elegancyfloatrange: 0.0 – 1.0  |  default: 0.5

Stylistic polish level. Higher values produce more literary, refined output language.

0 · plain0.5 · balanced1.0 · literary

YouTube Auto-Fetch

When --youtube URL is the only input (no --input or --text), the script fetches the transcript directly from YouTube using the free youtube-transcript-api library. No API key required.

Language Priority
1.zh-Hantpreferred
2.zh-TW
3.zh-Hans
4.zh-CN
5.zh
6.enfallback
Auto-Detection

Title — extracted from YouTube page og:title

Output lang — CJK in title → zh-Hant, else → en

Override — explicit --lang always wins

LLM Provider Chain

For transcript and smart modes, the script tries providers in order until one succeeds. Markdown mode needs no LLM.

Gemini FlashprimaryQwenif QWEN_BASE_URL setAnthropic SDKif ANTHROPIC_API_KEY setClaude CLIsubprocessNo-LLM Fallbackrule-based

Examples

Markdown to PDF (instant, no LLM)
python3 transcript_to_pdf.py --markdown document.md
python3 transcript_to_pdf.py --markdown document.md --title "My Report" --no-bg
YouTube URL → auto-fetch → PDF
python3 transcript_to_pdf.py --youtube "https://www.youtube.com/watch?v=VIDEO_ID"
python3 transcript_to_pdf.py --youtube "https://youtu.be/VIDEO_ID" --lang en --no-bg
Smart mode (2 LLM calls)
python3 transcript_to_pdf.py --smart transcript.txt
python3 transcript_to_pdf.py --smart transcript.txt --title "Video Title"
Full pipeline with custom parameters
python3 transcript_to_pdf.py --input transcript.txt \
  --title "Deep Analysis" --youtube "https://youtu.be/xxx" \
  --richness 9 --loyalty 0.6 --expressive 0.7 --elegancy 0.8
Pipe from stdin
echo "# Hello World" | python3 transcript_to_pdf.py
cat transcript.txt | python3 transcript_to_pdf.py --title "My Doc" --lang en
Batch directory processing
python3 transcript_to_pdf.py --input-dir ./transcripts/ --lang zh-Hant