/* Copyright (C) 2015 Robert Lehmann <lehmrob@gmail.com>
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */
package feedmeyoutubecrawler.crawler;

import com.google.api.services.youtube.model.Channel;
import java.io.IOException;

/**
 * Crawl all youtube videos for the configured channel. Crawling all classes
 * with the desired video ids.
 * 
 * @author Robert Lehmann
 * @since 1.0
 */
public class PlaylistCrawler {
    private final YouTubeConnection _connection;
    private final Channel _channel;
    
    /**
     * Constructor. Initialize the playlist crawler.
     * @param connection instance for {@link YouTubeConnection}.
     * @throws IOException Error while requesting the own {@link Channel}
     * refence
     * @since 1.0
     */
    public PlaylistCrawler(final YouTubeConnection connection) throws 
            IOException {
        _connection = connection;
        _channel = CrawlerUtils.getMyChannel(connection);
    }
}

@@ -262,49 +262,328 @@
 ube.
-model.Channel;%0Aimport java.io.IOException
+YouTube;%0Aimport com.google.api.services.youtube.model.Channel;%0Aimport com.google.api.services.youtube.model.Playlist;%0Aimport com.google.api.services.youtube.model.PlaylistListResponse;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List
 ;%0A%0A/
@@ -695,17 +695,16 @@
  ids.%0A *
- 
 %0A * @aut
@@ -768,16 +768,45 @@
 tCrawler
+ implements Crawler%3CPlaylist%3E
  %7B%0A    p
@@ -889,16 +889,189 @@
 el;%0A    
+private final YouTube.Playlists.List _playlistReq;%0A    private String _nextToken = %22%22;%0A%0A    public static final Logger LOG = LoggerFactory.getLogger(PlaylistCrawler.class);%0A
 %0A    /**
@@ -1124,16 +1124,23 @@
 rawler.%0A
+     *%0A
      * @
@@ -1276,16 +1276,36 @@
 %7D%0A     *
+                    
  refence
@@ -1404,14 +1404,9 @@
 rows
- %0A    
+%0A
     
@@ -1515,16 +1515,1228 @@
 ction);%0A
+        _playlistReq = createPlaylistReq();%0A    %7D%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    public boolean hasNext() %7Breturn _nextToken != null;%7D%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    public List%3CPlaylist%3E getNext() throws IOException %7B%0A        final List %3CPlaylist%3E playlists = new ArrayList%3C%3E();%0A%0A        _playlistReq.setPageToken(_nextToken);%0A        PlaylistListResponse playlistListResponse = _playlistReq.execute();%0A        playlists.addAll(playlistListResponse.getItems());%0A        _nextToken = playlistListResponse.getNextPageToken();%0A%0A        return playlists;%0A    %7D%0A%0A    /**%0A     * Creates the playlist request.%0A     *%0A     * This methode creates the request for getting the playlists.%0A     *%0A     * @return Created %7B@link Playlist%7D Request.%0A     *%0A     * @since 1.0%0A     */%0A    private YouTube.Playlists.List createPlaylistReq() throws IOException %7B%0A    %09final YouTube.Playlists.List request = _connection.getYouTube().playlists().list(%0A                %22id,snippet%22);%0A        request.setMaxResults(1L);%0A        request.setChannelId(_channel.getId());%0A        request.setFields(%22items(id,snippet/title,snippet/description),%22 +%0A                %22nextPageToken,pageInfo%22);%0A        return request;%0A
     %7D%0A%7D%0A

Add Class for crawling playlists