title: Youtube Fetch All Playlists
body: <p>I am using a PHP script to find all the playlists that a particular user ID has uploaded. The problem is the script is not returning all the playlists, but only some of them .</p>
  
  <p>I want to get all the playlists, but not all of them are fetched.</p>
  
  <p>Check it out here : <a href="http://fescomax.com/android_misc/YoutubeFeedAndroid.php?id=thenewboston" rel="nofollow">Link</a></p>
  
  <p>Here is my code ( GET ARGUMENT IS the /channelname ):</p>
  
  <pre><code>&lt;?php
  header('Content-Type: text/html; charset=utf-8');
      $feedUrl='https://gdata.youtube.com/feeds/api/users/'.$_GET['id'].'/playlists?v=2&amp;alt=json';  
      $data = json_decode(file_get_contents($feedUrl),true);
      $info = $data["feed"];
      $entry = $info["entry"];
      $nEntry = count($entry);
  /*  echo "Playlist Name: ".$info["title"]['$t'].'&lt;br/&gt;';
      echo "Number of Videos (".$nVideo."):&lt;br/&gt;";*/
      $MainFeed=array();
      for($i=0;$i&lt;$nEntry;$i++){
          $thumbId=split('/',$entry[$i]['media$group']['media$thumbnail'][0]['url'] );
          $thumbId=$thumbId[4];       
          $playList=array(                
                          'title' =&gt; $entry[$i]['title']['$t'],
                          'playlistId' =&gt; $entry[$i]['yt$playlistId']['$t'],
                          'published'=&gt;$entry[$i]['published']['$t'], 
                          'thumbId'=&gt;$thumbId,
                          'videosCount'=&gt;$entry[$i]['yt$countHint']['$t'],
                          'videos'=&gt;getVideos($entry[$i]['yt$playlistId']['$t'])                      
                      );
          array_push($MainFeed,$playList);
          //print_r($entry[$i]);
                      /*
          echo "Name: ".$entry[$i]['title']['$t'].'&lt;br/&gt;';
          echo 'http://www.youtube.com/playlist?list='.$entry[$i]['yt$playlistId']['$t'].'&amp;feature=plcp'.'&lt;br/&gt;';     
          echo '&lt;br&gt;$thumbId : '.$thumbId .'&lt;br&gt;';
          echo "playlistId:  ".$entry[$i]['yt$playlistId']['$t']."&lt;br /&gt;";
          echo "published:  ".$entry[$i]['published']['$t']."&lt;br /&gt;";
          */ 
      //  break;
      }
      echo '{ "feed":'.json_encode($MainFeed).'}';
  
  function getVideos($playListId){
      $feedUrl='https://gdata.youtube.com/feeds/api/playlists/'.$playListId.'?v=2&amp;alt=json';  
      $data = json_decode(file_get_contents($feedUrl),true);
      $info = $data["feed"];
      $entry = $info["entry"];
      $nEntry = count($entry); 
      $PLayListVideos=array();
      for($i=0;$i&lt;$nEntry;$i++){
              $video = array(             
                              'title' =&gt; $entry[$i]['title']['$t'],
                              'description' =&gt; $entry[$i]['media$group']['media$description']['$t'],                          
                              'published' =&gt;$entry[$i]['published']['$t'],
                              'duration'=&gt;$entry[$i]['media$group']['yt$duration']['seconds'], 
                              'videoid'=&gt;$entry[$i]['media$group']['yt$videoid']['$t'],
                              'favoriteCount'=&gt;$entry[$i]['yt$statistics']['favoriteCount'],
                              'viewCount'=&gt;$entry[$i]['yt$statistics']['viewCount'],
                              'numDislikes'=&gt;$entry[$i]['yt$rating']['numDislikes'],
                              'numLikes'=&gt;$entry[$i]['yt$rating']['numLikes'],
                              'rating'=&gt;$entry[$i]['gd$rating']['average'],
                              'max'=&gt;$entry[$i]['gd$rating']['max'],
                              'min'=&gt;$entry[$i]['gd$rating']['min'] ,
                              'numRaters'=&gt;$entry[$i]['gd$rating']['numRaters'] ,
                              'rtsp1'=&gt;$entry[$i]['media$group']['media$content']['1']['url'],
                              'rtsp2'=&gt;$entry[$i]['media$group']['media$content']['2']['url'],
                          );
          array_push($PLayListVideos,$video);
                          /*
          echo "Name: ".$entry[$i]['title']['$t'].'&lt;br/&gt;';
          echo "published:  ".$entry[$i]['published']['$t']."&lt;br /&gt;";
          echo "duration : ".$entry[$i]['media$group']['yt$duration']['seconds'].'&lt;br/&gt;';
          echo "videoid : ".$entry[$i]['media$group']['yt$videoid']['$t'].'&lt;br/&gt;';
          echo "Image 90 : ".$entry[$i]['media$group']['media$thumbnail'][0]['url'].'&lt;br/&gt;';
          echo "Image 180 : ".$entry[$i]['media$group']['media$thumbnail'][1]['url'].'&lt;br/&gt;';
          echo "Image 360 : ".$entry[$i]['media$group']['media$thumbnail'][2]['url'].'&lt;br/&gt;';
          echo "favoriteCount : ".$entry[$i]['yt$statistics']['favoriteCount'] .'&lt;br/&gt;';
          echo "viewCount : ".$entry[$i]['yt$statistics']['viewCount'] .'&lt;br/&gt;';
          echo "numDislikes : ".$entry[$i]['yt$rating']['numDislikes'] .'&lt;br/&gt;';
          echo "numLikes : ".$entry[$i]['yt$rating']['numLikes'] .'&lt;br/&gt;';
          echo "rating : ".$entry[$i]['gd$rating']['average'] .'&lt;br/&gt;';
          echo "max : ".$entry[$i]['gd$rating']['max'] .'&lt;br/&gt;';
          echo "min : ".$entry[$i]['gd$rating']['min'] .'&lt;br/&gt;';
          echo "numRaters : ".$entry[$i]['gd$rating']['numRaters'] .'&lt;br/&gt;'; 
  
          echo "rtsp1 : ".$entry[$i]['media$group']['media$content']['1']['url'] .'&lt;br/&gt;'; 
          echo "rtsp2 : ".$entry[$i]['media$group']['media$content']['2']['url'] .'&lt;br/&gt;'; 
          */
          //print_r($entry[$i]); 
      }
      return $PLayListVideos;
  }
  ?&gt;
  </code></pre>
  
  <p><strong>How can I make changes to get all the playlists the channel has?</strong></p>