Skip to content

Commit

Permalink
修复由于 dlsite api 某些作品的 "creaters" 没有 "voice_by" 数据造成的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yodhcn committed Jan 6, 2023
1 parent 31ed36e commit 5a8aead
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': [],
Expand Down Expand Up @@ -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'])

Expand Down

0 comments on commit 5a8aead

Please sign in to comment.