about summary refs log tree commit diff
path: root/youtube_dl/extractor/vk.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-09-29 23:51:52 +0700
committerSergey M․ <dstftw@gmail.com>2016-09-29 23:52:29 +0700
commit70d7b323b6556eb693bec43a1eb10ded889184b0 (patch)
treeea6e4c4ff31f371cc1e8d716dc4460c80dd8cb52 /youtube_dl/extractor/vk.py
parenta7ee8a00f4af9853d06ed895c5023cc6b573fd57 (diff)
downloadyoutube-dl-70d7b323b6556eb693bec43a1eb10ded889184b0.tar.gz
youtube-dl-70d7b323b6556eb693bec43a1eb10ded889184b0.tar.xz
youtube-dl-70d7b323b6556eb693bec43a1eb10ded889184b0.zip
[vk] Improve view count extraction
Diffstat (limited to 'youtube_dl/extractor/vk.py')
-rw-r--r--youtube_dl/extractor/vk.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py
index 77f5cebcf..58799d413 100644
--- a/youtube_dl/extractor/vk.py
+++ b/youtube_dl/extractor/vk.py
@@ -255,6 +255,7 @@ class VKIE(VKBaseIE):
                 'title': 'ИгроМир 2016 — день 1',
                 'uploader': 'Игромания',
                 'duration': 5239,
+                'view_count': int,
             },
         },
         {
@@ -376,14 +377,13 @@ class VKIE(VKBaseIE):
         if data.get('live') == 2:
             title = self._live_title(title)
 
-        # Extract upload date
         timestamp = unified_timestamp(self._html_search_regex(
-            r'class=["\']mv_info_date[^>]*>([^<]+)(?:<|from)', info_page,
+            r'class=["\']mv_info_date[^>]+>([^<]+)(?:<|from)', info_page,
             'upload date', fatal=False))
 
-        view_count = str_to_int(self._html_search_regex(
-            r'class="mv_views_count[^>]*>([\d,.]+)',
-            info_page, 'view count', default=None))
+        view_count = str_to_int(self._search_regex(
+            r'class=["\']mv_views_count[^>]+>\s*([\d,.]+)',
+            info_page, 'view count', fatal=False))
 
         formats = []
         for format_id, format_url in data.items():