喜欢/不喜欢youtube视频ios

时间:2014-03-03 08:18:32

标签: ios youtube-api

我如何喜欢/不喜欢iOS应用中的YouTube视频?我阅读了文档,但我无法理解,如何实现。

POST /feeds/api/videos/VIDEO_ID/ratings Host: gdata.youtube.com Content-Type: application/atom+xml Content-Length: CONTENT_LENGTH Authorization: Bearer ACCESS_TOKEN GData-Version: 2 X-GData-Key: key=DEVELOPER_KEY

<?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:yt="http://gdata.youtube.com/schemas/2007">   <yt:rating value="like"/> </entry>

2 个答案:

答案 0 :(得分:0)

您需要使用youtube API对视频进行评分。 YouTube目前使用的评分系统可让用户表明他们喜欢或不喜欢视频。链接在这里  https://developers.google.com/youtube/2.0/developers_guide_protocol_ratings

答案 1 :(得分:0)

您需要向

发出POST请求
https://www.googleapis.com/youtube/v3/videos/rate

您需要提交以下参数:

rating: like or dislike (or 'none' to remove the rating from the video)
id: The ID of the video

您的电话应如下所示:

https://www.googleapis.com/youtube/v3/videos/rate?rating=like&id=E6UTz_Doic

您需要用户通过OAuth 2.0授权您的应用程序才能成功对YouTube的API进行POST调用

您应该使用Google's API Client Libraries拨打电话并轻松设置身份验证。

参考:https://developers.google.com/youtube/v3/docs/videos/rate

相关问题