From 5a8aeade0bc74c240110448bec77834b1cf0becc Mon Sep 17 00:00:00 2001 From: yodhcn <47470844+yodhcn@users.noreply.github.com> Date: Fri, 6 Jan 2023 10:16:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B1=E4=BA=8E=20dlsite?= =?UTF-8?q?=20api=20=E6=9F=90=E4=BA=9B=E4=BD=9C=E5=93=81=E7=9A=84=20"creat?= =?UTF-8?q?ers"=20=E6=B2=A1=E6=9C=89=20"voice=5Fby"=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=80=A0=E6=88=90=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.dlsite.com/maniax/api/=/product.json?workno=RJ276968 --- scraper/scraper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scraper/scraper.py b/scraper/scraper.py index 9e361d4..dd4006d 100644 --- a/scraper/scraper.py +++ b/scraper/scraper.py @@ -76,8 +76,8 @@ def __parse_metadata(self, html: str, rjcode: str): 'maker_id': '', 'maker_name': '', 'release_date': '', - 'series_name': '', - 'series_id': '', + 'series_name': None, + 'series_id': None, 'age_category': '', 'tags': [], 'cvs': [], @@ -184,7 +184,7 @@ def __scrape_metadata_from_product_api(self, rjcode: str): for genre in product_info['genres']: metadata['tags'].append(genre['name']) # cvs - if isinstance(product_info['creaters'], dict): + if isinstance(product_info['creaters'], dict) and 'voice_by' in product_info['creaters']: for cv in product_info['creaters']['voice_by']: metadata['cvs'].append(cv['name'])