[dailymotion] Fix view count extraction and make it non fatal (fixes #1940)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 10 Dec 2013 18:47:00 +0000 (19:47 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 10 Dec 2013 18:47:00 +0000 (19:47 +0100)
youtube_dl/extractor/dailymotion.py

index 7f2f0d6a475d45940f0f23acca1f312185c5a561..aea7e557e85457b0526812afb37c46f249e35826 100644 (file)
@@ -143,8 +143,10 @@ class DailymotionIE(DailymotionBaseInfoExtractor, SubtitlesInfoExtractor):
             self._list_available_subtitles(video_id, webpage)
             return
 
-        view_count = str_to_int(self._search_regex(
-            r'video_views_value[^>]+>([\d\.,]+)<', webpage, u'view count'))
+        view_count = self._search_regex(
+            r'video_views_count[^>]+>\s+([\d\.,]+)', webpage, u'view count', fatal=False)
+        if view_count is not None:
+            view_count = str_to_int(view_count)
 
         return {
             'id':       video_id,