通过 youtube api 访问喜欢或不喜欢功能 [英] Access to like-or-dislike feature through youtube api

查看:44
本文介绍了通过 youtube api 访问喜欢或不喜欢功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 asp.net 应用程序,用户可以在其中将视频上传到 youtube、查看上传的视频并根据需要为视频投票.上面除了投票部分都在工作.

I have an asp.net application where users can upload videos to youtube, view the uploaded videos and vote for a video if they wish. All the above except the voting part is working.

我查看了 youtube api dot net 开发人员指南中的示例代码:video.Rating = 5;request.Insert(video.RatingsUri, video);

I had a look at the sample code in the youtube api dot net developers guide: video.Rating = 5; request.Insert(video.RatingsUri, video);

但不断收到错误消息,提示我需要进行身份验证.如果我验证它的工作正常.

but keep on getting an error saying I need to authenticate. If i authenticate its works fine.

我的问题是,当我通过 api 为视频添加评分(喜欢/不喜欢)时,我是否需要进行身份验证,但是如果您访问 www.youtube.com,您可以在不记录的情况下对视频进行评分(喜欢/不喜欢)首先进入您的个人 YouTube 帐户?

My question is my do I need to authenticate when I add a rating(like/dislike) for a video through the api but if you go to www.youtube.com you can rate(like/dislike) a video without logging into your personal youtube account first?

我需要怎么做才能在不先进行身份验证的情况下为视频添加评级?

What do I need to do to add a rating to a video without authenticating first?

谢谢

推荐答案

根据 API 位于:http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_protocol.html#Ratings

添加评分"部分,它说:

要为视频添加评分,请发送经过身份验证的 POST 请求视频的评分 URL.用户是谁评级视频必须由身份验证令牌.

To add a rating to a video, send an authenticated POST request to the video's ratings URL. The user who is rating the video must be identified by the authentication token.

看起来您在使用 API 时必须对用户进行身份验证.即使可以使用浏览器作为普通用户在没有登录的情况下进行评分.也许是一些 API 限制以防止滥用.

It looks like you must authenticate a user when you use the API. Even when it is possible to rate withouth login as a normal user using a browser. Maybe some API limitation to prevent abuse.

这篇关于通过 youtube api 访问喜欢或不喜欢功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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