[dailymotion] Fix user playlist extraction
authorSergey M․ <dstftw@gmail.com>
Wed, 23 Apr 2014 12:42:34 +0000 (19:42 +0700)
committerSergey M․ <dstftw@gmail.com>
Wed, 23 Apr 2014 12:42:34 +0000 (19:42 +0700)
youtube_dl/extractor/dailymotion.py

index c759b98893c92d5e78e1af5c1fb3b8aff1fece92..55216201fe7f137747ad4ac24137b8fe54494d72 100644 (file)
@@ -11,8 +11,8 @@ from ..utils import (
     orderedSet,
     str_to_int,
     int_or_none,
-
     ExtractorError,
+    unescapeHTML,
 )
 
 class DailymotionBaseInfoExtractor(InfoExtractor):
@@ -188,7 +188,7 @@ class DailymotionPlaylistIE(DailymotionBaseInfoExtractor):
             webpage = self._download_webpage(request,
                                              id, u'Downloading page %s' % pagenum)
 
-            video_ids.extend(re.findall(r'data-id="(.+?)"', webpage))
+            video_ids.extend(re.findall(r'data-xid="(.+?)"', webpage))
 
             if re.search(self._MORE_PAGES_INDICATOR, webpage) is None:
                 break
@@ -217,9 +217,9 @@ class DailymotionUserIE(DailymotionPlaylistIE):
         mobj = re.match(self._VALID_URL, url)
         user = mobj.group('user')
         webpage = self._download_webpage(url, user)
-        full_user = self._html_search_regex(
-            r'<a class="label" href="/%s".*?>(.*?)</' % re.escape(user),
-            webpage, u'user', flags=re.DOTALL)
+        full_user = unescapeHTML(self._html_search_regex(
+            r'<a class="nav-image" title="([^"]+)" href="/%s">' % re.escape(user),
+            webpage, u'user', flags=re.DOTALL))
 
         return {
             '_type': 'playlist',