forked from rDrama/rDrama
1
0
Fork 0
master
Aevann 2023-10-06 14:38:58 +03:00
parent 985789a153
commit de72ba49eb
2 changed files with 35 additions and 2 deletions

View File

@ -14,14 +14,14 @@ def before_request():
if request.host != SITE:
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)
if request.headers.get("CF-Worker"):
abort(403, "Cloudflare workers are not allowed to access this website!")
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!')
if not get_setting('bots') and request.headers.get("Authorization"):

View File

@ -1364,6 +1364,39 @@ if KOFI_TOKEN:
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")
@limiter.exempt
def gumroad():