when no source

This commit is contained in:
Marks
2022-11-25 20:41:02 -08:00
parent ab7eea1e02
commit e73eb6ae89

View File

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