Skip to main content

TubeStoevsky

Downloads a YouTube video transcript and turns it into literary prose through a LangChain LLM chain — outputs TXT + MD.

Works with any OpenAI-compatible chat completions API: a local gateway, Ollama, vLLM, OpenAI, or anything else speaking that protocol.

Available on PyPI as tubestoevsky.

How it works

URL
 ├─ yt-dlp       subtitles (manual > auto)  -> {title}.srt
 ├─ SRT parser   timecodes and rolling dupes -> raw text
 ├─ LangChain    prose -> title -> Markdown
 └─ output       {title}.txt, {title}.md

Install

# as a CLI tool
uv tool install tubestoevsky   # or: pip install tubestoevsky
tubestoevsky --help

# from a checkout, for development
uv sync

Configuration

Copy .env.example to .env and set LLM_API_KEY. The file is read from the current directory, the project root, or ~/.config/tubestoevsky/.env.

Variable Purpose Default
LLM_BASE_URL OpenAI-compatible endpoint (/v1 appended when absent) http://127.0.0.1:4000
LLM_API_KEY API key for that endpoint required
LLM_MODEL model name served by it gpt-4o-mini
TRANSCRIPT_LANG subtitle language en
OUTPUT_DIR output directory .
LLM_TEMPERATURE sampling temperature 0.3
LLM_TIMEOUT request timeout, sec 1800
YTDLP_COOKIES / YTDLP_COOKIES_FROM_BROWSER access to restricted videos —

Usage

Example run:

$ tubestoevsky --lang en --model deepseek-flash https://youtu.be/q0aFOxT6TNw
[1/4] Downloading subtitles (en) via yt-dlp ...
      -> iPhone-17-Pro-Review-Paradox-in-a-Box.srt
[2/4] Parsing SRT, deduplicating lines ...
      -> 2349 words (raw text: 12816 chars)
[3/4] LangChain chain (deepseek-flash via http://127.0.0.1:4000/v1) ...
      [LLM 1/3] rewriting as prose (2349 words) ...
      [LLM 1/3] done: 2300 words
      [LLM 2/3] document title ...
      [LLM 2/3] done: "iPhone 17 Pro Review: The Most Pro iPhone for the Masses"
      [LLM 3/3] Markdown layout ...
      [LLM 3/3] done: 2318 words
      -> prose: 2300 words, title: "iPhone 17 Pro Review: The Most Pro iPhone for the Masses"
[4/4] Writing .txt and .md ...
Done:
  ./iPhone-17-Pro-Review-Paradox-in-a-Box.srt
  ./iPhone-17-Pro-Review-Paradox-in-a-Box.txt
  ./iPhone-17-Pro-Review-Paradox-in-a-Box.md

Full generated output is available in examples/: transcript, prose, and Markdown.

Install globally and run with an inline API key:

uv tool install tubestoevsky
LLM_API_KEY='sk-xxxxx' tubestoevsky --lang en --model qwen3.8-27b https://youtu.be/q0aFOxT6TNw

Other examples:

tubestoevsky <URL>
tubestoevsky <URL> --lang en --out ./out
tubestoevsky <URL> --model gpt-4o-mini

# or without installing:
uvx tubestoevsky <URL>

# from a checkout:
uv run python -m transcript_app <URL>

Layout

transcript_app/
  __main__.py    CLI
  config.py      .env + CLI flags
  downloader.py  yt-dlp
  srt.py         subtitle parser
  chain.py       LangChain chain over the API
  prompts.py     step prompts
  outputs.py     .txt/.md writers

Notes

  • LLM steps stream: some gateways fail to return monolithic responses.
  • Accept-Encoding: identity and use_responses_api=False work around proxy hangs.
  • Run long requests in the foreground.

Metadata

Release files for tubestoevsky 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tubestoevsky 1.0.1
File Size Uploaded
tubestoevsky-1.0.1.tar.gz 136.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tubestoevsky 1.0.1
File Interpreter ABI Platform
tubestoevsky-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 148.8 kB

Release files / tubestoevsky-1.0.1.tar.gz

Download URL tubestoevsky-1.0.1.tar.gz
Size 136.1 kB
Tags Source
SHA-256 checksum
How to use checksums
190a60aa0678b931b178f98dd5f51226297aceb5844dd28f7967faf6087f879d
BLAKE2b-256 checksum
How to use checksums
ebd8254b69ae7b848538280a19ff221ebcb7ba1a6b3766b60e1b382b5b46f87a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / tubestoevsky-1.0.1-py3-none-any.whl

Download URL tubestoevsky-1.0.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d1dfb1d1192013e8ca8ebc5321f53ef9edb3296eb35eaf817b52846d7ff9f1d
BLAKE2b-256 checksum
How to use checksums
0ded23e3fb43e47f1a14c617fdfcaa75713dd1e28d37c6623ed710ef3ba24c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page