Skip to content

Commit

Permalink
fix: 删一个状态码
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Jun 8, 2024
1 parent a70a646 commit 1f36aec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions common/gcsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ async def handleGcspBody(body):
data = decode(body)
result = verify(data)
if (result != "success"):
return zlib.compress(json.dumps({"code": "403", "error_msg": internal_trans[result], "data": None}, ensure_ascii = False).encode("utf-8")), 200
return zlib.compress(json.dumps({"code": "403", "error_msg": internal_trans[result], "data": None}, ensure_ascii = False).encode("utf-8"))

data["te"] = json.loads(data["text_1"])

body = await modules.url(pm[data["te"]["platform"]], data["te"]["t1"], qm[data["te"]["t2"]])

if (body["code"] == 0):
return zlib.compress(json.dumps({"code": "200", "error_msg": "success", "data": body["data"] if (pm[data["te"]["platform"]] != "kw") else {"bitrate": "123", "url": body["data"]}}, ensure_ascii = False).encode("utf-8")), 200
return zlib.compress(json.dumps({"code": "200", "error_msg": "success", "data": body["data"] if (pm[data["te"]["platform"]] != "kw") else {"bitrate": "123", "url": body["data"]}}, ensure_ascii = False).encode("utf-8"))
else:
return zlib.compress(json.dumps({"code": "403", "error_msg": "内部系统错误,请稍后再试", "data": None}, ensure_ascii = False).encode("utf-8")), 200
return zlib.compress(json.dumps({"code": "403", "error_msg": "内部系统错误,请稍后再试", "data": None}, ensure_ascii = False).encode("utf-8"))

async def handle_request(request: Request):
if (request.method == "POST"):
Expand All @@ -83,7 +83,8 @@ async def handle_request(request: Request):
body = await request.read()
return Response(
body = await handleGcspBody(body),
content_type = "application/octet-stream"
content_type = "application/octet-stream",
status = 200
)
else:
return Response(
Expand Down

0 comments on commit 1f36aec

Please sign in to comment.