{"id":51234658,"url":"https://github.com/krishnakanthb13/yt-transcript-cli","last_synced_at":"2026-06-28T19:02:57.529Z","repository":{"id":365488559,"uuid":"1272336788","full_name":"krishnakanthb13/yt-transcript-cli","owner":"krishnakanthb13","description":"Fetch YouTube transcripts from the command line — translate, clean, merge into paragraphs, batch, AI summaries, and export TXT/SRT/VTT/Markdown/CSV/JSON. Single-file Python. Free \u0026 open source.","archived":false,"fork":false,"pushed_at":"2026-06-17T14:11:47.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T16:45:39.662Z","etag":null,"topics":["ai","batch","captions","cli","command-line","gemini","open-source","python","srt","subtitles","transcript","translation","vtt","youtube","youtube-transcript"],"latest_commit_sha":null,"homepage":"https://krishnakanthb13.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krishnakanthb13.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-17T14:08:54.000Z","updated_at":"2026-06-17T14:16:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/krishnakanthb13/yt-transcript-cli","commit_stats":null,"previous_names":["krishnakanthb13/yt-transcript-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/krishnakanthb13/yt-transcript-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnakanthb13%2Fyt-transcript-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnakanthb13%2Fyt-transcript-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnakanthb13%2Fyt-transcript-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnakanthb13%2Fyt-transcript-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krishnakanthb13","download_url":"https://codeload.github.com/krishnakanthb13/yt-transcript-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnakanthb13%2Fyt-transcript-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34900368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","batch","captions","cli","command-line","gemini","open-source","python","srt","subtitles","transcript","translation","vtt","youtube","youtube-transcript"],"created_at":"2026-06-28T19:02:52.392Z","updated_at":"2026-06-28T19:02:57.522Z","avatar_url":"https://github.com/krishnakanthb13.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ytt — YouTube Transcript CLI\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)\n![Python](https://img.shields.io/badge/Python-3.8%2B-3776AB.svg)\n\nA small, dependency-light command-line tool to fetch a YouTube transcript by URL\nor video ID and print / copy / save it in several formats — with translation,\nclean-up, batch processing and optional AI summaries. The terminal companion to\nthe [browser extension (`yt-transcript-studio`)](https://github.com/krishnakanthb13/yt-transcript-studio).\n\n## First time? Start here (no experience needed)\n\n**Windows**\n1. Install **Python** from [python.org/downloads](https://www.python.org/downloads/).\n   On the first screen, **tick \"Add Python to PATH\"**, then click Install.\n2. Download the project (green **Code → Download ZIP**) and **unzip** it.\n3. Open the **`yt-transcript-cli`** folder and **double-click `ytt.bat`**.\n4. The first run installs what it needs, then an **interactive wizard** asks you —\n   one step at a time — for the link, format, language, translation, clean-up,\n   save folder and AI summary. Press Enter to take any default.\n5. Your transcript is **copied to the clipboard** and **saved** where you chose. Done!\n\n**macOS / Linux**\n1. Check Python 3 is present: `python3 --version` (install from python.org if not).\n2. Download \u0026 unzip the project, open a Terminal in **`yt-transcript-cli`**.\n3. First time only: `chmod +x ytt.sh`\n4. Run: `./ytt.sh \"https://youtu.be/VIDEOID\"`\n\nOnce comfortable, use the options below to choose the language, format and\noutput folder.\n\n## How it fetches (and why it's reliable)\n\nLike the browser extension, the CLI fetches captions through YouTube's\n**InnerTube `player` endpoint using a non-web client (ANDROID/IOS)** — whose\ncaption URLs aren't PoToken-gated — then pulls `json3` from there (this is also\nwhat makes **translation** work). `youtube-transcript-api` is kept as an\nautomatic fallback. The InnerTube path uses only the Python standard library.\n\n## Requirements\n\n- **Python 3.8+**\n- [`youtube-transcript-api`](https://pypi.org/project/youtube-transcript-api/) — fallback engine + `--list`\n- [`pyperclip`](https://pypi.org/project/pyperclip/) — optional (clipboard)\n\nThe `ytt.bat` and `ytt.sh` launchers auto-install these on first run. To install\nmanually:\n\n```bash\npip install youtube-transcript-api pyperclip\n```\n\n## Interactive mode (no flags to remember)\n\nRun with **no video argument** — or pass `--interactive` / `-i`, or just\n**double-click `ytt.bat`** — and the tool walks you through every option in\norder, each with a default you can accept by pressing Enter:\n\n```text\n1. YouTube URL or video ID\n2. Output format (txt/time/srt/vtt/md/csv/json)\n3. Caption language code (blank = auto)\n4. Translate to language code (blank = no)\n5. Remove [Music]/[Applause] sound cues? (y/n)\n6. Merge into readable paragraphs? (y/n)\n7. Save to a file?  →  which folder?\n8. AI summary? (none/summary/bullets/chapters/takeaways)  →  Gemini key\n```\n\nPower users can skip the wizard entirely by passing flags, documented below.\n\n## Usage\n\n```bash\npython ytt.py \u003curl-or-id\u003e [more urls…] [options]\n```\n\nThe input can be a full URL (`watch`, `youtu.be`, `/shorts/`, `/embed/`) or a\nbare 11-character video ID. You can pass **several** at once (batch). Saved files\nare named `\u003cvideoId\u003e_\u003ctimestamp\u003e.\u003cext\u003e` (AI summaries add `_summary.md`).\n\n### All options\n\n| Option | Description |\n|---|---|\n| `\u003cvideo\u003e…` | One or more YouTube URLs/IDs (positional). Omit to be prompted. |\n| `--batch-file FILE` | Read URLs/IDs from a file, one per line (`#` lines ignored). |\n| `--lang`, `-l CODE` | Preferred caption language (`en`, `es`, `hi`, …). |\n| `--translate`, `-t CODE` | Translate the transcript into this language. |\n| `--format`, `-f FMT` | `txt` (default), `time`, `srt`, `vtt`, `md`, `csv`, `json`. |\n| `--clean` | Strip `[Music]` / `[Applause]` / ♪ sound cues. |\n| `--paragraphs`, `-p` | Merge choppy fragments into readable paragraphs. |\n| `--out`, `-o DIR` | Folder to save into (default: current folder). |\n| `--list` | List the video's available caption languages and exit. |\n| `--no-save` | Print only; don't write a file. |\n| `--no-copy` | Don't copy to the clipboard. |\n| `--ai MODE` | AI summary: `summary`, `bullets`, `chapters`, or `takeaways`. |\n| `--ai-model NAME` | Gemini model (default: `gemini-3.5-flash`). |\n| `--gemini-key KEY` | Gemini API key (or set `GEMINI_API_KEY`). |\n| `--interactive`, `-i` | Ask for every option step by step (see below). |\n\nEvery run prints quick **stats** (lines · words · duration · reading time).\nIn batch mode the clipboard copy and stdout dump are skipped (files are written).\n\n### Output formats\n\n| `--format` | File | Use it for |\n|---|---|---|\n| `txt` | `.txt` | A clean paragraph for reading/pasting |\n| `time` | `.txt` | One line per cue, prefixed with `[m:ss]` |\n| `srt` | `.srt` | Subtitles for most editors/players |\n| `vtt` | `.vtt` | Subtitles for the web / HTML5 |\n| `md` | `.md` | Markdown with clickable `?t=` timestamp links |\n| `csv` | `.csv` | Spreadsheets (`start_seconds, timecode, text`) |\n| `json` | `.json` | Programmatic use (`start`, `dur`, `text`) |\n\nThese match the [browser extension](https://github.com/krishnakanthb13/yt-transcript-studio)'s\nexports byte-for-byte.\n\n## Examples\n\n```bash\n# Plain text, saved to the current folder and copied to the clipboard\npython ytt.py https://www.youtube.com/watch?v=dQw4w9WgXcQ\n\n# SRT subtitles in English, into a specific folder\npython ytt.py dQw4w9WgXcQ --lang en --format srt --out ./transcripts\n\n# Translate to Spanish, as Markdown with timestamp links\npython ytt.py dQw4w9WgXcQ --translate es --format md\n\n# Clean + merge into paragraphs, print only\npython ytt.py dQw4w9WgXcQ --clean --paragraphs --no-save --no-copy\n\n# Batch several videos, or a file of URLs\npython ytt.py URL1 URL2 URL3 --format srt --out ./out\npython ytt.py --batch-file urls.txt --out ./out\n\n# AI summary (needs a Gemini key)\nexport GEMINI_API_KEY=AIza...            # Windows: set GEMINI_API_KEY=AIza...\npython ytt.py dQw4w9WgXcQ --ai summary\npython ytt.py dQw4w9WgXcQ --ai chapters --gemini-key AIza...\n\n# What languages are available?\npython ytt.py dQw4w9WgXcQ --list\n```\n\n### AI summaries\n\n`--ai` calls Google **Gemini** directly (standard-library HTTP — no extra\ndependency) using **your own key**. Get a free key at\n[aistudio.google.com/apikey](https://aistudio.google.com/apikey) and pass it via\n`--gemini-key` or the `GEMINI_API_KEY` environment variable. Modes: `summary`\n(overview + key points), `bullets` (outline), `chapters` (timestamped), and\n`takeaways` (action items). The summary prints and is saved next to the\ntranscript as `\u003cid\u003e_\u003ctimestamp\u003e_summary.md`. Default model: **`gemini-3.5-flash`**.\n\n### Windows\n\n```bat\nytt.bat https://youtu.be/dQw4w9WgXcQ --format srt\n```\n\nDouble-click `ytt.bat` with no arguments to be prompted for a URL/ID; the window\nstays open so you can read the result.\n\n### macOS / Linux\n\n```bash\nchmod +x ytt.sh        # first time only\n./ytt.sh dQw4w9WgXcQ --format vtt --out ~/transcripts\n```\n\n---\n\n## License\n\n**ytt — YouTube Transcript CLI** — Copyright (C) 2026 Krishna Kanth B.\nFree software under the **GNU General Public License v3** (or any later version);\ndistributed WITHOUT ANY WARRANTY. See [LICENSE](LICENSE) or\n\u003chttps://www.gnu.org/licenses/\u003e.\n\n---\n\nCompanion to the [browser extension](https://github.com/krishnakanthb13/yt-transcript-studio).\nFree — [support it 💛](https://krishnakanthb13.github.io/S/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrishnakanthb13%2Fyt-transcript-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrishnakanthb13%2Fyt-transcript-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrishnakanthb13%2Fyt-transcript-cli/lists"}