[youtube] fix channel/search on videos with no views

This commit is contained in:
Laura 2020-11-16 02:30:08 +01:00
parent 80a5d8d55e
commit c55393ce44

View file

@ -2267,7 +2267,7 @@ class YoutubeBaseListInfoExtractor(YoutubeBaseInfoExtractor):
lambda x: parse_duration(x['thumbnailOverlays'][0]['thumbnailOverlayTimeStatusRenderer']['text']['simpleText']),
], expected_type=float),
'view_count': try_get(entry, [
lambda x: int(x['viewCountText']['simpleText'][:-len(' views')].replace(",", "")),
lambda x: int_or_none(x['viewCountText']['simpleText'][:-len(' views')].replace(',', '').replace('No', '0')),
], expected_type=int),
'channel': try_get(entry, [
lambda x: x['shortBylineText']['runs'][0]['text'],