<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: luisholguindev0</title>
    <description>The latest articles on DEV Community by luisholguindev0 (@luisholguindev0).</description>
    <link>https://dev.to/luisholguindev0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4269382%2Fe5b862aa-801e-4279-a2fb-c0063b54e813.png</url>
      <title>DEV Community: luisholguindev0</title>
      <link>https://dev.to/luisholguindev0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luisholguindev0"/>
    <language>en</language>
    <item>
      <title>YouTube blocks transcript scrapers in three separate ways. Here's how I worked out which one I was hitting</title>
      <dc:creator>luisholguindev0</dc:creator>
      <pubDate>Fri, 27 Nov 2026 16:50:10 +0000</pubDate>
      <link>https://dev.to/luisholguindev0/youtube-blocks-transcript-scrapers-in-three-separate-ways-heres-how-i-worked-out-which-one-i-was-38pd</link>
      <guid>https://dev.to/luisholguindev0/youtube-blocks-transcript-scrapers-in-three-separate-ways-heres-how-i-worked-out-which-one-i-was-38pd</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I built the tool this post is about, a YouTube transcript Actor on Apify. The findings below come from my own test runs in November 2026, and everything here is something I measured.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you've ever pulled YouTube transcripts in bulk, you know how it goes: it works fine on your laptop, then fails on a server with a different error every day. I spent a week getting a transcript scraper to hold up, and the most useful thing I learned was this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;YouTube doesn't have one anti-scraping defense. It has several, each needs a different fix, and the wrong fix makes things more expensive without making them work.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are the three I hit, how I told them apart, and what fixed each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Translated captions: HTTP 429, even on a fresh IP
&lt;/h2&gt;

&lt;p&gt;YouTube can translate any caption track (&lt;code&gt;&amp;amp;tlang=fr&lt;/code&gt;). From an app client, those requests kept failing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From my home IP: 5 of 5 translation requests got &lt;strong&gt;HTTP 429&lt;/strong&gt;. Plain captions for the &lt;em&gt;same videos&lt;/em&gt; returned 200.&lt;/li&gt;
&lt;li&gt;From residential proxies with a fresh IP on every attempt: 5 of 7 still failed after 4 retries each.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A rate limit tied to the IP would have cleared on a fresh IP. This didn't, so the block is on the feature, not the IP. Retrying only tripled my proxy bill.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; try YouTube's translation once with no retries. If it's refused, fetch the original track and translate it myself, line by line, so every timestamp stays exact. I send the lines as a numbered JSON object without the timestamps, then put the translated text back onto the original segments.&lt;/p&gt;

&lt;p&gt;Something that bit me here: auto-captions are cut mid-sentence, and the model "helpfully" merged fragments and dropped lines. Strict JSON-schema output (every key required), batches of 40 lines, and re-asking any missing line together with its neighbors fixed that.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Audio downloads: 403 after the first ~300 KB
&lt;/h2&gt;

&lt;p&gt;For videos with no captions at all, the only way to get a transcript is from the audio. With the keyless Android client, range requests up to ~256 KB worked, and anything past about 300 KB returned &lt;strong&gt;403&lt;/strong&gt;. That's roughly the first minute of audio.&lt;/p&gt;

&lt;p&gt;That isn't an IP problem either: the same IP got the start of the file, so the block is on what that client is allowed to fetch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; rotate &lt;em&gt;clients&lt;/em&gt;, not IPs. yt-dlp with a JavaScript runtime (&lt;code&gt;--js-runtimes node&lt;/code&gt;) downloaded a full 14-minute talk using other client identities. Then Whisper (large-v3-turbo) turns the audio into timestamped text.&lt;/p&gt;

&lt;p&gt;Two Whisper gotchas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On music or silence it invents text: a music-only news intro came back as "Thank you." three times. I filter stock phrases, near-zero words per second, repeats and high compression ratios. If nothing real is left, the result is marked "no speech" instead of returning made-up text.&lt;/li&gt;
&lt;li&gt;Running 4 downloads in parallel in 256 MB of memory killed the whole run. Cap your audio workers by memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. "Sign in to confirm you're not a bot": IP reputation
&lt;/h2&gt;

