From b84dc6dcc4b40f53cbf7601a54fd7d2556e83cdf Mon Sep 17 00:00:00 2001 From: pluja Date: Wed, 4 Nov 2020 08:28:14 +0100 Subject: [PATCH] Fix Error on videos with no likes/dislikes Error 500 was displayed on some videos which had 0 likes or 0 dislikes, as the returned type was None. It was already treated but not used --- youtube/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube/video.py b/youtube/video.py index 7a3ae83..41d1e69 100644 --- a/youtube/video.py +++ b/youtube/video.py @@ -43,7 +43,7 @@ def get_info(url): else: video['dislike_count'] = int(info['dislike_count']) - video['total_likes'] = info['dislike_count'] + info['like_count'] + video['total_likes'] = video['dislike_count'] + video['like_count'] video['average_rating'] = str(info['average_rating'])[0:4] video['formats'] = get_video_formats(info['formats'])