fix
This commit is contained in:
1 parent
ac4cdd5d84
commit
5f8df57a6a
2 files changed
+2
-3
No files matched your search
+1
-3
@@ -26,14 +26,12 @@ class ComicsPipeline:
|
|||||||
# 'output/rm_comic/json/壞X/第1話 壞X'
|
# 'output/rm_comic/json/壞X/第1話 壞X'
|
||||||
cbz_path = ComicPath.get_file_path(item, result_type="cbz", convert=True)
|
cbz_path = ComicPath.get_file_path(item, result_type="cbz", convert=True)
|
||||||
if os.path.exists(cbz_path):
|
if os.path.exists(cbz_path):
|
||||||
item['image_urls'] = []
|
item['image_urls'] = item['images'] = []
|
||||||
item['images'] = []
|
|
||||||
return ItemExporter().export_obj(item)
|
return ItemExporter().export_obj(item)
|
||||||
else:
|
else:
|
||||||
file = os.path.join(OUTPUT_DIR, spider.name, "json", item['name'], item['chapter'])
|
file = os.path.join(OUTPUT_DIR, spider.name, "json", item['name'], item['chapter'])
|
||||||
item['count'] = len(item['images'])
|
item['count'] = len(item['images'])
|
||||||
item['index'] = item['chapters'].index(item['chapter']) + 1
|
item['index'] = item['chapters'].index(item['chapter']) + 1
|
||||||
|
|
||||||
return JsonExport(file=file).export_json(item, if_return=True)
|
return JsonExport(file=file).export_json(item, if_return=True)
|
||||||
# image解析
|
# image解析
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ RETRY_ENABLED = True
|
|||||||
RETRY_TIMES = 2 # 想重试几次就写几
|
RETRY_TIMES = 2 # 想重试几次就写几
|
||||||
# 下面这行可要可不要
|
# 下面这行可要可不要
|
||||||
# RETRY_HTTP_CODES = [500, 502, 503, 504, 408, 401]
|
# RETRY_HTTP_CODES = [500, 502, 503, 504, 408, 401]
|
||||||
|
RETRY_HTTP_CODES = [408, 401]
|
||||||
# The download delay setting will honor only one of:
|
# The download delay setting will honor only one of:
|
||||||
CONCURRENT_REQUESTS_PER_DOMAIN = 16
|
CONCURRENT_REQUESTS_PER_DOMAIN = 16
|
||||||
CONCURRENT_REQUESTS_PER_IP = 16
|
CONCURRENT_REQUESTS_PER_IP = 16
|
||||||
|
|||||||
Reference in new issue
Block a user