diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2013-12-06 13:36:36 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2013-12-06 13:36:36 +0100 |
commit | f53c966a73df42a9a949912ef8ab99a64fb99466 (patch) | |
tree | cad9af28cebceabf24ef90085f31b0942e4773f5 /youtube_dl/extractor/dailymotion.py | |
parent | 336c3a69bd198130e2f65f14dfc83383fec7c5e2 (diff) | |
download | youtube-dl-f53c966a73df42a9a949912ef8ab99a64fb99466.tar.gz youtube-dl-f53c966a73df42a9a949912ef8ab99a64fb99466.zip |
[dailymotion] Extract view count (#1895)
Diffstat (limited to 'youtube_dl/extractor/dailymotion.py')
-rw-r--r-- | youtube_dl/extractor/dailymotion.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py index 71f5e03ee..3756cf765 100644 --- a/youtube_dl/extractor/dailymotion.py +++ b/youtube_dl/extractor/dailymotion.py @@ -11,6 +11,7 @@ from ..utils import ( get_element_by_attribute, get_element_by_id, orderedSet, + str_to_int, ExtractorError, ) @@ -146,6 +147,9 @@ 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')) + return { 'id': video_id, 'formats': formats, @@ -155,6 +159,7 @@ class DailymotionIE(DailymotionBaseInfoExtractor, SubtitlesInfoExtractor): 'subtitles': video_subtitles, 'thumbnail': info['thumbnail_url'], 'age_limit': age_limit, + 'view_count': view_count, } def _get_available_subtitles(self, video_id, webpage): |