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

too many calls, blacklisted? how to avoid #130

Closed themindfactory closed 3 years ago

themindfactory commented 3 years ago

So this just happened on my LAMP server, I have no ablilty to run chrome/etc on it to answer the captcha and get the cookies...

Hope they un-blacklist the server :-)

If they ever do, how often can you call the transcript function for a video and not get burned.

Will doing many videos at once help? I was doing one at a time.

Thanks!

jdepoix commented 3 years ago

Hi @themindfactory, unfortunately, there aren't any ways to work around this (that I know of), other than what's stated in the error message. Also, I haven't been able to figure out how long it takes to get un-blacklisted, nor how many request you can do before getting blacklisted. It doesn't seem to be consistent though, therefore I assume YouTube decides depending on the current system load. You can try adding sleeps in between requests, to avoid bombarding YouTube with requests, which seems to decrease your likelihood of being blacklisted. However, once again, I don't have any hard numbers on how long you have to sleep, to avoid being blacklisted with certainty 😕

If you make any observations, which help putting some numbers on these behaviours, I would love to hear those! 😊 However, I will close this issue for now, as there unfortunately isn't much which can be done here.