From: Sergey M․ Date: Sat, 21 Nov 2020 13:49:56 +0000 (+0700) Subject: [youtube] Fix like and dislike count extraction (closes #25977) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=46a265a2da26c663463244ecf9a4a699c2cd6efc;p=youtube-dl [youtube] Fix like and dislike count extraction (closes #25977) --- diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 484f79765..fb4c31326 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -2196,8 +2196,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor): def _extract_count(count_name): return str_to_int(self._search_regex( - r'-%s-button[^>]+>]+class="yt-uix-button-content"[^>]*>([\d,]+)' - % re.escape(count_name), + (r'-%s-button[^>]+>]+class="yt-uix-button-content"[^>]*>([\d,]+)' % 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')