[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)) renderer, lambda x: x['lengthText']['simpleText'], compat_str))
view_count_text = try_get( view_count_text = try_get(
renderer, lambda x: x['viewCountText']['simpleText'], compat_str) or '' renderer, lambda x: x['viewCountText']['simpleText'], compat_str) or ''
view_count = int_or_none(self._search_regex( view_count = str_to_int(self._search_regex(
r'^(\d+)', re.sub(r'\s', '', view_count_text), r'^([\d,]+)', re.sub(r'\s', '', view_count_text),
'view count', default=None)) 'view count', default=None))
uploader = try_get( uploader = try_get(
renderer, lambda x: x['ownerText']['runs'][0]['text'], compat_str) renderer, lambda x: x['ownerText']['runs'][0]['text'], compat_str)