diff options
-rw-r--r-- | module/plugins/hoster/BasePlugin.py | 16 | ||||
-rw-r--r-- | module/plugins/hoster/FilerNet.py | 8 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 22 |
3 files changed, 23 insertions, 23 deletions
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index a26a7a180..ba0f1781e 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -89,14 +89,16 @@ class BasePlugin(Hoster): 'Html error' : re.compile(r'\A(?:\s*<.+>)?((?:[\w\s]*(?:[Ee]rror|ERROR)\s*\:?)?\s*\d{3})(?:\Z|\s+)'), 'Html file' : re.compile(r'\A\s*<!DOCTYPE html'), 'Unknown error': re.compile(r'([Aa]n error occured while processing your request)')}) - if errmsg: - try: - errmsg += " | " + self.lastCheck.group(1).strip() - except Exception: - pass + if not errmsg: + return + + try: + errmsg += " | " + self.lastCheck.group(1).strip() + except Exception: + pass - self.logWarning("Bad file", "Waiting 1 minute and retry") - self.retry(3, 60, errmsg) + self.logWarning("Bad file", "Waiting 1 minute and retry") + self.retry(3, 60, errmsg) getInfo = create_getInfo(BasePlugin) diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index b8a97d6a1..a37decb69 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.18" + __version__ = "0.19" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -63,10 +63,4 @@ class FilerNet(SimpleHoster): self.invalidCaptcha() - def checkFile(self, rules={}): - if self.checkDownload({'Html file': re.compile(r'\A\s*<!DOCTYPE html')}): - self.offline() - return super(FilerNet, self).checkFile(rules) - - getInfo = create_getInfo(FilerNet) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 13a9c134f..a1825a73e 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -246,7 +246,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.23" + __version__ = "1.24" __pattern__ = r'^unmatchable$' @@ -524,16 +524,20 @@ class SimpleHoster(Hoster): if r not in rules and hasattr(self, a): rules[r] = getattr(self, a) - errmsg = self.checkDownload(rules).strip().capitalize() + errmsg = self.checkDownload(rules) - if errmsg: - try: - errmsg += " | " + self.lastCheck.group(1).strip() - except Exception: - pass + if not errmsg: + return + + errmsg = errmsg.strip().capitalize() + + try: + errmsg += " | " + self.lastCheck.group(1).strip() + except Exception: + pass - self.logWarning("Bad file", "Waiting 1 minute and retry") - self.retry(3, 60, errmsg) + self.logWarning("Bad file", "Waiting 1 minute and retry") + self.retry(3, 60, errmsg) def checkErrors(self): |