[youtube] Fix like and dislike count extraction (closes #25977)

pull/27143/head
Sergey M․ 4 years ago
parent e2096776b9
commit 46a265a2da
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

@ -2196,8 +2196,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
def _extract_count(count_name):
return str_to_int(self._search_regex(
r'-%s-button[^>]+><span[^>]+class="yt-uix-button-content"[^>]*>([\d,]+)</span>'
% re.escape(count_name),
(r'-%s-button[^>]+><span[^>]+class="yt-uix-button-content"[^>]*>([\d,]+)</span>' % re.escape(count_name),
r'["\']label["\']\s*:\s*["\']([\d,.]+)\s+%ss["\']' % re.escape(count_name)),
video_webpage, count_name, default=None))
like_count = _extract_count('like')

Loading…
Cancel
Save