作为YouTube关于实施和迁移到API V3的官方留档,他们说:
YouTube数据API(v2)功能:检索视频推荐
v3 API不会检索仅包含为当前API用户推荐的视频的列表。但是,您可以使用v3 API通过调用activities.list方法并将home参数值设置为true来查找推荐的视频。
但现在参数 home
也被弃用了。目前,当我将 home
参数设置为 true 时
,我只检索频道中最近上传的视频:YouTube 中的热门视频。根本没有带有sket.type=recommendation的视频
。
我需要在新的提要中显示经过身份验证的用户的推荐视频,但YouTube似乎完全不赞成这一功能。有人有解决办法吗<首先谢谢!
api的文档包括一种测试请求的方法。这里的代码示例展示了如何为经过身份验证的请求设置“我的”。
YouTube活动
这是Android示例代码。它需要在某个后台线程中。在 channelList 响应上 setmine = true 就像 home(我认为)。不确定您的实现是针对 Web 还是应用。
这是Android代码:
YouTube youtube = new YouTube.Builder(transport, jsonFactory,
credential).setApplicationName(getString(R.string.app_name))
.build();
YouTube.Activities.List activities;
ActivityListResponse activityListResponse = null;
List<ActivityData> activitiesData = new ArrayList<ActivityData>();
try {
/*
* Now that the user is authenticated, the app makes a
* channels list request to get the authenticated user's
* channel. Returned with that data is the playlist id for
* the uploaded videos.
* https://developers.google.com/youtube
* /v3/docs/channels/list
*/
ChannelListResponse clr = youtube.channels().list("contentDetails")
.setMine(true).execute();
activities = youtube.activities().list("id,snippet,subscriberSnippet");
activities.setChannelId(clr.getItems().get(0).getId());
activities.setMaxResults((long) 50);
activityListResponse = activities.execute();
ArrayList<String> subscriptionListIdentifier = new ArrayList<String>()
,listTitles = new ArrayList<String>()
,listThumbnails = new ArrayList<String>();
List<Activity> results = activityListResponse.getItems();
for (Activity activity : results) {
listTitles.add(activity.getSnippet().getTitle());
listThumbnails.add(activity.getSnippet().getThumbnails().getDefault().getUrl());
subscriptionListIdentifier.add(activity.getId());
//if ("public".equals(playlist.getStatus()
// .getPrivacyStatus())) {
ActivityData data = new ActivityData();
data.setActivity(activity);
activitiesData.add(data);
//}
}
return activitiesData;
我找到了这个youtubes搜索api。我们所需要做的就是将一个视频id放入与视频id相关的中,它将给出一个与之相关的视频列表。
不幸的是,我找不到有关此功能的任何文档或示例。这似乎已经被弃用了。但是,您可以使用显示活动资源格式的示例JSON结构检查此文档,如推荐:
"recommendation": {
"resourceId": {
"kind": string,
"videoId": string,
"channelId": string,
},
希望这有所帮助!
推荐阅读 David Goodger的 Code Like a Pythonista: Idiomatic Python 包含了很多实用的Python例子和技术。 Doug Hellmann的 Python Module of the Week 系列的重点是建设一个使用Python标准库中的模块的示例代码的仓库。
文档资料 必须 熟记 Laravel 5.5 官方文档,查阅时能快速定位,5 遍以上; 必须 熟记 Laravel 5.5 API 文档 的类结构,查阅时能快速定位; 必须 熟记所有 PSR 通过的标准; PSR 目前还未通过的标准,也要 应该 知晓 http://www.php-fig.org/psr/ 应该 熟悉 PHP 最佳实践 应该 了解 『Rails 信条』 教程 如果你是新手,想从零开
问题内容: Pypubsub为您的Python应用程序提供了一种解耦其组件的简单方法:应用程序的某些部分可以发布消息(带有或不带有数据),其他部分可以订阅/接收它们。这允许消息“发件人”和消息“侦听器”彼此不知道: 一个不需要导入另一个 发件人不需要知道 “谁”得到消息, 监听者将如何处理数据, 甚至任何侦听器都将获取消息数据。 同样,听众也不必担心消息的来源。 这是用于实现模型-视图-控制器体系
关于react生命周期相关的介绍 React.Component components组件思想使得你在开发用户页面的时候,把界面看成是一个个独立、可重用的子块,并且每个块都是隔离于其它板块的。React.Component是React上提供的一个方法! Overview React.Component是一个抽象基础类,我们很少直接提伦它,相反,我们更倾向于关心它的子类,我们在定义组件的时候,最少应
读取用户推荐信息 调用地址 http://api.bilibili.cn/recommend 参数 字段 必选 类型 说明 tid true int 分类编号 new排序为必填 其他为可选 page false int 结果分页选择 默认为第1页 pagesize false int 单页返回的记录条数,最大不超过100,默认为30。 order false string 排序方式 排序方式 字段
Whilst what we get with Backbone out of the box can be terribly useful, there are some equally beneficial add-ons that can help simplify our development process. These include: Backbone Marionette Bac