1
0
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-12-17 06:56:42 +00:00

[youtube:tab] fix view_count extraction(closes #27051)

This commit is contained in:
Remita Amine 2020-11-17 20:32:50 +01:00
parent aa613ef7e1
commit 284f8306df

View File

@ -2543,8 +2543,8 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
renderer, lambda x: x['lengthText']['simpleText'], compat_str))
view_count_text = try_get(
renderer, lambda x: x['viewCountText']['simpleText'], compat_str) or ''
view_count = int_or_none(self._search_regex(
r'^(\d+)', re.sub(r'\s', '', view_count_text),
view_count = str_to_int(self._search_regex(
r'^([\d,]+)', re.sub(r'\s', '', view_count_text),
'view count', default=None))
uploader = try_get(
renderer, lambda x: x['ownerText']['runs'][0]['text'], compat_str)