[youtube] Fix like and dislike count extraction (closes #25977)
authorSergey M․ <dstftw@gmail.com>
Sat, 21 Nov 2020 13:49:56 +0000 (20:49 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 21 Nov 2020 13:49:56 +0000 (20:49 +0700)
youtube_dl/extractor/youtube.py

index 484f79765cf1b4a14947d69c1138a767ffc22de6..fb4c31326863bbbf72457d328990b614774e2ce8 100644 (file)
@@ -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')