summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <[email protected]>2013-12-10 19:47:00 +0100
committerJaime Marquínez Ferrándiz <[email protected]>2013-12-10 19:47:00 +0100
commit5458b4cefbfff4b419f22ad33fbaffda25b83382 (patch)
tree332f99e99bccd8fc7d84e97d02402e3b407de04e
parent7c86cd5ab1c8e9091c42eaae7354520a708f7431 (diff)
downloadyoutube-dl-5458b4cefbfff4b419f22ad33fbaffda25b83382.tar.gz
youtube-dl-5458b4cefbfff4b419f22ad33fbaffda25b83382.zip
[dailymotion] Fix view count extraction and make it non fatal (fixes #1940)
-rw-r--r--youtube_dl/extractor/dailymotion.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py
index 7f2f0d6a4..aea7e557e 100644
--- a/youtube_dl/extractor/dailymotion.py
+++ b/youtube_dl/extractor/dailymotion.py
@@ -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,