summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-02-21 21:14:23 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-02-21 21:14:23 +0100
commitade29ef9edd2cb1d33465f3b0f073194c5dcb902 (patch)
tree708036a6ec6810870c1b2fb617aa600fef3904e4 /module/web
parentchecksum now consumes less memory, fixed cookie cleaning (diff)
downloadpyload-ade29ef9edd2cb1d33465f3b0f073194c5dcb902.tar.xz
gui fix, better click and load support
Diffstat (limited to 'module/web')
-rw-r--r--module/web/cnl/urls.py4
-rw-r--r--module/web/cnl/views.py52
-rw-r--r--module/web/urls.py1
3 files changed, 38 insertions, 19 deletions
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}),