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

merge-requests/5/head
Laura 2020-11-16 02:30:08 +01:00
parent 80a5d8d55e
commit c55393ce44
1 changed files with 1 additions and 1 deletions

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'],