如何检索最近上传到朋友频道的视频? [英] How to retrieve the recents video uploaded on friend's channel?

查看:28
本文介绍了如何检索最近上传到朋友频道的视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

理论上这是我需要的api:

Theorically this is the api I need:

https://developers.google.com/youtube/2.0/developers_guide_protocol_subscriptions#Retrieving_new_subscription_videos

事实上,如果我点击 https://www.youtube.com/my_subscriptions 我看到朋友最近上传的视频(订阅).

In fact, if I click on https://www.youtube.com/my_subscriptions I see the recent video uploaded by friends (subscriptions).

但是调用该端点 (alt=json) 我得到了这个:

But calling that endpoint (alt=json) I get this:

{
    "version": "1.0",
    "encoding": "UTF-8",
    "feed": {
        "xmlns": "http://www.w3.org/2005/Atom",
        "xmlns$openSearch": "http://a9.com/-/spec/opensearch/1.1/",
        "xmlns$gd": "http://schemas.google.com/g/2005",
        "gd$etag": "W/\"CEIMSHwyfSp7I2A9Wh5QGU0.\"",
        "id": {
            "$t": "tag:youtube.com,2008:user:ysWGKld9kilWfiqcfr1pfQ:newsubscriptionvideos"
        },
        "updated": {
            "$t": "2013-11-08T01:23:09.295-08:00"
        },
        "category": [
            {
                "scheme": "http://schemas.google.com/g/2005#kind",
                "term": "http://gdata.youtube.com/schemas/2007#video"
            }
        ],
        "title": {
            "$t": "New Subscription Videos for Mauro Vicentini"
        },
        "logo": {
            "$t": "http://www.gstatic.com/youtube/img/logo.png"
        },
        "link": [
            {
                "rel": "alternate",
                "type": "text/html",
                "href": "https://www.youtube.com/subscription_center"
            },
            {
                "rel": "http://schemas.google.com/g/2005#feed",
                "type": "application/atom+xml",
                "href": "https://gdata.youtube.com/feeds/api/users/ysWGKld9kilWfiqcfr1pfQ/newsubscriptionvideos"
            },
            {
                "rel": "http://schemas.google.com/g/2005#batch",
                "type": "application/atom+xml",
                "href": "https://gdata.youtube.com/feeds/api/users/ysWGKld9kilWfiqcfr1pfQ/newsubscriptionvideos/batch"
            },
            {
                "rel": "self",
                "type": "application/atom+xml",
                "href": "https://gdata.youtube.com/feeds/api/users/ysWGKld9kilWfiqcfr1pfQ/newsubscriptionvideos?alt=json&start-index=1&max-results=25"
            },
            {
                "rel": "service",
                "type": "application/atomsvc+xml",
                "href": "https://gdata.youtube.com/feeds/api/users/ysWGKld9kilWfiqcfr1pfQ/newsubscriptionvideos?alt=atom-service"
            }
        ],
        "author": [
            {
                "name": {
                    "$t": "YouTube"
                },
                "uri": {
                    "$t": "http://www.youtube.com/"
                }
            }
        ],
        "generator": {
            "$t": "YouTube data API",
            "version": "2.1",
            "uri": "http://gdata.youtube.com"
        },
        "openSearch$totalResults": {
            "$t": 0
        },
        "openSearch$startIndex": {
            "$t": 1
        },
        "openSearch$itemsPerPage": {
            "$t": 25
        }
    }
}

实际上没有任何视频"供稿.

where in fact there are not any "videos" feed.

我哪里错了?

推荐答案

可能是这样的

https://gdata.youtube.com/feeds/api/users/[userID]/subscriptions?v=2&alt=json或者https://gdata.youtube.com/feeds/api/users/[userID]/newsubscriptionvideos?v=2&alt=json

https://gdata.youtube.com/feeds/api/users/[userID]/subscriptions?v=2&alt=json or https://gdata.youtube.com/feeds/api/users/[userID]/newsubscriptionvideos?v=2&alt=json

不要忘记添加您可以在其中找到的 youtube 用户 ID

dont forget to add your youtube userID which you can find in

https://www.youtube.com/account_advanced

现在,如果您想显示其他人的订阅,但您不知道他们的用户 ID,您可以使用 OATH 2.0 进行身份验证

now if you want to display someone else subscriptions but you dont know their userID you may have authenticate using OATH 2.0

或者只是使用

https://gdata.youtube.com/feeds/api/users/[youtube_username]/newsubscriptionvideos?v=2&alt=json

https://gdata.youtube.com/feeds/api/users/[youtube_username]/newsubscriptionvideos?v=2&alt=json

这篇关于如何检索最近上传到朋友频道的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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