diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-02-11 14:57:27 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-02-11 14:57:27 +0100 |
commit | d81cc8c0c46d295a3746ac658069820c95efe895 (patch) | |
tree | d8d6df73b9f90452a077b2f93615304bb8654417 /module/web | |
parent | Webinterface with lighttpd! locale fixing try. (diff) | |
download | pyload-d81cc8c0c46d295a3746ac658069820c95efe895.tar.xz |
cnl, EOL, path fixes
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/cnl/views.py | 28 | ||||
-rw-r--r-- | module/web/urls.py | 2 |
2 files changed, 21 insertions, 9 deletions
diff --git a/module/web/cnl/views.py b/module/web/cnl/views.py index 9d309dbf6..30d72ca5a 100644 --- a/module/web/cnl/views.py +++ b/module/web/cnl/views.py @@ -37,7 +37,7 @@ def local_check(function): @local_check def flash(request): - return HttpResponse() + return HttpResponse("JDownloader") @local_check def add(request): @@ -73,13 +73,25 @@ def addcrypted2(request): crypted = base64.standard_b64decode(unquote(crypted.replace(" ", "+"))) - jk = re.findall(r"return ('|\")(.+)('|\")", jk)[0][1] + 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 + + Key = binascii.unhexlify(jk) IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) - result = obj.decrypt(crypted).replace("\x00", "").split("\n") + result = obj.decrypt(crypted).replace("\x00", "").replace("\r","").split("\n") result = filter(lambda x: x != "", result) @@ -103,9 +115,9 @@ def flashgot(request): @local_check def crossdomain(request): - rep = "<?xml version=\"1.0\"?>\r\n" - rep += "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\r\n" - rep += "<cross-domain-policy>\r\n" - rep += "<allow-access-from domain=\"*\" />\r\n" - rep += "</cross-domain-policy>\r\n" + rep = "<?xml version=\"1.0\"?>\n" + rep += "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\n" + rep += "<cross-domain-policy>\n" + rep += "<allow-access-from domain=\"*\" />\n" + rep += "</cross-domain-policy>" return HttpResponse(rep)
\ No newline at end of file diff --git a/module/web/urls.py b/module/web/urls.py index b753890ee..165c7e146 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -16,7 +16,7 @@ urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), # django 1.0 not working (r'^json/', include('ajax.urls')), (r'^flashgot$', 'cnl.views.flashgot'), - (r'^flash(got)?/', include('cnl.urls')), + (r'^flash(got)?/?', include('cnl.urls')), (r'^crossdomain.xml$', 'cnl.views.crossdomain'), (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/img/favicon.ico'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', |