This commit is contained in:
caiwx86 2023-09-07 19:51:33 +08:00
parent ac4cdd5d84
commit 5f8df57a6a
2 changed files with 2 additions and 3 deletions

View File

@ -26,14 +26,12 @@ class ComicsPipeline:
# 'output/rm_comic/json/壞X/第1話 壞X'
cbz_path = ComicPath.get_file_path(item, result_type="cbz", convert=True)
if os.path.exists(cbz_path):
item['image_urls'] = []
item['images'] = []
item['image_urls'] = item['images'] = []
return ItemExporter().export_obj(item)
else:
file = os.path.join(OUTPUT_DIR, spider.name, "json", item['name'], item['chapter'])
item['count'] = len(item['images'])
item['index'] = item['chapters'].index(item['chapter']) + 1
return JsonExport(file=file).export_json(item, if_return=True)
# image解析

View File

@ -39,6 +39,7 @@ RETRY_ENABLED = True
RETRY_TIMES = 2 # 想重试几次就写几
# 下面这行可要可不要
# RETRY_HTTP_CODES = [500, 502, 503, 504, 408, 401]
RETRY_HTTP_CODES = [408, 401]
# The download delay setting will honor only one of:
CONCURRENT_REQUESTS_PER_DOMAIN = 16
CONCURRENT_REQUESTS_PER_IP = 16