1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

Modify "more pages" check in YouTube playlist (fixes issue #29)

This commit is contained in:
Ricardo Garcia 2009-06-09 20:19:29 +02:00
parent 55e7c75e12
commit 113e5266cc

View file

@ -956,7 +956,7 @@ class YoutubePlaylistIE(InfoExtractor):
_VALID_URL = r'(?:http://)?(?:\w+\.)?youtube.com/view_play_list\?p=(.+)' _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' _TEMPLATE_URL = 'http://www.youtube.com/view_play_list?p=%s&page=%s&gl=US&hl=en'
_VIDEO_INDICATOR = r'/watch\?v=(.+?)&' _VIDEO_INDICATOR = r'/watch\?v=(.+?)&'
_MORE_PAGES_INDICATOR = r'/view_play_list?p=%s&page=%s' _MORE_PAGES_INDICATOR = r'/view_play_list?p=%s&page=%s'
_youtube_ie = None _youtube_ie = None
def __init__(self, youtube_ie, downloader=None): def __init__(self, youtube_ie, downloader=None):
@ -1002,7 +1002,7 @@ class YoutubePlaylistIE(InfoExtractor):
ids_in_page.append(mobj.group(1)) ids_in_page.append(mobj.group(1))
video_ids.extend(ids_in_page) 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 break
pagenum = pagenum + 1 pagenum = pagenum + 1