From db35986f871957cb345ccffe4921b82019d7eddc Mon Sep 17 00:00:00 2001 From: yoshiko2 Date: Fri, 3 Feb 2023 06:13:57 +0800 Subject: [PATCH] Fix: Data analysis in API --- scraper.py | 7 ++----- scrapinglib/pissplay.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/scraper.py b/scraper.py index 2545336..91fb894 100644 --- a/scraper.py +++ b/scraper.py @@ -100,11 +100,8 @@ def get_data_from_json( # ================================================网站规则添加结束================================================ title = json_data.get('title') - if json_data['source'] =='pissplay': # pissplay actor为英文名,不用去除空格 - actor_list = [json_data.get('actor')] - else: - actor_list = str(json_data.get('actor')).strip("[ ]").replace("'", '').split(',') # 字符串转列表 - actor_list = [actor.strip() for actor in actor_list] # 去除空白 + actor_list = str(json_data.get('actor')).strip("[ ]").replace("'", '').split(',') # 字符串转列表 + actor_list = [actor.strip() for actor in actor_list] # 去除空白 director = json_data.get('director') release = json_data.get('release') number = json_data.get('number') diff --git a/scrapinglib/pissplay.py b/scrapinglib/pissplay.py index 4a779ea..04bc898 100644 --- a/scrapinglib/pissplay.py +++ b/scrapinglib/pissplay.py @@ -76,7 +76,7 @@ class Pissplay(Parser): else: return [tags[0]] else: - return 'Bruce and Morgan' + return ['Bruce and Morgan'] def getOutline(self, htmltree): outline = self.getTreeAll(htmltree, self.expr_outline)