diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-18 21:03:37 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-18 21:03:37 +0200 |
commit | 02f31debdb280cc9f938360c15e02a7279bea908 (patch) | |
tree | 687a0a210000debdc65146cdedf1ee157119efca /module/plugins/hooks | |
parent | Merge pull request #2039 from joberreiter/patch-2 (diff) | |
parent | [UpdateManager] report 404 (diff) | |
download | pyload-02f31debdb280cc9f938360c15e02a7279bea908.tar.xz |
Merge pull request #2024 from GammaC0de/patch-6
[UpdateManager] report 404
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 39ec2d49e..41c11ed98 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -276,6 +276,7 @@ class UpdateManager(Addon): 'name': n, }) + req = self.pyload.requestFactory.getRequest(self.classname) for plugin in updatelist: name = plugin['name'] type = plugin['type'] @@ -298,9 +299,12 @@ class UpdateManager(Addon): 'oldver': oldver, 'newver': newver}) try: - content = self.load(url % plugin + ".py", decode=False) - m = self._VERSION.search(content) + content = self.load(url % plugin + ".py", decode=False, req=req) + if req.code == 404: + raise Exception(_("Plugin URL not found (404)")) + + m = self._VERSION.search(content) if m and m.group(2) == version: #@TODO: Remove in 0.4.10 if type in ("account", "hook"): @@ -313,7 +317,7 @@ class UpdateManager(Addon): updated.append((type, name)) else: - raise Exception(_("Version mismatch")) + raise Exception(_("Plugin version mismatch")) except Exception, e: self.log_error(_("Error updating plugin: %s %s") % (type.upper(), name), e) @@ -370,7 +374,7 @@ class UpdateManager(Addon): os.remove(filename) except OSError, e: - self.log_warning(_("Error removing: %s") % filename, e) + self.log_error(_("Error removing: %s") % filename, e) else: id = (type, name) |