Exemplo n.º 1
0
def dump(func, args=[], kwargs={}, limit=100, show_target=True):
    print(w)
    rv = []
    kwargs = kwargs.copy()
    lanjut = True
    data = func(*args, **kwargs)
    for x in data.items:
        rv.append(x)
        if len(rv) == limit:
            lanjut = False
            break
    kwargs["next"] = data.next
    if show_target:
        print(f"   {p}[!]{w} Target: {data.bs4().find('title').text}")
    print(f"   {p}[+]{w} Getting Data")
    if data.next and lanjut:
        rv += function.dump(func,
                            args=args,
                            kwargs=kwargs,
                            limit=limit - len(rv))
    print(f"   {p}[+]{w} Succes Getting Data")
    time.sleep(0.5)
    print(f"   {p}[+]{w} Total: {len(rv)}\n")

    return rv
Exemplo n.º 2
0
def dump():
	func = request.args.get("func")
	limit = request.args.get("limit")

	if limit == None or int(limit) < 0: 
		limit = 10

	kwargs = request.args.copy()
	del kwargs["func"]
	if request.args.get("limit") != None:
		del kwargs["limit"] 

	func = eval(f"murtanto.{func}")
	data = func(ses, **kwargs)
	kwargs["next"] = data.next

	if data.next:
		data_ = function.dump(func, args = (ses,), kwargs = kwargs, limit = int(limit))
	else:
		data_ = []

	data_ = data_ + data.items

	rv = {"status":True, "title":data.bs4().find("title").text, "items":data_[:int(limit)]}
	return json.dumps(rv)