Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sonichandni/91d8b1b706807c0c35dfa881c5e967b4 to your computer and use it in GitHub Desktop.
Save sonichandni/91d8b1b706807c0c35dfa881c5e967b4 to your computer and use it in GitHub Desktop.
$allvideos = [];
$nextPageToken = '';
do {
$playlistItemsResponse = Youtube::getPlaylistItemsByPlaylistId($list, $nextPageToken );
foreach ($playlistItemsResponse['results'] as $playlistItem) {
array_push($allvideos, $playlistItem);
}
$nextPageToken = $playlistItemsResponse['info']['nextPageToken'];
} while ($nextPageToken <> '');
// using package https://github.com/alaouy/Youtube
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment