YouTube API - 按发布日期查询 [英] YouTube API - Querying by publish date

查看:66
本文介绍了YouTube API - 按发布日期查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个使用 YouTube 代码 API 进行特定类型搜索的网络应用程序.在这种情况下,我尝试搜索与查询匹配且在两个日期之间上传的所有视频.这份文件说我可以使用published-min和published-max参数,而 这个 说我可以使用 updated-min 和更新最大.

I'm writing a webapp that uses the YouTube Code API to do specific types of searches. In this case, I'm trying to search for all videos that match a query, and which were uploaded between two dates. This document says I can use published-min and published-max parameters, while this one says I can use updated-min and updated-max.

这两个参数集都会导致 YouTube 返回错误:

Both of these parameter sets cause YouTube to return an error:

  • published-min returns "This service does not support the 'published-min parameter"
  • updated-min returns "This service does not support the 'updated-max' parameter"
  • With neither returns a correct result set.

如何将我的结果集限制为指定日期范围内的点击次数?

How can I limit my result set to hits within a specified date range?

推荐答案

YouTube 数据 API 参考指南 没有列出任何建议可以在一般时间间隔上进行过滤的可能性.

The Reference Guide for YouTube's Data API doesn't list anything that would suggest the possibility to filter on time interval in general.

published-min 参数仅在 "用户活动提要"部分这是不同的东西,可能不是您想要的东西.或者是吗?

The published-min argument is only advertised in the "User activity feeds" section which is something different and probably not the thing you wanted. Or is it?

链接中的 updated-min 参数是在通用 gdata 上下文中引用的.看起来他们打算描述所有专用 API 共有的所有内容,但不知何故 updated-min 并非随处可用.

The updated-min argument in your link is referenced in a generic gdata context. It looks like they intended to describe all the things common to all the specialized APIs, but somehow updated-min isn't available everywhere.

当涉及到您的问题时.我建议按时排序(orderby=published)并在客户端进行过滤.我知道这不是最佳方式,但我能看到的唯一一种方式是 Google 提供给我们的东西.

When it comes to your very problem. I would suggest sorting on time (orderby=published) and do the filtering on the client side. I know this is not the optimal way, but the only one I can see with what Google gives us.

这篇关于YouTube API - 按发布日期查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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