fix DailyMotion official users videos - closes #281 - by @yvestan
authorFilippo Valsorda <filippo.valsorda@gmail.com>
Wed, 7 Nov 2012 13:44:10 +0000 (14:44 +0100)
committerFilippo Valsorda <filippo.valsorda@gmail.com>
Wed, 7 Nov 2012 13:44:10 +0000 (14:44 +0100)
youtube_dl/InfoExtractors.py

index a5c8b91341079a8d02aab6955ca7edd6761a63bd..cfaef29045d95d45fbf7a8baf0b70874e881d0d7 100644 (file)
@@ -694,7 +694,12 @@ class DailymotionIE(InfoExtractor):
                video_uploader = u'NA'
                mobj = re.search(r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a>', webpage)
                if mobj is None:
-                       self._downloader.trouble(u'WARNING: unable to extract uploader nickname')
+                       # lookin for official user
+                       mobj_official = re.search(r'<span rel="author"[^>]+?>([^<]+?)</span>', webpage)
+                       if mobj_official is None:
+                               self._downloader.trouble(u'WARNING: unable to extract uploader nickname')
+                       else:
+                               video_uploader = mobj_official.group(1)
                else:
                        video_uploader = mobj.group(1)