From 7f357700f340db51a0de65a8dcc0726a6965ecd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 22:37:29 +0100 Subject: [SimpleHoster] Improve checkFile routine (2) --- module/plugins/internal/SimpleHoster.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'module/plugins/internal') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index ac25423fc..393af86f5 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.21" + __version__ = "1.22" __pattern__ = r'^unmatchable$' @@ -509,24 +509,27 @@ class SimpleHoster(Hoster): self.error(self.pyfile.error or _("No file downloaded")) else: - errmsg = self.checkDownload({'Empty file': re.compile(r'\A\s*\Z')}) + errmsg = self.checkDownload({'Empty file': re.compile(r'\A\s*\Z'), + 'Html error': re.compile(r'\A(\s*<.+>)?([\w\s]*([Ee]rror|ERROR)\s*:?)?\s*\d{3}(\Z|\s+)')}) - if errmsg: - self.lastDownload = "" - else: - for r, p in [('html file' , re.compile(r'\A\s*)?\d{3}(\Z|\s+)'))]: + if not errmsg: + for r, p in [('Html file' , re.compile(r'\A\s*