diff options
author | mkaay <mkaay@mkaay.de> | 2010-02-21 21:14:23 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-02-21 21:14:23 +0100 |
commit | ade29ef9edd2cb1d33465f3b0f073194c5dcb902 (patch) | |
tree | 708036a6ec6810870c1b2fb617aa600fef3904e4 /module | |
parent | checksum now consumes less memory, fixed cookie cleaning (diff) | |
download | pyload-ade29ef9edd2cb1d33465f3b0f073194c5dcb902.tar.xz |
gui fix, better click and load support
Diffstat (limited to 'module')
-rw-r--r-- | module/gui/Collector.py | 6 | ||||
-rw-r--r-- | module/gui/Queue.py | 6 | ||||
-rw-r--r-- | module/web/cnl/urls.py | 4 | ||||
-rw-r--r-- | module/web/cnl/views.py | 52 | ||||
-rw-r--r-- | module/web/urls.py | 1 |
5 files changed, 50 insertions, 19 deletions
diff --git a/module/gui/Collector.py b/module/gui/Collector.py index ebdbd372d..6ec0977d6 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -71,6 +71,7 @@ class PackageCollector(QObject): else: for k, pack in enumerate(ItemIterator(self.rootItem)): if pack.getPackData()["id"] == event[3]: + pack.clearAll() self.rootItem.removeChild(pack) break @@ -147,6 +148,7 @@ class PackageCollector(QObject): def clearAll(self): for k, pack in enumerate(ItemIterator(self.rootItem)): if not pack.getPackData()["id"] == "fixed": + pack.clearAll() self.rootItem.removeChild(pack) class PackageCollectorPack(QTreeWidgetItem): @@ -190,6 +192,10 @@ class PackageCollector(QObject): if item.getFileData()["id"] == cid: return item return None + + def clearAll(self): + for c in ItemIterator(self): + self.removeChild(c) class PackageCollectorFile(QTreeWidgetItem): def __init__(self, collector, pack): diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 2aeb603b0..509f5a537 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -123,6 +123,7 @@ class Queue(QObject): else: for k, pack in enumerate(ItemIterator(self.rootItem)): if pack.getPackData()["id"] == event[3]: + pack.clearAll() self.rootItem.removeChild(pack) break @@ -220,6 +221,7 @@ class Queue(QObject): def clearAll(self): for pack in ItemIterator(self.rootItem): + pack.clearAll() self.rootItem.removeChild(pack) def getWaitingProgress(self, q): @@ -345,6 +347,10 @@ class Queue(QObject): if item.getFileData()["id"] == cid: return item return None + + def clearAll(self): + for c in ItemIterator(self): + self.removeChild(c) class QueueFile(QTreeWidgetItem): def __init__(self, queue, pack): diff --git a/module/web/cnl/urls.py b/module/web/cnl/urls.py index 5e06b639f..7887953b7 100644 --- a/module/web/cnl/urls.py +++ b/module/web/cnl/urls.py @@ -14,5 +14,7 @@ urlpatterns = patterns('cnl', (r'^add$', 'views.add'), (r'^addcrypted$', 'views.addcrypted'), (r'^addcrypted2$', 'views.addcrypted2'), + (r'^crossdomain\.xml', 'views.crossdomain'), + (r'^jdcheck\.js', 'views.jdcheck'), (r'', 'views.flash') - )
\ No newline at end of file + ) diff --git a/module/web/cnl/views.py b/module/web/cnl/views.py index 30d72ca5a..aeb6174a7 100644 --- a/module/web/cnl/views.py +++ b/module/web/cnl/views.py @@ -59,10 +59,12 @@ def addcrypted(request): dlc_file.write(dlc) dlc_file.close() - - settings.PYLOAD.add_package(package, [dlc_path], False) - - return HttpResponse() + try: + settings.PYLOAD.add_package(package, [dlc_path], False) + except: + return HttpResponse("") + else: + return HttpResponse("success") @local_check def addcrypted2(request): @@ -73,18 +75,23 @@ def addcrypted2(request): crypted = base64.standard_b64decode(unquote(crypted.replace(" ", "+"))) - print jk - try: - jk = re.findall(r"return ('|\")(.+)('|\")", jk)[0][1] + import spidermonkey except: - ## Test for some known js functions to decode - if jk.find("dec") > -1 and jk.find("org") > -1: - org = re.findall(r"var org = ('|\")([^\"']+)", jk)[0][1] - jk = list(org) - jk.reverse() - jk = "".join(jk) - print jk + try: + jk = re.findall(r"return ('|\")(.+)('|\")", jk)[0][1] + except: + ## Test for some known js functions to decode + if jk.find("dec") > -1 and jk.find("org") > -1: + org = re.findall(r"var org = ('|\")([^\"']+)", jk)[0][1] + jk = list(org) + jk.reverse() + jk = "".join(jk) + print jk + else: + rt = spidermonkey.Runtime() + cx = rt.new_context() + jk = cx.execute("%s f()" % jk) Key = binascii.unhexlify(jk) @@ -95,9 +102,12 @@ def addcrypted2(request): result = filter(lambda x: x != "", result) - settings.PYLOAD.add_package(package, result, False) - - return HttpResponse() + try: + settings.PYLOAD.add_package(package, result, False) + except: + return HttpResponse("failed can't add") + else: + return HttpResponse("success") @local_check def flashgot(request): @@ -120,4 +130,10 @@ def crossdomain(request): rep += "<cross-domain-policy>\n" rep += "<allow-access-from domain=\"*\" />\n" rep += "</cross-domain-policy>" - return HttpResponse(rep)
\ No newline at end of file + return HttpResponse(rep) + +@local_check +def jdcheck(request): + rep = "jdownloader=true;\n" + rep += "var version='10629';\n" + return HttpResponse(rep) diff --git a/module/web/urls.py b/module/web/urls.py index 165c7e146..9fe11f925 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -18,6 +18,7 @@ urlpatterns = patterns('', (r'^flashgot$', 'cnl.views.flashgot'), (r'^flash(got)?/?', include('cnl.urls')), (r'^crossdomain.xml$', 'cnl.views.crossdomain'), + (r'^jdcheck.js', 'cnl.views.jdcheck'), (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/img/favicon.ico'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), |