1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-22 14:52:52 +08:00

Fix redtube view count and upload date extraction

This commit is contained in:
Yoav Shai 2019-10-05 13:13:27 +03:00
parent b99b0bcfa0
commit 3ecdebc878

View File

@ -88,15 +88,13 @@ class RedTubeIE(InfoExtractor):
thumbnail = self._og_search_thumbnail(webpage)
upload_date = unified_strdate(self._search_regex(
r'<span[^>]+>ADDED ([^<]+)<',
r'"uploadDate":"([^"]+)"',
webpage, 'upload date', fatal=False))
duration = int_or_none(self._og_search_property(
'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(
(r'<div[^>]*>Views</div>\s*<div[^>]*>\s*([\d,.]+)',
r'<span[^>]*>VIEWS</span>\s*</td>\s*<td>\s*([\d,.]+)'),
webpage, 'view count', fatal=False))
r'"interactionCount":(\d+)', webpage, 'view count', fatal=False))
# No self-labeling, but they describe themselves as
# "Home of Videos Porno"