def add(request): package = request.POST.get('referer', None) urls = filter(lambda x: x != "", request.POST['urls'].split("\n")) if package: PYLOAD.addPackage(package, urls, paused=True) else: generate_and_add(urls, True) return ""
def add(request): package = request.POST.get('referer', None) urls = filter(lambda x: x != "", request.POST['urls'].split("\n")) if package: PYLOAD.addPackage(package, urls, 0) else: PYLOAD.generateAndAddPackages(urls, 0) return ""
def add(request): package = request.POST.get('referer', None) urls = filter(lambda x: x != "", request.POST['urls'].split("\n")) if package: PYLOAD.addPackage(package, urls, paused=True) else: generate_and_add(urls, True) return ""
def add(request): package = request.POST.get('referer', None) urls = filter(lambda x: x != "", request.POST['urls'].split("\n")) if package: PYLOAD.addPackage(package, urls, 0) else: PYLOAD.generateAndAddPackages(urls, 0) return ""
def add(): package = request.forms.get( "package", request.forms.get("source", request.POST.get('referer', None))) urls = [x.strip() for x in request.POST['urls'].split("\n") if x.strip()] if package: PYLOAD.addPackage(package, urls, 0) else: PYLOAD.generateAndAddPackages(urls, 0) return ""
def flashgot(): if request.environ['HTTP_REFERER'] != "http://localhost:9666/flashgot" and request.environ['HTTP_REFERER'] != "http://127.0.0.1:9666/flashgot": return HTTPError() autostart = int(request.forms.get('autostart', 0)) package = request.forms.get('package', None) urls = filter(lambda x: x != "", request.forms['urls'].split("\n")) folder = request.forms.get('dir', None) if package: PYLOAD.addPackage(package, urls, autostart) else: PYLOAD.generateAndAddPackages(urls, autostart) return ""
def flashgot(): if request.environ['HTTP_REFERER'] != "http://localhost:9666/flashgot" and request.environ['HTTP_REFERER'] != "http://127.0.0.1:9666/flashgot": return HTTPError() autostart = int(request.forms.get('autostart', 0)) package = request.forms.get('package', None) urls = filter(lambda x: x != "", request.forms['urls'].split("\n")) folder = request.forms.get('dir', None) if package: PYLOAD.addPackage(package, urls, autostart) else: PYLOAD.generateAndAddPackages(urls, autostart) return ""
def addcrypted2(): package = request.forms.get("source", None) crypted = request.forms["crypted"] jk = request.forms["jk"] crypted = standard_b64decode(unquote(crypted.replace(" ", "+"))) if JS: jk = "%s f()" % jk jk = JS.eval(jk) else: 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) else: print "Could not decrypt key, please install py-spidermonkey or ossp-js" try: Key = unhexlify(jk) except: print "Could not decrypt key, please install py-spidermonkey or ossp-js" return "failed" IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) result = obj.decrypt(crypted).replace("\x00", "").replace("\r", "").split("\n") result = filter(lambda x: x != "", result) try: if package: PYLOAD.addPackage(package, result, paused=True) else: generate_and_add(result, True) except: print_exc() return "failed" else: return "success\r\n"
def addcrypted2(): package = request.forms.get( "package", request.forms.get("source", request.POST.get('referer', None))) crypted = request.forms["crypted"] jk = request.forms["jk"] crypted = standard_b64decode(unquote(crypted.replace(" ", "+"))) if JS: jk = "%s f()" % jk jk = JS.eval(jk) else: 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) else: print "Could not decrypt key, please install py-spidermonkey or ossp-js" try: Key = unhexlify(jk) except: print "Could not decrypt key, please install py-spidermonkey or ossp-js" return "failed" IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) urls = obj.decrypt(crypted).replace("\x00", "").replace("\r", "").split("\n") urls = [x.strip() for x in urls if x.strip()] try: if package: PYLOAD.addPackage(package, urls, 0) else: PYLOAD.generateAndAddPackages(urls, 0) except: return "failed can't add" else: return "success\r\n"
def add_package(): name = request.forms.get("add_name", "New Package").strip() queue = int(request.forms['add_dest']) links = decode(request.forms['add_links']) links = links.split("\n") pw = request.forms.get("add_password", "").strip("\n\r") try: f = request.files['add_file'] if not name or name == "New Package": name = f.name fpath = join(PYLOAD.getConfigValue("general", "download_folder"), "tmp_" + f.filename) destination = open(fpath, 'wb') copyfileobj(f.file, destination) destination.close() links.insert(0, fpath) except: pass name = name.decode("utf8", "ignore") links = map(lambda x: x.strip(), links) links = filter(lambda x: x != "", links) pack = PYLOAD.addPackage(name, links, queue) if pw: pw = pw.decode("utf8", "ignore") data = {"password": pw} PYLOAD.setPackageData(pack, data)
def addcrypted(): package = request.forms.get('referer', 'ClickAndLoad Package') dlc = request.forms['crypted'].replace(" ", "+") dlc_path = join(DL_ROOT, save_filename(package) + ".dlc") dlc_file = open(dlc_path, "wb") dlc_file.write(dlc) dlc_file.close() try: PYLOAD.addPackage(package, [dlc_path], 0) except: return HTTPError() else: return "success\r\n"
def addcrypted(): package = request.forms.get('referer', 'ClickAndLoad Package') dlc = request.forms['crypted'].replace(" ", "+") dlc_path = join(DL_ROOT, package.replace("/", "").replace("\\", "").replace(":", "") + ".dlc") dlc_file = open(dlc_path, "wb") dlc_file.write(dlc) dlc_file.close() try: PYLOAD.addPackage(package, [dlc_path], 0) except: return HTTPError() else: return "success\r\n"
def addcrypted2(): package = request.forms.get("source", None) crypted = request.forms["crypted"] jk = request.forms["jk"] crypted = standard_b64decode(unquote(crypted.replace(" ", "+"))) if JS: jk = "%s f()" % jk jk = JS.eval(jk) else: 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) else: print "Could not decrypt key, please install py-spidermonkey or ossp-js" try: Key = unhexlify(jk) except: print "Could not decrypt key, please install py-spidermonkey or ossp-js" return "failed" IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) result = obj.decrypt(crypted).replace("\x00", "").replace("\r","").split("\n") result = filter(lambda x: x != "", result) try: if package: PYLOAD.addPackage(package, result, paused=True) else: generate_and_add(result, True) except: print_exc() return "failed" else: return "success\r\n"
def generate_and_add(urls, paused): packs = PYLOAD.generatePackages(urls) for name, urls in packs.iteritems(): PYLOAD.addPackage(name, urls, paused=paused)
def generate_and_add(urls, paused): packs = PYLOAD.generatePackages(urls) for name, urls in packs.iteritems(): PYLOAD.addPackage(name, urls, paused=paused)