summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRicardo Garcia <[email protected]>2010-04-02 19:51:54 +0200
committerRicardo Garcia <[email protected]>2010-10-31 11:26:52 +0100
commitce5cafea407319ce9a69acabeb748563cc0d7db0 (patch)
tree0cea72d5d389770dd0bf14530ed630c05c69d4b3
parentae3fc475eb2ebb0b73a4f70a76a0e8b083b52079 (diff)
downloadyoutube-dl-ce5cafea407319ce9a69acabeb748563cc0d7db0.tar.gz
youtube-dl-ce5cafea407319ce9a69acabeb748563cc0d7db0.zip
Change method to detect end of playlist (fixes issue #113)
-rwxr-xr-xyoutube-dl4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube-dl b/youtube-dl
index 957438b1d..3735c7eac 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -1496,7 +1496,7 @@ class YoutubePlaylistIE(InfoExtractor):
_VALID_URL = r'(?:http://)?(?:\w+\.)?youtube.com/(?:view_play_list|my_playlists)\?.*?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&page=%s'
+ _MORE_PAGES_INDICATOR = r'(?m)>\s*Next\s*</a>'
_youtube_ie = None
def __init__(self, youtube_ie, downloader=None):
@@ -1542,7 +1542,7 @@ class YoutubePlaylistIE(InfoExtractor):
ids_in_page.append(mobj.group(1))
video_ids.extend(ids_in_page)
- if (self._MORE_PAGES_INDICATOR % (playlist_id.upper(), pagenum + 1)) not in page:
+ if re.search(self._MORE_PAGES_INDICATOR, page) is None:
break
pagenum = pagenum + 1