npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

youtube-transcript-dropin

v1.0.0

Published

Drop-in replacement for youtube-transcript that keeps working on Vercel, Lambda and other servers YouTube blocks.

Readme

youtube-transcript-dropin

A drop-in replacement for youtube-transcript that keeps working once you deploy.

youtube-transcript works on your laptop and then fails on Vercel, Lambda, Render, Netlify or Google Cloud. It throws Transcript is disabled on this video or returns an empty array. The video is fine. YouTube blocks requests from datacenter IP addresses and sends back a player response with no captions in it, so new headers or client versions don't help.

This package has the same API. It still asks YouTube directly first, for free. Only when YouTube blocks the request does it fetch the transcript through a hosted service on your own Apify account.

Migrate

- import { YoutubeTranscript } from 'youtube-transcript';
+ import { YoutubeTranscript } from 'youtube-transcript-dropin';
npm install youtube-transcript-dropin

Then set APIFY_TOKEN in your deployment's environment. Nothing else changes: the same fetchTranscript call returns the same { text, duration, offset, lang } objects and throws the same error classes. require() works too.

import { YoutubeTranscript } from 'youtube-transcript-dropin';

const transcript = await YoutubeTranscript.fetchTranscript('https://www.youtube.com/watch?v=1UL8iZJD38U');
console.log(transcript.map((line) => line.text).join(' '));

How it decides

  1. It fetches the transcript from YouTube the same way youtube-transcript 1.3.1 does.
  2. If that works, you get the result and pay nothing.
  3. If YouTube blocks the request (a captcha, "disabled" captions, an unavailable video, a refused caption URL or an empty result) and a token is set, it fetches the same video through the YouTube Transcripts API Actor instead.
  4. If the hosted fetch can't help either, you get the original error, so your existing error handling keeps working.

A missing language (YoutubeTranscriptNotAvailableLanguageError) or a bad video ID never triggers the fallback.

Options

Everything youtube-transcript accepts, plus two optional fields:

| Option | Default | What it does | |---|---|---| | lang | first track | Transcript language, e.g. 'en' or 'de'. | | fetch | global fetch | Custom fetch for the direct YouTube requests (for example through a proxy). | | apifyToken | process.env.APIFY_TOKEN | Token for the hosted fallback. Without one the package behaves exactly like youtube-transcript. | | fallback | 'auto' | 'auto' tries YouTube first. 'always' skips straight to the hosted fetch, which saves a round trip on servers you know are blocked. 'never' turns the fallback off. |

Cost

Direct fetches are free. Hosted fetches are billed to your Apify account at about $0.0025 per transcript. Videos without captions and failed fetches aren't charged. Apify's free plan includes $5 of monthly credit, which covers roughly 1,800 hosted transcripts a month.

Differences from youtube-transcript

  • youtube.com/shorts/… and youtube.com/live/… URLs are accepted.
  • Timings: the direct path keeps the original behavior. That's milliseconds for the srv3 captions YouTube serves today, and seconds for the old XML format. Hosted results are always in milliseconds.
  • A hosted fetch takes a few seconds, against about one second for a direct one.

Requirements

Node 18 or later. No dependencies.

License

MIT. The direct-fetch code is adapted from youtube-transcript by Kakulukian (MIT).