Fixed javdb while loop
This commit is contained in:
@@ -149,23 +149,16 @@ class Scraping:
|
|||||||
# javdb的封面有水印,如果可以用其他源的封面来替换javdb的封面
|
# javdb的封面有水印,如果可以用其他源的封面来替换javdb的封面
|
||||||
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:]
|
# If cover not found in other source, then skip using other sources using javdb cover instead
|
||||||
while other_sources:
|
try:
|
||||||
# If cover not found in other source, then skip using other sources using javdb cover instead
|
other_sources = sources[sources.index('javdb') + 1:]
|
||||||
try:
|
other_json_data = self.searchAdult(number, other_sources)
|
||||||
other_json_data = self.searchAdult(number, other_sources)
|
if other_json_data is not None and 'cover' in other_json_data and other_json_data['cover'] != '':
|
||||||
if other_json_data is not None and 'cover' in other_json_data and other_json_data['cover'] != '':
|
json_data['cover'] = other_json_data['cover']
|
||||||
json_data['cover'] = other_json_data['cover']
|
if self.debug:
|
||||||
if self.debug:
|
print(f"[+]Find movie [{number}] cover on website '{other_json_data['cover']}'")
|
||||||
print(f"[+]Find movie [{number}] cover on website '{other_json_data['cover']}'")
|
except:
|
||||||
break
|
pass
|
||||||
# 当不知道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 or json_data['title'] == "":
|
if not json_data or json_data['title'] == "":
|
||||||
|
|||||||
Reference in New Issue
Block a user