From d19701d81247b05d9e4444a1f24367d3a73e74ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?HaiYang=20Yu=28=E8=99=9E=E6=B5=B7=E6=B4=8B=29?= Date: Tue, 2 Jan 2018 22:50:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81108=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index bfb9d81..8f6d59b 100644 --- a/main.py +++ b/main.py @@ -26,8 +26,7 @@ def run(session_id, score): ''' action_data = { "score": score, - "times": 123, - "game_data": "{}" + "times": 21 } aes_key = session_id[0:16] aes_iv = aes_key @@ -58,5 +57,5 @@ def run(session_id, score): if __name__ == '__main__': session_id = '' - score = 66666 + score = 9999 run(session_id, score) From 9a1c222ef969443a0126d06c856f2e9eb2cf3158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?HaiYang=20Yu=28=E8=99=9E=E6=B5=B7=E6=B4=8B=29?= Date: Tue, 2 Jan 2018 22:52:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96POST=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=B8=ADcontent-length=E7=9A=84=E8=AE=A1=E7=AE=97=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 8f6d59b..aa01f2a 100644 --- a/main.py +++ b/main.py @@ -4,17 +4,6 @@ import base64 import json -r_h = b'''charset: utf-8 -Accept-Encoding: gzip -referer: https://servicewechat.com/wx7c8d593b2c3a7703/3/page-frame.html -content-type: application/json -User-Agent: MicroMessenger/6.6.1.1220(0x26060133) NetType/WIFI Language/zh_CN -Content-Length: 431 -Host: mp.weixin.qq.com -Connection: Keep-Alive -''' - -headers = headers_raw_to_dict(r_h) def run(session_id, score): @@ -46,7 +35,17 @@ def run(session_id, score): }, "action_data": cipher_action_data } - url = "https://mp.weixin.qq.com/wxagame/wxagame_settlement" + url = "https://mp.weixin.qq.com/wxagame/wxagame_settlement" + r_h = b'''charset: utf-8 + Accept-Encoding: gzip + referer: https://servicewechat.com/wx7c8d593b2c3a7703/3/page-frame.html + content-type: application/json + User-Agent: MicroMessenger/6.6.1.1220(0x26060133) NetType/WIFI Language/zh_CN + Content-Length: %d + Host: mp.weixin.qq.com + Connection: Keep-Alive + ''' % len(jsdata) + headers = headers_raw_to_dict(r_h) z = requests.post(url, json=jsdata, headers=headers, verify=False) if z.ok: print(z.json())