Attempt for RedBee

This commit is contained in:
FoxRefire
2024-04-26 21:59:34 +09:00
parent f7db81a03b
commit d272e8f2e6
4 changed files with 39 additions and 0 deletions

14
python/schemes/RedBee.py Normal file
View File

@@ -0,0 +1,14 @@
import base64
import re
import js
req = base64.b64decode(licBody.encode()).decode()
b64challenge = base64.b64encode(challenge).decode()
req = re.sub(r'(?<=\"message\":\").*(?=\"})', b64challenge, req)
print(req)
# res = await (await pyfetch(licUrl,
# method="POST",
# headers=licHeaders,
# body=req
# )).json()
res = js.window.corsFetch(licUrl, "POST", licHeaders, req)
licence = base64.b64decode(res['license'].encode())