diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-13 23:27:54 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-13 23:27:54 +0100 |
commit | f2ac339fa159cd2bcea912d6fc2e40129b2dfc15 (patch) | |
tree | bce47ed26cad5bae580190d452a848a92517a62b /module/plugins/internal | |
parent | New plugin: ExashareCom (diff) | |
download | pyload-f2ac339fa159cd2bcea912d6fc2e40129b2dfc15.tar.xz |
[SimpleHoster] Improve error handling
Diffstat (limited to 'module/plugins/internal')
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 3f14ca711..2b87c5996 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -189,7 +189,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.98" + __version__ = "0.99" __pattern__ = r'^unmatchable$' @@ -577,16 +577,12 @@ class SimpleHoster(Hoster): if not hasattr(self, 'LINK_FREE_PATTERN'): self.logError(_("Free download not implemented")) - try: - m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: - self.error(_("Free download link not found")) - + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m is None: + self.error(_("Free download link not found")) + else: self.link = m.group(1) - except Exception, e: - self.fail(e) - def handlePremium(self, pyfile): if not hasattr(self, 'LINK_PREMIUM_PATTERN'): @@ -594,16 +590,12 @@ class SimpleHoster(Hoster): self.logDebug("Handled as free download") self.handleFree(pyfile) - try: - m = re.search(self.LINK_PREMIUM_PATTERN, self.html) - if m is None: - self.error(_("Premium download link not found")) - + m = re.search(self.LINK_PREMIUM_PATTERN, self.html) + if m is None: + self.error(_("Premium download link not found")) + else: self.link = m.group(1) - except Exception, e: - self.fail(e) - def longWait(self, wait_time=None, max_tries=3): if wait_time and isinstance(wait_time, (int, long, float)): |