www.youtube.com/feeds/videos.xml?playlist_id 只给出最后 15 个视频

www.youtube.com/feeds/videos.xml?playlist_id Only giving last 15 videos

我想从www.youtube.com/feeds/videos.xml?playlist_id获取最后50个视频,目前我只能检索最后15个视频。我试过最大结果参数,但失败了。

我找到了另一种获取 youtube 播放列表视频的方法,而不是上述方法,这里是

<?php
$playlistId = 'Playlist Id here';
$maxResults = 50;
$apiKey = 'youtube api key here';

$string = json_decode(file_get_contents('https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId='.$playlistId.'&maxResults='.$maxResults.'&key='.$apiKey.''));

//echo '<pre>'; print_r($string);

foreach($string->items as $item) {
$video_id = $item->snippet->resourceId->videoId;
}
?>