php - YouTube 错误 HTTP 429 - 请求过多

标签 php http https youtube http-status-code-429

我有一些 php 代码可以获取 youtube 链接,然后获取其缩略图。为此,我正在使用这个:

$str = file_get_contents(youtubelink);

但有时我会收到此错误:

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

是什么导致了这个错误?我怎样才能摆脱它?我可以访问的限制是多少?

最佳答案

他们可能正在阻止您。他们有一个 API 可以使用,https://developers.google.com/youtube/v3/ .

关于php - YouTube 错误 HTTP 429 - 请求过多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28918835/

相关文章:

http - 我可以同时使用 Proxifier 和 Fiddler 吗?

java - 如何将 .cer/.p12 导入移动应用程序

php - 如何在CodeIgniter中扩展多个类?

phpmyadmin : Cannot log in to the MySQL server

php - 如何在我的网站上显示我的Facebook Wall

rest - 使用非英文字符的 HTTP header

javascript - 本地主机的自签名 SSL 证书,如何使可信

nginx - Certbot 没有创建 acme-challenge 文件夹

Spring Boot Default Form Login (/login) 在 HTTPS 实现后由于某种原因导致 HTTP ERROR 404

javascript - 具有数据库中特定信息的模态,具体取决于用户单击的位置