问题
I am using the YouTube v3 API to retrieve a list of videos using this URL:
https://www.googleapis.com/youtube/v3/search?key=[APIKEY]&channelId=[ChannelID]&part=snippet,id&order=date&type=video&maxResults=25
However, YouTube includes upcoming live broadcast results for this query. The live results can be place-holder the author puts days in advance and don't contain any real content so I rather not show them to the users.
I could filter the live results in my code, but I would rather the user sees a fixed number of videos per query (e.g. "25"), and filtering after the query would result in a lower number.
I tried calling:
https://www.googleapis.com/youtube/v3/search?key=[APIKEY]&channelId=[ChannelID]&part=snippet,id&order=date&type=video**&eventType=completed**&maxResults=25
But it only returns completed live events and doesn't show videos that were not broadcast live.
回答1:
You can try to set the publishedBefore property https://developers.google.com/youtube/v3/docs/search/list
来源:https://stackoverflow.com/questions/41659993/using-youtube-v3-api-to-retrieve-a-list-of-videos-for-a-channel-without-live-eve