问题
I'm using the google-api-php-client (https://github.com/google/google-api-php-client) to search and retrieve only videos from YouTube. I know you can set a query marker called type to video like this:
$searchquery = array(
'q' => "flux",
'maxResults' => 10,
'type' => 'video',
'videoDuration' => 'short',
'videoEmbeddable' => 'true'
);
However it seems to also return live events/livestreams in the search results. Is there a way to exclude live event videos? They have a marker called [liveBroadcastContent] => upcoming
so I can do post-search but that's not ideal. Thanks in advance.
edit: on closer inspection, not all livestreams even seem to have the marker [liveBroadcastContent] set. I have found some that are set to none as with ordinary videos.
来源:https://stackoverflow.com/questions/32025288/exclude-live-events-from-youtube-data-api-search-query