[keek] Improve uploader fields regexes
authorSergey M․ <dstftw@gmail.com>
Sun, 27 Sep 2015 19:15:13 +0000 (01:15 +0600)
committerSergey M․ <dstftw@gmail.com>
Sun, 27 Sep 2015 19:15:13 +0000 (01:15 +0600)
youtube_dl/extractor/keek.py

index dff4cb558d3b355aa6c3727ac927698029b1a9e2..dfd800a9180fa3fed5efe77adcf7d6512208fea9 100644 (file)
@@ -30,6 +30,10 @@ class KeekIE(InfoExtractor):
             'ext': 'mp4',
             'title': self._og_search_description(webpage),
             'thumbnail': self._og_search_thumbnail(webpage),
-            'uploader': self._search_regex(r'data-username="([^"]+)"', webpage, 'uploader', fatal=False),
-            'uploader_id': self._search_regex(r'data-user-id="([^"]+)"', webpage, 'uploader id', fatal=False),
+            'uploader': self._search_regex(
+                r'data-username=(["\'])(?P<uploader>.+?)\1', webpage,
+                'uploader', fatal=False, group='uploader'),
+            'uploader_id': self._search_regex(
+                r'data-user-id=(["\'])(?P<uploader_id>.+?)\1', webpage,
+                'uploader id', fatal=False, group='uploader_id'),
         }