&lt;p&gt;After ~150 requests in a few hours, my home IP started getting the bot check on some videos. None of 20 runs on residential proxies (fresh IP per attempt) hit it. Datacenter proxies, on the other hand, got it on &lt;em&gt;every&lt;/em&gt; audio download.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; residential IPs and a fresh session per attempt. This is the only one of the three where switching IPs is the answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to tell them apart
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;What works&lt;/th&gt;
&lt;th&gt;What wastes money&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;429 on translated captions only&lt;/td&gt;
&lt;td&gt;Blocked per feature&lt;/td&gt;
&lt;td&gt;Translate it yourself&lt;/td&gt;
&lt;td&gt;Retrying on new IPs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403 partway through an audio download&lt;/td&gt;
&lt;td&gt;Blocked per client&lt;/td&gt;
&lt;td&gt;Switch to a different client&lt;/td&gt;
&lt;td&gt;New IPs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Confirm you're not a bot"&lt;/td&gt;
&lt;td&gt;IP reputation&lt;/td&gt;
&lt;td&gt;Residential IP, fresh session&lt;/td&gt;
&lt;td&gt;Retrying on the same IP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;My rule now: before changing anything, look at &lt;em&gt;which request&lt;/em&gt; failed and &lt;em&gt;what the same IP can still do&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the same IP still gets plain captions, IP reputation isn't your problem.&lt;/li&gt;
&lt;li&gt;If a fresh IP fails the same way, the block is on the feature or the client.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost, measured
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Captions only: about &lt;strong&gt;$0.0002–0.0014 per video&lt;/strong&gt; on Apify. Most of it was compute, until I dropped the default memory from 4 GB to 256 MB, which made runs 7× cheaper and 4× faster.&lt;/li&gt;
&lt;li&gt;Audio fallback: about &lt;strong&gt;$0.004 per audio minute&lt;/strong&gt;, mostly residential proxy traffic. Whisper itself was ~$0.0007 per minute.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Telling the user how each transcript was made
&lt;/h2&gt;

&lt;p&gt;The other half of the work was output that never quietly gives you the wrong thing. Every result says where it came from (&lt;code&gt;transcriptSource&lt;/code&gt;: &lt;code&gt;captions&lt;/code&gt; or &lt;code&gt;audio&lt;/code&gt;) and what happened with translation (&lt;code&gt;translationStatus&lt;/code&gt;: &lt;code&gt;youtube&lt;/code&gt;, &lt;code&gt;ai&lt;/code&gt;, &lt;code&gt;failed&lt;/code&gt;, ...). A failed video gets its own error code (&lt;code&gt;LIVE_NOW&lt;/code&gt;, &lt;code&gt;AUDIO_TOO_LONG&lt;/code&gt;, &lt;code&gt;NO_SPEECH&lt;/code&gt;, ...). One surprise: some uploads have a caption track &lt;em&gt;labeled&lt;/em&gt; English that's actually Spanish lyrics. Detecting the real language and flagging it (&lt;code&gt;languageMismatch&lt;/code&gt;) has saved me more debugging time than anything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Code examples (Python, Node, curl): &lt;a href="https://github.com/luisholguindev0/youtube-transcript-examples" rel="noopener noreferrer"&gt;https://github.com/luisholguindev0/youtube-transcript-examples&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The Actor: &lt;a href="https://apify.com/luisbendeckdev/youtube-transcript-scraper" rel="noopener noreferrer"&gt;https://apify.com/luisbendeckdev/youtube-transcript-scraper&lt;/a&gt;. It's free during launch; you pay only Apify's platform usage. Audio transcription and AI translation need a paid Apify plan, and translation depends on the capacity of the AI provider behind it.&lt;/li&gt;
&lt;li&gt;For AI agents (MCP): &lt;code&gt;https://mcp.apify.com?tools=luisbendeckdev/youtube-transcript-scraper&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you only need captions and run from a home IP, the open-source &lt;a href="https://github.com/jdepoix/youtube-transcript-api" rel="noopener noreferrer"&gt;youtube-transcript-api&lt;/a&gt; library may be all you need.&lt;/p&gt;

&lt;p&gt;Questions welcome, especially if you've hit a fourth kind of block I haven't seen yet.&lt;/p&gt;

</description>
      <category>youtube</category>
      <category>webscraping</category>
      <category>ai</category>
      <category>node</category>
    </item>
  </channel>
</rss>
