Skip to content
deneal2005Public

About

Free YouTube transcript generator - Express + yt-dlp backend, plain-text-first UI, export to TXT/SRT/VTT/JSON.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

📜 Scriptly

A free, fast, self-hostable YouTube transcript generator. Paste any YouTube link and get a clean, searchable, timestamped transcript you can copy or export as TXT, SRT, VTT, or JSON.

A modern, distinct take on the youtubetotranscript.com concept — same job, nicer UI, more export options.

Built with Node + Express

Features

  • Any YouTube URL — full links, youtu.be, Shorts, embeds, /live, or a bare video id
  • Clickable timestamps that jump to the exact second on YouTube
  • Live search across the transcript with highlighting
  • Auto-detected captions — pulls the best track in the video's own language
  • Plain-text (default) or timestamped views
  • Export as .txt, .txt (with timestamps), .srt, .vtt, or .json
  • Dark / light theme, fully responsive
  • One-click copy, word count, and reading time
  • Persistent caching (memory + disk) and rate limiting — repeat and shared lookups return in ~1ms and survive restarts; popular example videos are pre-warmed on boot

How it works

YouTube now gates its caption endpoint behind an anti-bot token, so a plain HTTP request returns nothing. Scriptly drives yt-dlp — the most reliable YouTube extractor — to resolve fresh, working caption URLs plus video metadata, then downloads and parses the captions itself (json3 → srv1 → vtt fallback) into clean segments.

Browser ──▶ /api/transcript ──▶ yt-dlp (metadata + caption URLs) ──▶ fetch + parse ──▶ JSON

Requirements

  • Node.js 18+
  • yt-dlp on the server's PATH
# install yt-dlp (pick one)
pip install -U yt-dlp
# or download the standalone binary from https://github.com/yt-dlp/yt-dlp/releases

Optional but recommended for resilience: pip install -U "yt-dlp[default]" curl_cffi enables request impersonation, which reduces the chance of YouTube throttling.

Run locally

npm install
npm start          # http://localhost:3000
# or: npm run dev  (auto-restart on change)

Environment variables:

Variable Default Purpose
PORT 3000 Port to listen on
YTDLP_PATH yt-dlp Full path to the yt-dlp binary
PREWARM (on) Set to 0 to skip warming example videos on boot
YTDLP_COOKIES_FILE (none) Path to a Netscape cookies.txt (beats YouTube's bot check on cloud IPs)
YTDLP_COOKIES_B64 (none) base64 of a cookies.txt, if you can't mount a file
YTDLP_PROXY (none) Proxy URL for yt-dlp and the caption download (HTTPS_PROXY/HTTP_PROXY also work)

A note on speed: the first fetch of a new video takes ~2s because YouTube gates caption text behind an anti-bot token that only yt-dlp reliably defeats — a direct API call returns empty. Already-seen videos are served from the memory/disk cache in ~1ms. Transcripts are cached for 7 days under .cache/ (git-ignored).

API

GET /api/transcript?url=<youtube-url>&lang=<optional-lang-code>

Example:

curl "http://localhost:3000/api/transcript?url=https://youtu.be/jNQXAC9IVRw"

Response shape:

{
  "video":    { "id", "title", "author", "lengthSeconds", "viewCount", "thumbnail", "url" },
  "language": { "code", "label", "auto" },
  "available":[ { "languageCode", "label", "auto" } ],
  "segments": [ { "start", "duration", "text" } ]
}

Errors return { "error": "...", "code": "..." } with an appropriate HTTP status (404 no captions, 422 unavailable/private, 429 rate-limited, 503 blocked).

Deploy

Any host that can run the included Dockerfile works (a small VPS, Fly.io, Render, Railway, a container, etc.). For Render there's a one-click render.yaml Blueprint.

Beating YouTube's bot check on a cloud host

From a datacenter IP (Render, Fly, most clouds) YouTube frequently responds with “Sign in to confirm you're not a bot”, which surfaces as a 503 blocked error. This is YouTube rejecting the IP, not a bug. Two ways around it:

  1. Cookies (free). Export youtube.com cookies in Netscape format from a browser logged into a throwaway Google account, then expose them to the app:
    • Render: Service → Environment → Secret Files → add cookies.txt, then set YTDLP_COOKIES_FILE=/etc/secrets/cookies.txt.
    • Or set YTDLP_COOKIES_B64 to the base64 of the file.
    • Tip: export from a fresh private/incognito window and close it right after, so YouTube doesn't rotate (invalidate) the cookies. Re-export when they expire.
    • ⚠️ Use a disposable account — automated use can get a Google account flagged.
  2. Proxy (most reliable, usually paid). Point YTDLP_PROXY at a residential/ mobile proxy; it's applied to both yt-dlp and the caption download.

Notes & etiquette

Scriptly only reads publicly available captions on demand and stores nothing in a database. It is not affiliated with YouTube. Respect creators' rights and only use transcripts where you're permitted to.

License

MIT

About

Free YouTube transcript generator - Express + yt-dlp backend, plain-text-first UI, export to TXT/SRT/VTT/JSON.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages