summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRicardo Garcia <[email protected]>2009-08-15 00:33:50 +0200
committerRicardo Garcia <[email protected]>2010-10-31 11:24:48 +0100
commit304a4d85ea468fb2a39a7357cb28b64506246d42 (patch)
treebc7ac7a9c000942350e04c6eb2098b5fb918d275
parentd89977437718619a057028566b1e901ea963193e (diff)
downloadyoutube-dl-304a4d85ea468fb2a39a7357cb28b64506246d42.tar.gz
youtube-dl-304a4d85ea468fb2a39a7357cb28b64506246d42.zip
Modify _MORE_PAGES_INDICATOR for searches (fixes issue #41)
-rwxr-xr-xyoutube-dl4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube-dl b/youtube-dl
index 50b9197f2..becf1d25d 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -879,7 +879,7 @@ class YoutubeSearchIE(InfoExtractor):
_VALID_QUERY = r'ytsearch(\d+|all)?:[\s\S]+'
_TEMPLATE_URL = 'http://www.youtube.com/results?search_query=%s&page=%s&gl=US&hl=en'
_VIDEO_INDICATOR = r'href="/watch\?v=.+?"'
- _MORE_PAGES_INDICATOR = r'>Next</a>'
+ _MORE_PAGES_INDICATOR = r'(?m)>\s*Next\s*</a>'
_youtube_ie = None
_max_youtube_results = 1000
@@ -956,7 +956,7 @@ class YoutubeSearchIE(InfoExtractor):
self._youtube_ie.extract('http://www.youtube.com/watch?v=%s' % id)
return
- if self._MORE_PAGES_INDICATOR not in page:
+ if re.search(self._MORE_PAGES_INDICATOR, page) is None:
for id in video_ids:
self._youtube_ie.extract('http://www.youtube.com/watch?v=%s' % id)
return