How to get the last 24 hours worth of videos from a specific channel?

爱⌒轻易说出口 提交于 2020-03-18 10:21:06

问题


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?

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.

Edit: 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))

回答1:


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.



来源:https://stackoverflow.com/questions/21974957/how-to-get-the-last-24-hours-worth-of-videos-from-a-specific-channel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!