From ff2d8e67d36de1db14a6ebf376a5577dd5ccccdb Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 30 Oct 2020 16:26:23 +0100 Subject: [PATCH] Fix videos without dislikes or likes (#123) --- youtube/video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube/video.py b/youtube/video.py index 3297172..6a07e57 100644 --- a/youtube/video.py +++ b/youtube/video.py @@ -36,15 +36,15 @@ def get_info(url): if(info['like_count'] == None): video['like_count'] = 0 else: - video['like_count'] = info['like_count'] + video['like_count'] = int(info['like_count']) if(info['dislike_count'] == None): video['dislike_count'] = 0 else: - video['dislike_count'] = info['dislike_count'] + video['dislike_count'] = int(info['dislike_count']) try: - video['total_likes'] = int(info['dislike_count']) + int(info['like_count']) + video['total_likes'] = info['dislike_count'] + info['like_count'] except: video['total_likes'] = "" video['average_rating'] = str(info['average_rating'])[0:4]