From 158117a66ac8a2d8a9c73a28d09144ee5cc0e310 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 30 Oct 2020 16:22:15 +0100 Subject: [PATCH] Fix non-liked videos --- youtube/video.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube/video.py b/youtube/video.py index 5108193..3297172 100644 --- a/youtube/video.py +++ b/youtube/video.py @@ -43,7 +43,10 @@ def get_info(url): else: video['dislike_count'] = info['dislike_count'] - video['total_likes'] = int(info['dislike_count']) + int(info['like_count']) + try: + video['total_likes'] = int(info['dislike_count']) + int(info['like_count']) + except: + video['total_likes'] = "" video['average_rating'] = str(info['average_rating'])[0:4] video['formats'] = get_video_formats(info['formats']) video['audio_formats'] = get_video_formats(info['formats'], audio=True)