From 5e14726bca230e975a167dbbd9657bf0001a5b79 Mon Sep 17 00:00:00 2001 From: Rhilip Date: Wed, 25 Sep 2019 09:39:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(Base):=20=E5=A2=9E=E5=8A=A0=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E4=B8=8D=E5=9C=A8=E7=BA=BF=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extractors/base/site.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extractors/base/site.py b/extractors/base/site.py index 55df591..791ba71 100644 --- a/extractors/base/site.py +++ b/extractors/base/site.py @@ -46,6 +46,8 @@ def __init__(self, status: bool, cookies: dict or str, **kwargs): 1. _EXTEND_DESCR_* : default True, Enable to Enhanced the description of the reseed torrent, And its priority is higher than setting.extend_descr_raw[key]["status"]. 2. _ASSIST_ONLY : default False, Enable to only assist the exist same torrent but not to reseed. + 3. _ASSIST_DELAY_TIME : default 0, Delay reseed check time + 4. _PASS_ONLINE_CHECK : default false, Pass the online check """ self._EXTEND_DESCR_BEFORE = kwargs.setdefault("extend_descr_before", True) self._EXTEND_DESCR_THUMBNAILS = kwargs.setdefault("extend_descr_thumbnails", True) @@ -53,6 +55,7 @@ def __init__(self, status: bool, cookies: dict or str, **kwargs): self._EXTEND_DESCR_CLONEINFO = kwargs.setdefault("extend_descr_cloneinfo", True) self._ASSIST_ONLY = kwargs.setdefault("assist_only", False) self._ASSIST_DELAY_TIME = kwargs.setdefault("assist_delay_time", 0) + self._PASS_ONLINE_CHECK = kwargs.setdefault('pass_online_check', False) # Check Site Online Status if self.status: @@ -67,6 +70,9 @@ def online_check(self) -> bool: :return: bool , True if online """ + if self._PASS_ONLINE_CHECK: + return True + try: requests.get(self.url_host, timeout=setting.REQUESTS_TIMEOUT) except OSError: # requests.exceptions.RequestException