Youtube API V3 禁止出现错误 403 [英] Error 403 Forbidden whith Youtube API V3

查看:12
本文介绍了Youtube API V3 禁止出现错误 403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Youtube Api v3 有疑问.问题是想从上传的视频中获取信息,在执行 Retrieve information for video 时,我收到错误 403 Forbidden.

I have a problem with Youtube Api v3. The problem is that wants to obtain information from an uploaded video, when performing Retrieve information for video, I get the error 403 Forbidden.

如果我运行我正在使用的浏览器的 url,则会返回 Json 我以及所有视频数据.

If I run the url I am using the browser returns Json me with all video data.

Visual Studio 错误

Visual Studio Error

浏览器中的相同网址.

 if (videoId != "")
            {

                // If the video has the same description as a video and uploaded to YouTube, then I have removed that was uploaded earlier and upload the newrequest.Service.QueryClientLoginToken();
                //Uri urlVideo = new Uri(String.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads/{1}", hipoConfig.canal_youtube, videoId)); This is This is the URL of the version 2.0
                Uri urlVideo = new Uri(String.Format("https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&part=snippet", videoId, hipoConfig.clave_api));

                Video ExistingVideo = request.Retrieve<Video>(urlVideo);
                log.escribirInfoLog("Informacion: El video " + ExistingVideo.VideoId + "se elimina de YouTube para ser sustituido");

                request.Delete(ExistingVideo);

推荐答案

对我也不起作用,访问 youtube API 时出现 403.

Wasn't working for me either, was getting a 403 for accessing the youtube API.

在 API 凭据页面上的API 限制"中添加了它以限制到 YouTube ABI,现在它可以正常工作了.

in the 'API Restrictions' on the APIs credentials page added it to restrict to the YouTube ABI, now it's working fine.

这篇关于Youtube API V3 禁止出现错误 403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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