diff --git a/Comics/pipelines.py b/Comics/pipelines.py index e272fdf..0430340 100644 --- a/Comics/pipelines.py +++ b/Comics/pipelines.py @@ -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解析 diff --git a/Comics/settings.py b/Comics/settings.py index eb0969a..2090e2a 100644 --- a/Comics/settings.py +++ b/Comics/settings.py @@ -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