问题描述
我正在尝试从 youtube 上的某个频道获取最新的视频.不知道为什么,但是 order: 'date',
, publishedAfter: '2019-03-13T19:14:31.000Z',
和 publishedBefore: '2019-02-13T19:14:31.000Z',
好像没有效果.
I am trying to get the latest, up to date videos from a channel on youtube. Not sure why, but order: 'date',
, publishedAfter: '2019-03-13T19:14:31.000Z',
and publishedBefore: '2019-02-13T19:14:31.000Z',
don't seem to have an effect.
我正在使用的完整代码如下:
The full code of what I'm using is here below:
baseURL: 'https://www.googleapis.com/youtube/v3',
params: {
part: 'snippet',
publishedAfter: '2019-03-13T19:14:31.000Z',
publishedBefore: '2019-02-13T19:14:31.000Z',
order: 'date',
maxResults: 10,
key: KEY,
channelId: 'UCzQUP1qoWDoEbmsQxvdjxgQ'
}
youtube 是否在使用 API?有没有一种特殊的方式我们应该这样做?也许我的订购有误?我很困惑
Is youtube messing around with the API? Is there a special way we are meant to be doing this? Maybe my ordering is wrong? I'm quite confused
推荐答案
此问题与以下几个相关:
This issue is related to the following ones:
另请参阅 Google 的问题 #128673552,https://issuetracker.google.com/issues/128673552.
See also Google's issue #128673552, https://issuetracker.google.com/issues/128673552.
此问题的解决方法:改用 PlaylistItems 端点,查询频道的上传列表.但是,您应该注意视频的发布时间和上传时间之间的区别(https://developers.google.com/youtube/v3/docs/videos#snippet.publishedAt).
A workaround for this issue: use PlaylistItems endpoint instead, queried for a channel's uploads list. However your should be aware of the difference between a video's published time and upload time (https://developers.google.com/youtube/v3/docs/videos#snippet.publishedAt).
这篇关于用于从频道获取最新视频的 YouTube API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!