diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-01 00:08:11 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-01 00:08:11 +0100 |
commit | 95270599f2a0d0042c75f63f30a3e013849439f7 (patch) | |
tree | ced2dc611ed51e43251b980e2a1578fe90674858 /pyload/threads | |
parent | Updated translations (diff) | |
download | pyload-95270599f2a0d0042c75f63f30a3e013849439f7.tar.xz |
fixed are few addons and improved crypter workarounds
Diffstat (limited to 'pyload/threads')
-rw-r--r-- | pyload/threads/DecrypterThread.py | 64 | ||||
-rw-r--r-- | pyload/threads/InfoThread.py | 1 |
2 files changed, 37 insertions, 28 deletions
diff --git a/pyload/threads/DecrypterThread.py b/pyload/threads/DecrypterThread.py index 22a2d0037..10d47fcc2 100644 --- a/pyload/threads/DecrypterThread.py +++ b/pyload/threads/DecrypterThread.py @@ -42,51 +42,61 @@ class DecrypterThread(BaseThread): for name, urls in plugin_map.iteritems(): klass = self.m.core.pluginManager.loadClass("crypter", name) - plugin = klass(self.m.core, password) + plugin = None plugin_result = [] - try: + #TODO: dependency check, there is a new error code for this + if not klass: + plugin_result.extend(LinkStatus(url, url, -1, DS.NotPossible, name) for url in urls) + self.log.debug("Plugin for decrypting was not loaded") + else: try: - plugin_result = plugin._decrypt(urls) - except Retry: - sleep(1) - plugin_result = plugin._decrypt(urls) - except Abort: - plugin.logInfo(_("Decrypting aborted")) - except Exception, e: - plugin.logError(_("Decrypting failed"), e) - - # generate error linkStatus - if err: - plugin_result.extend(LinkStatus(url, url, -1, DS.Failed, name) for url in urls) - - if self.core.debug: - self.core.print_exc() - self.writeDebugReport(plugin.__name__, plugin=plugin) - finally: - plugin.clean() - - plugin.logDebug("Decrypted", plugin_result) + plugin = klass(self.m.core, password) + + try: + plugin_result = plugin._decrypt(urls) + except Retry: + sleep(1) + plugin_result = plugin._decrypt(urls) + + plugin.logDebug("Decrypted", plugin_result) + + except Abort: + plugin.logInfo(_("Decrypting aborted")) + except Exception, e: + plugin.logError(_("Decrypting failed"), e) + + # generate error linkStatus + if err: + plugin_result.extend(LinkStatus(url, url, -1, DS.Failed, name) for url in urls) + + if self.core.debug: + self.core.print_exc() + self.writeDebugReport(plugin.__name__, plugin=plugin) + finally: + if plugin: + plugin.clean() + result.extend(plugin_result) # generated packages - pack_names = {} + packs = {} # urls without package urls = [] # merge urls and packages for p in result: if isinstance(p, Package): - if p.name in pack_names: - pack_names[p.name].urls.extend(p.urls) + if p.name in packs: + packs[p.name].urls.extend(p.urls) else: if not p.name: urls.extend(p.links) else: - pack_names[p.name] = p + packs[p.name] = p else: urls.append(p) urls = uniqify(urls) - return urls, pack_names.values()
\ No newline at end of file + return urls, packs.values()
\ No newline at end of file diff --git a/pyload/threads/InfoThread.py b/pyload/threads/InfoThread.py index 62e309020..8d33df705 100644 --- a/pyload/threads/InfoThread.py +++ b/pyload/threads/InfoThread.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- from time import time -from traceback import print_exc from pyload.Api import LinkStatus, DownloadStatus from pyload.utils.packagetools import parseNames |