jdepoix / youtube-transcript-api

This is a python API which allows you to get the transcript/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require an API key nor a headless browser, like other selenium based solutions do!
MIT License
2.87k stars 326 forks source link

How do you get around the captcha? #141

Closed crysfel closed 2 years ago

crysfel commented 2 years ago

Hi there! Awesome project you have here!

I have a question, how do you get around the captcha? I'm opening youtube from a PHP script I have, it works pretty good on my local, but when I tried on my production server I'm getting this error:

Our systems have detected unusual traffic from your computer network.  This page checks to see if it&#39;s really you sending the requests, and not a robot.  <a href="#" onclick="document.getElementById('infoDiv').style.display='block';">Why did this happen?</a><br><be>

I installed this package on my production server and did a quick test, it works pretty well! I looked at the code and it's basically a call to youtube website.

But, how do you do to avoid getting the captcha?

Regards!

jdepoix commented 2 years ago

Hi @crysfel,

unfortunately, there isn't really an easy way to work around captchas, since blocking traffic from bots pretty much is the point of captchas 😄

The only thing you can do to work around YouTube blocking you is to change your IP address in any way (like using proxies), or simply waiting until they have lifted the ban (I don't know how long you'll have to wait though, as it seems to be fairly inconsistent).

I will close this issue, as there unfortunately isn't much we can do here.