问题描述
我当前正在构建一个网络应用程序,该应用程序将显示youtube频道的最新视频.我的问题是,YouTube-API每天仅允许100个请求,这比我需要的要少.
I'm currently building a web-app which will display the last videos of a youtube channel. My problem is, that the YouTube-API only allows 100 requests per day, which are way less than I need.
所以我的想法是每20分钟左右从每个用户那里请求视频,然后将它们缓存在某个地方以便以后显示.
So my Idea was to request the videos every 20 minutes or so from every user and then cache them somewhere to display later on.
是否可以在单个请求中为多个频道选择每个频道的多个视频?
Is there a way to select multiple videos per channel for multiple channels in a single request?
问候亚历克斯
推荐答案
有解决您问题的方法,但它涉及很多,因为它是一个完全不同的应用程序模型:
There is a solution to your problem, but it's quite involved since is about a completely different application model:
不是定期以固定的速度进行拉取,而是由于默认配额带来的限制而不能令人满意,而是通过API的搜索端点(或 playlistItems端点查询了频道的上传列表),请使用所谓的 API推送通知 .
Instead of regularly pulling -- at a constant rate, but unsatisfactory due to limitations imposed by default quotas -- a channel's uploads list via the API's search endpoint (or the playlistItems endpoint queried for the channel's uploads list), make use of the so-called API push notifications.
此解决方案意味着完全不同的前期要求,但是,如果您确实需要实时更新,则将更有效地满足您.
This solution implies entirely different upfront requirements, but, if you really need real time updates, then that will suit you more effectively.
这篇关于通过YouTube API获取多个YouTube频道的最新视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!