diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-23 03:06:50 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-23 03:06:50 +0200 |
commit | ef926e3842f085f7addfab5885e8315db8102422 (patch) | |
tree | 4c1eae844db712ed47c50a4c76518476b86e1742 /module | |
parent | Boring code cosmetics (3) (diff) | |
download | pyload-ef926e3842f085f7addfab5885e8315db8102422.tar.xz |
[SimpleCrypter] check_errors
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index a404e47f6..0fbc5ed69 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -11,7 +11,7 @@ from module.plugins.internal.utils import replace_patterns, set_cookie, set_cook class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.76" + __version__ = "0.77" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -75,9 +75,7 @@ class SimpleCrypter(Crypter): WAIT_PATTERN = None PREMIUM_ONLY_PATTERN = None - HAPPY_HOUR_PATTERN = None IP_BLOCKED_PATTERN = None - DL_LIMIT_PATTERN = None SIZE_LIMIT_PATTERN = None ERROR_PATTERN = None @@ -130,13 +128,13 @@ class SimpleCrypter(Crypter): #@TODO: Remove in 0.4.10 def setup_base(self): - class_name = self.classname.rsplit("Folder", 1)[0] + account_name = self.classname.rsplit("Folder", 1)[0] if self.account: - self.req = self.pyload.requestFactory.getRequest(class_name, self.account.user) + self.req = self.pyload.requestFactory.getRequest(account_name, self.account.user) self.premium = self.account.info['data']['premium'] #@NOTE: Avoid one unnecessary get_info call by `self.account.premium` here else: - self.req = self.pyload.requestFactory.getRequest(class_name) + self.req = self.pyload.requestFactory.getRequest(account_name) self.premium = False super(SimpleCrypter, self).setup_base() @@ -218,6 +216,7 @@ class SimpleCrypter(Crypter): if not self.urls and not self.packages: self.preload() + self.check_errors() self.urls.extend(self.get_links()) @@ -277,7 +276,7 @@ class SimpleCrypter(Crypter): for p in xrange(2, pages + 1): self.html = self.load_page(p) - self.urls.append(self.get_links()) + self.urls.extend(self.get_links()) def check_errors(self): @@ -295,27 +294,6 @@ class SimpleCrypter(Crypter): elif self.SIZE_LIMIT_PATTERN and re.search(self.SIZE_LIMIT_PATTERN, self.html): self.fail(_("Link list too large for free decrypt")) - elif self.DL_LIMIT_PATTERN and re.search(self.DL_LIMIT_PATTERN, self.html): - m = re.search(self.DL_LIMIT_PATTERN, self.html) - try: - errmsg = m.group(1).strip() - - except (AttributeError, IndexError): - errmsg = m.group(0).strip() - - finally: - errmsg = re.sub(r'<.*?>', " ", errmsg) - - self.info['error'] = errmsg - self.log_warning(errmsg) - - wait_time = parse_time(errmsg) - self.wait(wait_time, reconnect=wait_time > self.get_config("max_wait", 10) * 60) - self.restart(_("Download limit exceeded")) - - if self.HAPPY_HOUR_PATTERN and re.search(self.HAPPY_HOUR_PATTERN, self.html): - self.multiDL = True - if self.ERROR_PATTERN: m = re.search(self.ERROR_PATTERN, self.html) if m is not None: |