获得" 402需要付款"使用YouTube的iframe API嵌入视频 [英] Getting "402 Payment Required" using Youtube's iframe API to embed videos

查看:239
本文介绍了获得" 402需要付款"使用YouTube的iframe API嵌入视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用YouTube的iframe的API嵌入视频,一次一个,一个网站,得到的视频列表从reddit的上。

I am using youtube's iframe API to embed videos, one at a time, on a website that gets lists of videos from reddit.

昨天一切工作正常,但是今天我收到402需要付费的时候,IFRAME使得以http://www.youtube.com/get_video_info调用[...]和视频不加载。发生这种情况每过一段时间,感觉像某种限制的。我认为这可能与一些变化code,我今天做,但我得到同样的错误,当我恢复到昨天的code。

Yesterday everything was working fine, however today I am getting "402 Payment Required" when the iframe makes a call to http://www.youtube.com/get_video_info[...], and the videos doesn't load. This happens every once in a while, it feels like some sort of throttling. I thought it may be related to some changes to the code I've done today, but I was getting the same errors when I reverted to yesterday's code.

我相信GET请求从Youtube的HTML5播放器,这是在iframe装载发起,呼吁新YT.Player后:

I believe the GET requests originates from Youtube's HTML5 player, which is loaded in the iframe, after calling new YT.Player:

        player = new YT.Player(
        'player', {
            playerVars: {
            // 'controls': 0 // TODO: Hide controls.
            },
            videoId: vidid,
            events: {
            'onReady': onPlayerReady,
            'onStateChange': checkState
            }
        }

GET <一个href=\"http://www.youtube.com/get_video_info?html5=1&video_id=bV3W1a_rY7k&eurl=http%3A%2F%2Flocalhost%2Fderp.html&el=embedded&hl=en_US&splay=1\" rel=\"nofollow\">http://www.youtube.com/get_video_info?html5=1&video_id=bV3W1a_rY7k&eurl=http%3A%2F%2Flocalhost%2Fderp.html&el=embedded&hl=en_US&splay=1
回应:402需要付款

GET http://www.youtube.com/get_video_info?html5=1&video_id=bV3W1a_rY7k&eurl=http%3A%2F%2Flocalhost%2Fderp.html&el=embedded&hl=en_US&splay=1 Response: 402 Payment Required

您可以看到的例子住在这里:

You can see the example live here:

http://ozi.ca/#videos

推荐答案

google搜索了一下后,我发现一个refernce这个问题的这里

After googling for a bit I found a refernce to this problem here.

看来,YouTube已经劫持了402的意思是由于高使用率,YouTube要求需要解决的验证码。

It seems that youtube has hijacked the 402 to mean "Due to high usage, youtube requires a CAPTCHA to be solved."

这篇关于获得&QUOT; 402需要付款&QUOT;使用YouTube的iframe API嵌入视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