diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-05 23:08:44 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-05 23:08:44 +0100 |
commit | 5a23de6f32dc99960cccd634d2fd2cc47c34be2a (patch) | |
tree | 0e2f303aa2d2309dd19586ee9badc9b857941668 | |
parent | [DodanePl] Typo fixup (diff) | |
download | pyload-5a23de6f32dc99960cccd634d2fd2cc47c34be2a.tar.xz |
Code cosmetics about checkErrors
-rw-r--r-- | module/plugins/hoster/BezvadataCz.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/DateiTo.py | 20 | ||||
-rw-r--r-- | module/plugins/hoster/FastshareCz.py | 10 | ||||
-rw-r--r-- | module/plugins/hoster/FilerNet.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/FshareVn.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/GigapetaCom.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/Keep2shareCc.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 1 | ||||
-rw-r--r-- | module/plugins/hoster/UploadheroCom.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 2 |
11 files changed, 35 insertions, 19 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index cefa04e9e..d89616c86 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -83,6 +83,8 @@ class BezvadataCz(SimpleHoster): elif '<div class="infobox' in self.html: self.tempOffline() + self.info.pop('error', None) + def loadcaptcha(self, data, *args, **kwargs): return data.decode("base64") diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 683c6b75d..e4bff8458 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -18,12 +18,13 @@ class DateiTo(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</' - SIZE_PATTERN = r'Dateigröße:</td>\s*<td colspan="2">(?P<S>.*?)</' + NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</' + SIZE_PATTERN = r'Dateigröße:</td>\s*<td colspan="2">(?P<S>.*?)</' OFFLINE_PATTERN = r'>Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' - PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' - WAIT_PATTERN = r'countdown\({seconds: (\d+)' + WAIT_PATTERN = r'countdown\({seconds: (\d+)' + MULTIDL_PATTERN = r'>Du lädst bereits eine Datei herunter<' + DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' @@ -55,16 +56,19 @@ class DateiTo(SimpleHoster): else: self.fail(_("Too bad...")) - download_url = self.html - self.download(download_url) + self.download(self.html) def checkErrors(self): - m = re.search(self.PARALELL_PATTERN, self.html) + m = re.search(self.MULTIDL_PATTERN, self.html) if m: m = re.search(self.WAIT_PATTERN, self.html) wait_time = int(m.group(1)) if m else 30 - self.retry(wait_time=wait_time) + + errmsg = self.info['error'] = _("Parallel downloads") + self.retry(wait_time=wait_time, reason=errmsg) + + self.info.pop('error', None) def doWait(self): diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 8b01b5edd..1f1e9e6ee 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -35,14 +35,16 @@ class FastshareCz(SimpleHoster): def checkErrors(self): if self.SLOT_ERROR in self.html: - e = self.info['error'] = _("No free slots") - self.retry(12, 60, e) + errmsg = self.info['error'] = _("No free slots") + self.retry(12, 60, errmsg) if self.CREDIT_ERROR in self.html: - e = self.info['error'] = _("Not enough traffic left") - self.logWarning(e) + errmsg = self.info['error'] = _("Not enough traffic left") + self.logWarning(errmsg) self.resetAccount() + self.info.pop('error', None) + def handleFree(self): m = re.search(self.FREE_URL_PATTERN, self.html) diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 2b98788bb..c943a076d 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -37,7 +37,10 @@ class FilerNet(SimpleHoster): # Wait between downloads m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html) if m: - self.retry(wait_time=int(m.group(1)), reason=_("Wait between free downloads")) + errmsg = self.info['error'] = _("Wait between free downloads") + self.retry(wait_time=int(m.group(1)), reason=errmsg) + + self.info.pop('error', None) def handleFree(self): diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 2ab65ae99..3c230bbe2 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -112,6 +112,8 @@ class FshareVn(SimpleHoster): self.logError(msg) self.retry(30, 2 * 60, msg) + self.info.pop('error', None) + def checkDownloadedFile(self): # check download diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index c015b8ac3..37af7f216 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -61,5 +61,7 @@ class GigapetaCom(SimpleHoster): self.wait(5 * 60, True) self.retry() + self.info.pop('error', None) + getInfo = create_getInfo(GigapetaCom) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py index 7ca29701a..cb5e65a29 100644 --- a/module/plugins/hoster/Keep2shareCc.py +++ b/module/plugins/hoster/Keep2shareCc.py @@ -49,8 +49,8 @@ class Keep2shareCc(SimpleHoster): m = re.search(self.ERROR_PATTERN, self.html) if m: - e = self.info['error'] = m.group(1) - self.error(e) + errmsg = self.info['error'] = m.group(1) + self.error(errmsg) m = re.search(self.WAIT_PATTERN, self.html) if m: diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index d52328fd6..1cb651b12 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -160,6 +160,7 @@ class ShareonlineBiz(SimpleHoster): def checkErrors(self): m = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) if m is None: + self.info.pop('error', None) return errmsg = m.group(1).lower() diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 92066abb5..189079017 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -75,5 +75,7 @@ class UploadheroCom(SimpleHoster): self.wait(wait_time, True) self.retry() + self.info.pop('error', None) + getInfo = create_getInfo(UploadheroCom) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 809e89c02..f391445fd 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -399,8 +399,8 @@ class SimpleHoster(Hoster): if hasattr(self, 'ERROR_PATTERN'): m = re.search(self.ERROR_PATTERN, self.html) if m: - e = self.info['error'] = m.group(1) - self.error(e) + errmsg = self.info['error'] = m.group(1) + self.error(errmsg) if hasattr(self, 'PREMIUM_ONLY_PATTERN'): m = re.search(self.PREMIUM_ONLY_PATTERN, self.html) diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index c3db3f335..3ae0692dc 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -256,8 +256,6 @@ class XFSHoster(SimpleHoster): else: self.info.pop('error', None) - return self.errmsg - def getPostParameters(self): if self.FORM_PATTERN or self.FORM_INPUTS_MAP: |