{"id":50927851,"url":"https://github.com/baymac/yt-sum","last_synced_at":"2026-06-17T01:03:29.541Z","repository":{"id":362758724,"uuid":"1094065621","full_name":"baymac/yt-sum","owner":"baymac","description":"A chrome extension to summarize YouTube videos","archived":false,"fork":false,"pushed_at":"2026-06-13T19:25:05.000Z","size":169,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T21:21:59.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baymac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/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":"2025-11-11T07:54:51.000Z","updated_at":"2025-11-11T07:56:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/baymac/yt-sum","commit_stats":null,"previous_names":["baymac/yt-sum"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baymac/yt-sum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baymac%2Fyt-sum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baymac%2Fyt-sum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baymac%2Fyt-sum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baymac%2Fyt-sum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baymac","download_url":"https://codeload.github.com/baymac/yt-sum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baymac%2Fyt-sum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34429497,"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-16T02:00:06.860Z","response_time":126,"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":[],"created_at":"2026-06-17T01:03:16.515Z","updated_at":"2026-06-17T01:03:29.522Z","avatar_url":"https://github.com/baymac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![AI Generated](https://img.shields.io/badge/🤖_AI-Generated-orange)\n\n# YouTube Video Summarizer\n\nA Chrome extension (Manifest V3) that summarizes YouTube videos from their **full\ntranscript** using Google's Gemini API — so you can read the summary instead of watching.\n\n## Features\n\n- **📝 Summarize button on every video** — home feed tiles, watch-page related videos, and\n  the watch page itself. One click summarizes that video.\n- **Everything in the side panel.** Summaries render in Chrome's side panel, so you can keep\n  the video on screen while you read. (There's also a **Summarize current video** button\n  inside the panel.)\n- **Chat copilot.** Ask follow-up questions about the video right in the side panel and get\n  streaming answers, with a **Stop** button to interrupt a reply mid-stream. The transcript is\n  used as context automatically, so you can start asking before (or instead of) generating a\n  summary.\n- **Instant on watch pages.** Opening a watch page fetches the transcript in the background, so\n  the panel is ready the moment you open it. No Gemini quota is spent until you click Summarize\n  or send a chat message.\n- **Transcript-first, with a fallback.** Summaries are built from the real transcript. When\n  captions are unavailable (YouTube pot-token gating, or no captions at all), it falls back\n  to Gemini's native video understanding, so a normal public video never just fails.\n- **Streaming output.** The summary streams in token-by-token instead of waiting for the full\n  response.\n- **Safe by default.** Your API key lives in the background service worker and never reaches\n  the page. Rendered text is HTML-escaped; links are protocol-sanitized. Dark mode included.\n\nModel: `gemini-2.5-flash` (v1beta `streamGenerateContent`). The transcript path is cheap and\nfast; the video-understanding fallback is the reliability backstop. Private/members-only\nvideos with no captions are the one case neither path can reach — the extension says so\nclearly instead of guessing.\n\n## Setup (load unpacked)\n\nRequires **Chrome 114+** (side panel API) and **Node 18+**.\n\n1. Build the extension:\n\n   ```bash\n   npm install\n   npm run build \u0026\u0026 npm run icons\n   ```\n\n   This produces the bundled `content.js`, `background.js`, `popup.js`, and the icon PNGs.\n\n2. Load it into Chrome:\n   - Open `chrome://extensions/`\n   - Enable **Developer mode** (top right)\n   - Click **Load unpacked** and select this folder\n\n3. Add your Gemini key:\n   - Click the extension icon to open the side panel\n   - Open **⚙️ Settings**, paste your **Gemini API key**\n     ([get one free at Google AI Studio](https://aistudio.google.com/app/apikey)), and Save\n\n## Usage\n\n- **Any video tile** (home feed or related videos): click **📝 Summarize** → the summary\n  opens in the side panel.\n- **Watch page:** click **📝 Summarize** under the title, or open the side panel and click\n  **Summarize current video**.\n- **Ask follow-ups:** on a watch page, type a question into the chat box at the bottom of the\n  side panel and press Enter. Answers stream in; click **Stop** to cut a reply short. You don't\n  need to summarize first — the transcript is already loaded as context.\n\n## Development\n\n```bash\nnpm run build         # bundle src/ → content.js / background.js / popup.js (esbuild)\nnpm run build:watch   # rebuild on change\nnpm test              # unit + integration tests (vitest + jsdom)\nnpm run test:coverage # coverage report\nnpm run e2e           # Playwright: load the extension into Chromium, drive real YouTube\nnpm run icons         # regenerate icon PNGs\n```\n\nSource lives in `src/` and is bundled to the extension root. Shared, unit-tested logic is\nin `src/lib/`:\n\n| File | Responsibility |\n|------|----------------|\n| `lib/transcript.js`  | watch-page parse, caption-track pick, pot-gate detection, json3 parse |\n| `lib/summarize.js`   | Gemini request (transcript + video-understanding modes), streaming, retry/backoff |\n| `lib/youtube-dom.js` | video-id extraction, title strategies, button insertion |\n| `lib/markdown.js`    | markdown → safe HTML, URL sanitization |\n| `lib/storage.js` / `lib/messages.js` | storage wrappers / message protocol |\n\n### Testing against your real YouTube session\n\nLogged-out YouTube has an empty home feed, so the E2E run can optionally use your real\ncookies:\n\n```bash\nnode tests/e2e/import-brave-cookies.mjs   # exports Brave's youtube.com cookies (one Keychain prompt)\nnpm run e2e                               # now runs logged in\n```\n\nCookies are written to `.context/youtube-cookies.json` (gitignored). It holds live session\ncredentials — delete it when you're done (`rm .context/youtube-cookies.json`). The core\ninjection e2e tests use the search-results page and pass without it; only the \"logged-in home\nfeed\" test needs a session (it skips when absent).\n\n## Free alternative — `/yt-summarize` for Claude Code\n\nDon't want to use a paid Gemini key? `.claude/commands/yt-summarize.md` is a Claude Code\nslash command that fetches a video's transcript with the free\n[`youtube-transcript-api`](https://github.com/jdepoix/youtube-transcript-api) and has\n**Claude itself** summarize it — no API key.\n\n```\n/yt-summarize https://www.youtube.com/watch?v=VIDEO_ID\n```\n\nTo use it anywhere, copy it to your global commands dir:\n\n```bash\ncp .claude/commands/yt-summarize.md ~/.claude/commands/\n```\n\n`scripts/yt-transcript.py` is the standalone extractor it uses (kept in an isolated venv, so\nit works on PEP-668 \"externally managed\" Python).\n\n## Docs\n\n- [Architecture](docs/DOCUMENTATION.md) — component diagram, summarization ladder, message protocol\n- [Security model](docs/SECURITY.md) — XSS prevention, URL sanitization, API key isolation\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaymac%2Fyt-sum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaymac%2Fyt-sum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaymac%2Fyt-sum/lists"}