cobweb-launcher 1.2.41__tar.gz → 1.2.42__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {cobweb-launcher-1.2.41/cobweb_launcher.egg-info → cobweb-launcher-1.2.42}/PKG-INFO +1 -1
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/crawlers/crawler.py +13 -10
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42/cobweb_launcher.egg-info}/PKG-INFO +1 -1
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/setup.py +1 -1
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/LICENSE +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/README.md +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/common_queue.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/decorators.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/item.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/log.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/request.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/response.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/base/seed.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/constant.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/crawlers/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/crawlers/base_crawler.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/crawlers/file_crawler.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/db/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/db/api_db.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/db/redis_db.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/exceptions/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/exceptions/oss_db_exception.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/launchers/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/launchers/launcher.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/launchers/launcher_air.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/launchers/launcher_api.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/launchers/launcher_pro.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/pipelines/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/pipelines/pipeline.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/pipelines/pipeline_console.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/pipelines/pipeline_loghub.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/setting.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/utils/__init__.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/utils/bloom.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/utils/dotting.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/utils/oss.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb/utils/tools.py +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb_launcher.egg-info/SOURCES.txt +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb_launcher.egg-info/dependency_links.txt +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb_launcher.egg-info/requires.txt +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb_launcher.egg-info/top_level.txt +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/setup.cfg +0 -0
- {cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/test/test.py +0 -0
@@ -6,6 +6,7 @@ from inspect import isgenerator
|
|
6
6
|
from typing import Union, Callable, Mapping
|
7
7
|
from urllib.parse import urlparse
|
8
8
|
|
9
|
+
import urllib3
|
9
10
|
from requests import HTTPError, Response as Res
|
10
11
|
|
11
12
|
from cobweb.constant import DealModel, LogTemplate
|
@@ -164,17 +165,19 @@ class Crawler(threading.Thread):
|
|
164
165
|
|
165
166
|
if not iterator_status:
|
166
167
|
raise ValueError("request/download/parse function yield value error!")
|
167
|
-
except HTTPError as e:
|
168
|
-
|
168
|
+
except (HTTPError, urllib3.exceptions.HTTPError, urllib3.exceptions.PoolError) as e:
|
169
|
+
exception_msg = ''.join(traceback.format_exception(type(e), e, e.__traceback__))
|
170
|
+
url = seed.url
|
171
|
+
status = str(e)
|
172
|
+
if getattr(e, "response", None) and isinstance(e.response, Res):
|
169
173
|
url = e.response.request.url
|
170
174
|
status = e.response.status_code
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
)
|
175
|
+
self.loghub_dot.build(
|
176
|
+
topic=urlparse(url).netloc,
|
177
|
+
data_size=-1, cost_time=-1,
|
178
|
+
status=status, url=url,
|
179
|
+
msg=exception_msg
|
180
|
+
)
|
178
181
|
logger.info(LogTemplate.download_exception.format(
|
179
182
|
detail=seed_detail_log_info,
|
180
183
|
retry=seed.params.retry,
|
@@ -185,7 +188,7 @@ class Crawler(threading.Thread):
|
|
185
188
|
))
|
186
189
|
seed.params.retry += 1
|
187
190
|
self._set_seed(seed)
|
188
|
-
time.sleep(self.time_sleep * seed.params.retry)
|
191
|
+
# time.sleep(self.time_sleep * seed.params.retry)
|
189
192
|
except Exception as e:
|
190
193
|
logger.info(LogTemplate.download_exception.format(
|
191
194
|
detail=seed_detail_log_info,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cobweb-launcher-1.2.41 → cobweb-launcher-1.2.42}/cobweb_launcher.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|