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