Modify "more pages" check in YouTube playlist (fixes issue #29)
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Tue, 9 Jun 2009 18:19:29 +0000 (20:19 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:24:40 +0000 (11:24 +0100)
youtube-dl

index 1d9f955e254eb291adeac3e9f83c9cd3334933df..9bbecf7d4a88ae9d29a88beb60b08103efbe3a38 100755 (executable)
@@ -956,7 +956,7 @@ class YoutubePlaylistIE(InfoExtractor):
        _VALID_URL = r'(?:http://)?(?:\w+\.)?youtube.com/view_play_list\?p=(.+)'
        _TEMPLATE_URL = 'http://www.youtube.com/view_play_list?p=%s&page=%s&gl=US&hl=en'
        _VIDEO_INDICATOR = r'/watch\?v=(.+?)&'
-       _MORE_PAGES_INDICATOR = r'/view_play_list?p=%s&amp;page=%s'
+       _MORE_PAGES_INDICATOR = r'/view_play_list?p=%s&page=%s'
        _youtube_ie = None
 
        def __init__(self, youtube_ie, downloader=None):
@@ -1002,7 +1002,7 @@ class YoutubePlaylistIE(InfoExtractor):
                                        ids_in_page.append(mobj.group(1))
                        video_ids.extend(ids_in_page)
 
-                       if (self._MORE_PAGES_INDICATOR % (playlist_id, pagenum + 1)) not in page:
+                       if (self._MORE_PAGES_INDICATOR % (playlist_id.upper(), pagenum + 1)) not in page:
                                break
                        pagenum = pagenum + 1