From 3c34ab8e20cbd29f7c77b4a5e4cf7c189a200cd8 Mon Sep 17 00:00:00 2001 From: doubaniux Date: Thu, 18 Feb 2021 16:07:51 +0100 Subject: [PATCH] change scraper empty value --- common/scraper.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/scraper.py b/common/scraper.py index 2075c69b..2c1f323e 100644 --- a/common/scraper.py +++ b/common/scraper.py @@ -969,10 +969,14 @@ class ImdbMovieScraper(AbstractScraper): showtime = None other_info = {} - other_info['分级'] = res_data['contentRating'] if res_data['contentRating'] else None - other_info['IMDb评分'] = res_data['imDbRating'] if res_data['imDbRating'] else None - other_info['Metacritic评分'] = res_data['metacriticRating'] if res_data['metacriticRating'] else None - other_info['奖项'] = res_data['awards'] if res_data['awards'] else None + if res_data['contentRating']: + other_info['分级'] = res_data['contentRating'] + if res_data['imDbRating']: + other_info['IMDb评分'] = res_data['imDbRating'] + if res_data['metacriticRating']: + other_info['Metacritic评分'] = res_data['metacriticRating'] + if res_data['awards']: + other_info['奖项'] = res_data['awards'] raw_img, ext = self.download_image(res_data['image'])