summaryrefslogtreecommitdiffstats
path: root/pyload/threads
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/threads')
-rw-r--r--pyload/threads/DecrypterThread.py10
-rw-r--r--pyload/threads/InfoThread.py2
-rw-r--r--pyload/threads/ThreadManager.py8
3 files changed, 10 insertions, 10 deletions
diff --git a/pyload/threads/DecrypterThread.py b/pyload/threads/DecrypterThread.py
index e8b889ac8..22a2d0037 100644
--- a/pyload/threads/DecrypterThread.py
+++ b/pyload/threads/DecrypterThread.py
@@ -3,6 +3,7 @@
from time import sleep
+from pyload.Api import LinkStatus, DownloadStatus as DS
from pyload.utils import uniqify, accumulate
from pyload.plugins.Base import Abort, Retry
from pyload.plugins.Crypter import Package
@@ -34,7 +35,7 @@ class DecrypterThread(BaseThread):
for p in packages:
self.m.core.api.addPackage(p.name, p.getURLs(), pack.password)
- def decrypt(self, plugin_map, password=None):
+ def decrypt(self, plugin_map, password=None, err=None):
result = []
# TODO QUEUE_DECRYPT
@@ -54,6 +55,11 @@ class DecrypterThread(BaseThread):
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)
@@ -75,7 +81,7 @@ class DecrypterThread(BaseThread):
pack_names[p.name].urls.extend(p.urls)
else:
if not p.name:
- urls.append(p)
+ urls.extend(p.links)
else:
pack_names[p.name] = p
else:
diff --git a/pyload/threads/InfoThread.py b/pyload/threads/InfoThread.py
index 8aa5e2d24..f516d2cca 100644
--- a/pyload/threads/InfoThread.py
+++ b/pyload/threads/InfoThread.py
@@ -37,7 +37,7 @@ class InfoThread(DecrypterThread):
if crypter:
# decrypt them
- links, packages = self.decrypt(crypter)
+ links, packages = self.decrypt(crypter, err=True)
# push these as initial result and save package names
self.updateResult(links)
for pack in packages:
diff --git a/pyload/threads/ThreadManager.py b/pyload/threads/ThreadManager.py
index 07b0cd6e9..55cfcbfd2 100644
--- a/pyload/threads/ThreadManager.py
+++ b/pyload/threads/ThreadManager.py
@@ -94,13 +94,7 @@ class ThreadManager:
oc = OnlineCheck(rid, user)
self.infoResults[rid] = oc
- # maps url to plugin
- urls = []
- for links in data.itervalues():
- for link in links:
- urls.append((link.url, link.plugin))
-
- InfoThread(self, user, urls, oc=oc)
+ InfoThread(self, user, data, oc=oc)
return rid