规避push有时json报错的问题

修复心跳包帧头错误
This commit is contained in:
murmur 2023-03-23 09:28:23 +08:00
parent 9d9cf6f768
commit 6367751b7a

View File

@ -51,7 +51,11 @@ _{datetime.datetime.now()}_
{content}""", {content}""",
"token": "tt" "token": "tt"
}) })
try:
res = res.json() res = res.json()
except:
return
else:
if res["success"]: if res["success"]:
return None return None
else: else:
@ -173,6 +177,7 @@ def tt_hh(addr, data):
update_pairs(addr, ccid) update_pairs(addr, ccid)
# 组帧再返回 # 组帧再返回
msg = bytearray(data[:]) msg = bytearray(data[:])
msg[:5] = b"$TTMX"
val = "%04x" % int(time.time()) val = "%04x" % int(time.time())
tmp=[] tmp=[]
for i in range(0,len(val),2): for i in range(0,len(val),2):