Merge pull request #933 from mark5231/hotfix-cover

替换javdb封面
This commit is contained in:
Yoshiko2
2022-11-29 01:32:54 +08:00
committed by GitHub

View File

@@ -179,15 +179,22 @@ class Scraping:
if 'source' in json_data and json_data['source'] == 'javdb': if 'source' in json_data and json_data['source'] == 'javdb':
# search other sources # search other sources
other_sources = sources[sources.index('javdb') + 1:] other_sources = sources[sources.index('javdb') + 1:]
# If cover not found in other source, then skip using other sources using javdb cover while other_sources:
try: # If cover not found in other source, then skip using other sources using javdb cover instead
json_data_other = self.searchAdult(number, other_sources) try:
if json_data_other is not None: other_json_data = self.searchAdult(number, other_sources)
json_data['cover'] = json_data_other['cover'] if other_json_data is not None and 'cover' in other_json_data and other_json_data['cover'] != '':
if self.debug: json_data['cover'] = other_json_data['cover']
print(f"[+]Find movie [{number}] cover on website '{json_data_other['cover']}'") if self.debug:
except: print(f"[+]Find movie [{number}] cover on website '{other_json_data['cover']}'")
pass break
# 当不知道source为何时只能停止搜索
if 'source' not in other_json_data:
break
# check other sources
other_sources = sources[sources.index(other_json_data['source']) + 1:]
except:
pass
# Return if data not found in all sources # Return if data not found in all sources
if not json_data: if not json_data: