From 5a909e20a91e37baa0c4bf200e225b90e8acaadb Mon Sep 17 00:00:00 2001 From: Marks Date: Tue, 22 Nov 2022 14:32:04 -0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2javdb=E7=9A=84=E5=B0=81?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scrapinglib/api.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scrapinglib/api.py b/scrapinglib/api.py index 953aca1..454a157 100644 --- a/scrapinglib/api.py +++ b/scrapinglib/api.py @@ -147,6 +147,8 @@ class Scraping: def searchAdult(self, number, sources): if self.specifiedSource: sources = [self.specifiedSource] + elif type(sources) is list: + pass else: sources = self.checkAdultSources(sources, number) json_data = {} @@ -171,7 +173,17 @@ class Scraping: break except: continue - + + # javdb的封面有水印,如果可以用其他源的封面来替换javdb的封面 + if json_data['source'] == 'javdb': + other_sources = sources[sources.index('javdb') + 1:] + # search other sources + json_data_other = self.searchAdult(number, other_sources) + if json_data_other is not None: + json_data['cover'] = json_data_other['cover'] + if self.debug: + print(f"[+]Find movie [{number}] cover on website '{json_data_other['cover']}'") + # Return if data not found in all sources if not json_data: print(f'[-]Movie Number [{number}] not found!')