def __init__(self, status: bool, cookies: dict or str, **kwargs): # -*- Assign the based information -*- self.status = status try: self.cookies = cookies_raw2jar(cookies) if isinstance(cookies, str) else cookies except ValueError: # Empty raw_cookies will raise ValueError (,see utils.cookie ) logging.critical("Empty cookies, Not allowed to active Model \"{}\"".format(self.model_name())) self.status = False else: if self.status: logging.debug("Model \"{}\" is activation now.".format(self.model_name())) else: logging.info("Model \"{}\" isn't active due to your settings.".format(self.model_name())) # -*- Assign Enhanced Features : Site -*- """ Enhance Feature for `base` Reseeder. Those key-values will be set as default value unless you change it in your user-settings. The name of those key should be start with "_" and upper. Included: 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. """ self._EXTEND_DESCR_BEFORE = kwargs.setdefault("extend_descr_before", True) self._EXTEND_DESCR_THUMBNAILS = kwargs.setdefault("extend_descr_thumbnails", True) self._EXTEND_DESCR_MEDIAINFO = kwargs.setdefault("extend_descr_mediainfo", True) self._EXTEND_DESCR_CLONEINFO = kwargs.setdefault("extend_descr_cloneinfo", True) self._ASSIST_ONLY = kwargs.setdefault("assist_only", False) # Check Site Online Status if self.status: self.online_check()
def __init__(self, status: bool, cookies: dict or str, **kwargs): self.name = type(self).__name__ # -*- Assign the based information -*- self.status = status try: self.cookies = cookies_raw2jar(cookies) if isinstance(cookies, str) else cookies except ValueError: # Empty raw_cookies will raise ValueError (,see utils.cookie ) Logger.critical("Empty cookies, Not allowed to active Model \"{}\"".format(self.name)) self.status = False # -*- Assign Enhanced Features : Site -*- """ Enhance Feature for `base` Reseeder. Those key-values will be set as default value unless you change it in your user-settings. The name of those key should be start with "_" and upper. Included: 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. """ self._EXTEND_DESCR_BEFORE = kwargs.setdefault("extend_descr_before", True) self._EXTEND_DESCR_THUMBNAILS = kwargs.setdefault("extend_descr_thumbnails", True) self._EXTEND_DESCR_MEDIAINFO = kwargs.setdefault("extend_descr_mediainfo", True) 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) # Check Site Online Status if self.status: Logger.debug("Model \"{}\" is activation now.".format(self.name)) self.online_check() else: Logger.info("Model \"{}\" isn't active due to your settings.".format(self.name))
def __init__(self, site_setting: dict): self.site_setting = site_setting self.status = site_setting["status"] self.passkey = site_setting["passkey"] self.cookies = cookies_raw2jar(site_setting["cookies"]) try: self.auto_thank = site_setting["auto_thank"] if not site_setting["anonymous_release"]: self.uplver = "no" except KeyError: pass if self.status and self.online_check(): self.session_check()
def __init__(self, status: bool, cookies: dict or str, **kwargs): self.name = type(self).__name__ # -*- Assign the based information -*- self.status = status try: self.cookies = cookies_raw2jar(cookies) if isinstance(cookies, str) else cookies except ValueError: # Empty raw_cookies will raise ValueError (,see utils.cookie ) Logger.critical("Empty cookies, Not allowed to active Model \"{}\"".format(self.name)) self.status = False # -*- Assign Enhanced Features : Site -*- self.config = kwargs """ Enhance Feature for `base` Reseeder. Those key-values will be set as default value unless you change it in your user-settings. The name of those key should be start with "_" and upper. Included: 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) self._EXTEND_DESCR_MEDIAINFO = kwargs.setdefault("extend_descr_mediainfo", True) 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) self._AUTO_RENEW_COOKIES = kwargs.setdefault('auto_renew_cookies', False) # Check Site Online Status if self.status: Logger.debug("Model \"{}\" is activation now.".format(self.name)) self.online_check() else: Logger.info("Model \"{}\" isn't active due to your settings.".format(self.name))