- using common helper method for property

- readded fallback
This commit is contained in:
carsten demming 2018-02-21 00:07:38 +01:00
parent 2bae0435a8
commit 81d50228b8

View File

@ -90,8 +90,9 @@ class RedTubeIE(InfoExtractor):
upload_date = unified_strdate(self._search_regex( upload_date = unified_strdate(self._search_regex(
r'<span[^>]+>ADDED ([^<]+)<', r'<span[^>]+>ADDED ([^<]+)<',
webpage, 'upload date', fatal=False)) webpage, 'upload date', fatal=False))
duration = int_or_none(self._search_regex( duration = int_or_none(self._og_search_property(
'<meta.*property="og:video:duration".*content="(.*)".*\/>', webpage, 'duration', default=None)) 'video:duration', webpage, default=None) or self._search_regex(
r'videoDuration\s*:\s*(\d+)', webpage, 'duration', default=None))
view_count = str_to_int(self._search_regex( view_count = str_to_int(self._search_regex(
(r'<div[^>]*>Views</div>\s*<div[^>]*>\s*([\d,.]+)', (r'<div[^>]*>Views</div>\s*<div[^>]*>\s*([\d,.]+)',
r'<span[^>]*>VIEWS</span>\s*</td>\s*<td>\s*([\d,.]+)'), r'<span[^>]*>VIEWS</span>\s*</td>\s*<td>\s*([\d,.]+)'),