问题
I have some php code that fetches a youtube link and then gets its thumbnail. For that I am using this:
$str = file_get_contents(youtubelink);
But I am getting this error sometimes:
Warning: file_get_contents(https://www.youtube.com/watch?v=urA28s-OGW0): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests in /home/mps/public_html/ajax/file.php on line 34
What is causing this error? How can I get rid of it? What's the limit I can access?
回答1:
They are probably blocking you. They have an API to use, https://developers.google.com/youtube/v3/.
来源:https://stackoverflow.com/questions/28918835/youtube-error-http-429-too-many-requests