forked from rDrama/rDrama
add /bm
parent
985789a153
commit
de72ba49eb
|
@ -14,14 +14,14 @@ def before_request():
|
||||||
if request.host != SITE:
|
if request.host != SITE:
|
||||||
abort(403, "Unauthorized host provided!")
|
abort(403, "Unauthorized host provided!")
|
||||||
|
|
||||||
if SITE == 'marsey.world' and request.path != '/kofi':
|
if SITE == 'marsey.world' and request.path not in {'/kofi','/bm'}:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
if request.headers.get("CF-Worker"):
|
if request.headers.get("CF-Worker"):
|
||||||
abort(403, "Cloudflare workers are not allowed to access this website!")
|
abort(403, "Cloudflare workers are not allowed to access this website!")
|
||||||
|
|
||||||
g.agent = request.headers.get("User-Agent", "")
|
g.agent = request.headers.get("User-Agent", "")
|
||||||
if not g.agent and request.path not in {'/kofi', '/refresh_chat'}:
|
if not g.agent and request.path not in {'/kofi', '/bm', '/refresh_chat'}:
|
||||||
abort(403, 'Please use a "User-Agent" header!')
|
abort(403, 'Please use a "User-Agent" header!')
|
||||||
|
|
||||||
if not get_setting('bots') and request.headers.get("Authorization"):
|
if not get_setting('bots') and request.headers.get("Authorization"):
|
||||||
|
|
|
@ -1364,6 +1364,39 @@ if KOFI_TOKEN:
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/bm")
|
||||||
|
@limiter.exempt
|
||||||
|
def bm():
|
||||||
|
print([x for x in request.form.items()], flush=True)
|
||||||
|
data = json.loads(request.values['data'])
|
||||||
|
print(data, flush=True)
|
||||||
|
|
||||||
|
print(request.headers.get('CF-Connecting-IP'), flush=True)
|
||||||
|
# id = data['kofi_transaction_id']
|
||||||
|
# created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%SZ")))
|
||||||
|
# type = data['type']
|
||||||
|
# amount = 0
|
||||||
|
# try:
|
||||||
|
# amount = int(float(data['amount']))
|
||||||
|
# except:
|
||||||
|
# abort(400, 'invalid amount')
|
||||||
|
# email = data['email']
|
||||||
|
|
||||||
|
# transaction = Transaction(
|
||||||
|
# id=id,
|
||||||
|
# created_utc=created_utc,
|
||||||
|
# type=type,
|
||||||
|
# amount=amount,
|
||||||
|
# email=email
|
||||||
|
# )
|
||||||
|
|
||||||
|
# g.db.add(transaction)
|
||||||
|
|
||||||
|
# claim_rewards_all_users()
|
||||||
|
|
||||||
|
return ''
|
||||||
|
|
||||||
@app.post("/gumroad")
|
@app.post("/gumroad")
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
def gumroad():
|
def gumroad():
|
||||||
|
|
Loading…
Reference in New Issue