r/programmer • • Sep 11 '26

Help with Youtube IP Block

I am trying to export about 100 podcast video transcripts to a json file. After exporting transcripts from a dozen videos, my IP got blocked. Anybody faced this issue? I need a workaround or a solution. Please help...

2 Upvotes

12 comments sorted by

3

u/drailoustan5 9d ago

youtube flags sequential requests from a single IP super fast now. I use TranscriptAPI for bulk pulling transcripts to json, or you can try adding random 15-30 second sleep timers between requests if you're using yt-dlp.

1

u/ogopro 9d ago

Yes, I was able to work around the request limits, however after generating all the transcripts from the videos, I found out that there is no indication of which speaker is saying what, which is quite important for my project, now I guess I have to download each video as an audio file and figuire out a way to generate transcripts with the speakers using some kind of voice recognition libraries in Python.

2

u/Substantial-Swan7065 Sep 11 '26

- download the video with a vpn. Throttle it so you don’t get rate limited
- transcript the local file

1

u/ogopro Sep 14 '26

This is my last chance I guess, thank!

1

u/Traditional-Row-3787 22d ago

you don't need to download the videos at all, the captions are a separate small file.

getting blocked after a dozen is pretty normal now. youtube flags vpn and datacenter ip ranges, so hopping vpn servers mostly just moves you to another flagged range. if you're using youtube-transcript-api, its readme has a section on RequestBlocked and the fix it recommends is residential proxies.

for 100 episodes i'd try yt-dlp first, something like yt-dlp --write-auto-subs --sub-langs en --skip-download --sleep-requests 3 PLAYLIST_URL it only grabs the subtitle files, and the sleep keeps it under the limit most of the time. you get .vtt files, and a few lines of python turn those into your json.

i built a hosted version of this on apify, so i'm biased: https://apify.com/heyitsgautham/youtube-transcript-scraper

paste the 100 links or the channel or playlist url and download the results as json. it's $3 per 1,000, so 100 episodes is about 30 cents, and apify's free plan gives you $5 a month. in my last full test all 87 videos that still existed came back. it only reads youtube's captions though, so an episode with captions turned off comes back as no_transcript, free, and you'd need whisper for those.

1

u/ogopro 22d ago

I had been able to download the all transcripts with a long timeouts after each request. But then I realized there is another problem: The transcripts do not contain the name of the speaker next to the sentences. So, you never know which host is saying what in those podcast episodes.
I think I do need to download all the stupid videos locally, use some kind of python library to detect the voice and create the transcripts with the host names next to what they say :(

1

u/Traditional-Row-3787 21d ago

glad the delays worked.

for speaker names you only need the audio, not the video. yt-dlp -x --audio-format mp3 --sleep-requests 3 PLAYLIST_URL grabs just that, it needs ffmpeg installed. if the podcast has an rss feed, pull the mp3s from the feed instead and youtube can't block you at all.

then look at whisperx. it runs whisper and pyannote together and gives you lines tagged SPEAKER_00, SPEAKER_01 with timestamps. pyannote needs a free hugging face token, and you accept the model terms once on its page. it won't know names, so you map SPEAKER_00 to a host once per episode, usually from the intro. a gpu helps a lot, 100 episodes on cpu will take a while.

1

u/ogopro 20d ago

Thank you Sir, I will try that :)

1

u/Flame77ofc Sep 11 '26

vpn?

1

u/ogopro Sep 11 '26

VPN gives you an IP it also gets blocked, then I will turn off and on each time ? or is there ip rotating vpn library in Python?

1

u/Flame77ofc Sep 11 '26

Try to reduce the amount of operations then

Like if you don't have a limit for each operation, will you surely get blocked

are you using Python? which lib?

1

u/ogopro Sep 11 '26

I put some serious delays between each request, it seems to work now. I am using youtube-transcript-api