From 818be8c35d40e4fc8f51e63b5717be145fc46bcc Mon Sep 17 00:00:00 2001 From: girst Date: Fri, 14 Aug 2020 18:20:55 +0200 Subject: [PATCH] sometimes videoDetails.lengthSeconds=="0" microformat.playerMicroformatRenderer.lengthSeconds might still be good then. seen on 'premiere' videos. --- app/common/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/common.py b/app/common/common.py index fbaa2b6..67d0482 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -289,7 +289,7 @@ def video_metadata(metadata): 'author': meta1['author'], 'channel_id': meta1['channelId'], 'published': published_at, - 'views': int(meta1['viewCount']), + 'views': int(meta1['viewCount']) or int(meta2['lengthSeconds']), 'length': int(meta1['lengthSeconds']), 'livestream': meta1['isLiveContent'], } -- 2.39.3