如何从特定频道获取最近24小时的视频价值? [英] How to get the last 24 hours worth of videos from a specific channel?
问题描述
有些解决方案可以检索最后用户上传的视频,但是有没有一种方法可以实际查询YouTube频道,以获取最近24小时内上传的所有视频的ID?
There are solutions for retrieving the last video a user uploaded, but is there a way to actually query a YouTube channel to fetch the ID's of all the videos uploaded in the last 24 hours?
我希望YouTube为此提供一个API参数,但我一直找不到.如果无法获取此类结果,那么我的另一种解决方案是从频道中获取最后10个视频,并查看在过去24小时内上传了哪些视频.
I am hoping that the YouTube has an API parameter for this, but I haven't been able to find one. If the ability to fetch such results is not possible, than my other solution was going to be to fetch the last 10 videos from a channel and see which ones of them have been uploaded within the last 24 hours.
这是我可以让用户上传的方式,但我只希望在24小时内上传:
Here is how I could get a users uploads, but I only want the ones within 24 hours:
def GetAndPrintUserUploads(username):
yt_service = gdata.youtube.service.YouTubeService()
uri = 'http://gdata.youtube.com/feeds/api/users/%s/uploads' % username
PrintVideoFeed(yt_service.GetYouTubeVideoFeed(uri))
推荐答案
使用最新的Data API进行 search.list调用设置类型 =视频, channelId 和
Using the latest Data API do a search.list call setting type = video, channelId and publishedAfter.
这将为您提供在指定时间内上传到该频道的视频.
That will give you the videos uploaded to that channel in the specified time.
这篇关于如何从特定频道获取最近24小时的视频价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!