├── .idea
├── .gitignore
├── duanWuTiXanQuan.iml
├── encodings.xml
├── inspectionProfiles
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── README.md
├── main.py
└── money.jpg
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/duanWuTiXanQuan.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 微信支付有优惠小程序龙舟游戏刷免费提现券脚本
2 | # 更新
3 | ```text
4 | 2023-08-23 更新新年活动,增加提示
5 | ```
6 | # 使用说明
7 | ```text
8 | 1. 抓包小程序 把url里的session_token=后面的东西填入脚本里的token变量
9 |
10 | #账号token
11 | token = 'ABBwEaIDAAWHClQNY1jq8j 示例 请修改为自己账号的token'
12 | #大于多少分提交游戏领取提现券
13 | maxScore = 7000
14 |
15 | ```
16 | 运行环境
17 | ```text
18 | Python
19 | ```
20 |
21 | 模块安装:
22 | ```text
23 | pip install requests
24 | ```
25 |
26 | 运行
27 | ```text
28 | python main.py
29 | ```
30 |
31 | # 警告:软件免费开源,仅供学习交流使用,请勿用于非法用途!
32 |
33 | # 加作者微信:g4994g 拉你加入忒星科技活动开源交流群
34 |
35 | 
36 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import logging
3 | import random
4 | import sys
5 | import time
6 |
7 | import requests
8 |
9 | # format code use black
10 | logging.basicConfig(
11 | format="%(asctime)s %(name)s %(levelname)s:%(lineno)3d: %(message)s",
12 | datefmt="%Y-%m-%d %H:%M:%S",
13 | level=logging.INFO,
14 | )
15 |
16 |
17 | def printf(text, userId=""):
18 | ti = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")
19 | print(f"[{ti}][{userId}]: {text}")
20 | sys.stdout.flush()
21 |
22 |
23 | def generate_random_str(randomlength=16):
24 | # random.sample??
25 | random_str = ""
26 | base_str = "ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz0123456789"
27 | length = len(base_str) - 1
28 | for i in range(randomlength):
29 | random_str += base_str[random.randint(0, length)]
30 | return random_str
31 |
32 |
33 | def getNowTime():
34 | return int(round(time.time() * 1000))
35 |
36 |
37 | def createGame():
38 | url = f"https://payapp.weixin.qq.com/coupon-center-activity/game/create?session_token={token}"
39 | head = {
40 | "Referer": "https://td.cdn-go.cn/",
41 | "Content-Type": "application/json",
42 | "X-Requested-With": "com.tencent.mm",
43 | "charset": "utf-8",
44 | "mpm-sdkversion": "3.3.3",
45 | "User-Agent": "Mozilla/5.0 (Linux; Android 11; Redmi Note 8 Pro Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5223 MMWEBSDK/20230701 MMWEBID/2090 MicroMessenger/8.0.40.2420(0x28002837) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
46 | "mpm-model": "Redmi Note 8 Pro",
47 | "wepaytest-proxyip": "",
48 | "mpm-platform": "android",
49 | "mpm-appversion": "6.49.0",
50 | "mpm-sourcescene": "1007",
51 | "mpm-scene": "1007",
52 | "mpm-brand": "Redmi",
53 | "mpm-system": "Android 11",
54 | "content-type": "application/json",
55 | "mpm-version": "8.0.46",
56 | }
57 | if module:
58 | data = {"activity_id": activity_id, "game_pk_id": game_pk_id}
59 | else:
60 | data = {"activity_id": activity_id}
61 | res = requests.post(url=url, headers=head, json=data, timeout=5).json()
62 | # printf(res)
63 | _datas = res.get("data")
64 | if _datas:
65 | return _datas
66 | logging.info(res)
67 |
68 |
69 | def startGame():
70 | url = f"https://payapp.weixin.qq.com/coupon-center-report/statistic/batchreport?session_token={token}"
71 | head = {
72 | "Referer": "https://td.cdn-go.cn/",
73 | "Content-Type": "application/json",
74 | "X-Requested-With": "com.tencent.mm",
75 | }
76 | data = {
77 | "source_scene": "scene",
78 | "device": "DEVICE_ANDROID",
79 | "device_platform": "android",
80 | "device_system": "Android 9",
81 | "device_brand": "OnePlus",
82 | "device_model": "HD1910",
83 | "wechat_version": "8.0.46",
84 | "wxa_sdk_version": "3.3.3",
85 | "wxa_custom_version": "6.49.0",
86 | "event_list": [
87 | {
88 | "event_code": "ActivityGameBegin",
89 | "event_target": str(activity_id),
90 | "intval1": 2,
91 | "strval1": gameId,
92 | }
93 | ],
94 | }
95 | res = requests.post(url=url, headers=head, json=data, timeout=5).json()
96 | logging.info(res)
97 |
98 |
99 | def submitGame(items, score):
100 | url = f"https://payapp.weixin.qq.com/coupon-center-activity/game/report?session_token={token}"
101 | head = {
102 | "Referer": "https://td.cdn-go.cn/",
103 | "Content-Type": "application/json",
104 | "X-Requested-With": "com.tencent.mm",
105 | "charset": "utf-8",
106 | "User-Agent": "Mozilla/5.0 (Linux; Android 11; Redmi Note 8 Pro Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5223 MMWEBSDK/20230701 MMWEBID/2090 MicroMessenger/8.0.40.2420(0x28002837) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
107 | "content-type": "application/json",
108 | "mpm-version": "8.0.46",
109 | }
110 | if module:
111 | data = {
112 | "activity_id": activity_id,
113 | "game_id": gameId,
114 | "game_report_score_info": {
115 | "score_items": items,
116 | "game_score": score,
117 | "total_score": score + pk_f,
118 | },
119 | }
120 | else:
121 | data = {
122 | "activity_id": activity_id,
123 | "game_id": gameId,
124 | "game_report_score_info": {
125 | "score_items": items,
126 | "game_score": score,
127 | "total_score": score,
128 | },
129 | }
130 | res = requests.post(url=url, headers=head, json=data, timeout=5).json()
131 | logging.info(res)
132 |
133 |
134 | def getScore():
135 | url = f"https://payapp.weixin.qq.com/coupon-center-activity/game/get?session_token={token}&activity_id=1000000&game_id={gameId}&sid=a5299654f1f5e423c1fc9757f9bf071d&coutom_version=6.30.6"
136 | head = {
137 | "Referer": "https://td.cdn-go.cn/",
138 | "Content-Type": "application/json",
139 | "X-Requested-With": "com.tencent.mm",
140 | }
141 |
142 | res = requests.get(url=url, headers=head, timeout=5).json()
143 | return res["data"]
144 |
145 |
146 | def getConpun():
147 | url = f"https://payapp.weixin.qq.com/coupon-center-activity/award/obtain?session_token={token}"
148 | head = {
149 | "Referer": "https://td.cdn-go.cn/",
150 | "Content-Type": "application/json",
151 | "X-Requested-With": "com.tencent.mm",
152 | }
153 | data = {
154 | "activity_id": activity_id,
155 | "game_id": gameId,
156 | "obtain_ornament": True,
157 | "request_id": "sd2L5dpgD3196UtSWjtdVhTz2Zs_lryivcmz_" + generate_random_str(4),
158 | "coutom_version": "6.49.0",
159 | }
160 | res = requests.post(url=url, headers=head, json=data, timeout=5).json()
161 | logging.info(res)
162 |
163 |
164 | if __name__ == "__main__":
165 | logging.info('本脚本可跑俩次,一次pk模式和一次正常模式,超出均会系统错误')
166 | head = {
167 | "Referer": "https://td.cdn-go.cn/",
168 | "Content-Type": "application/json",
169 | "X-Requested-With": "com.tencent.mm",
170 | "charset": "utf-8",
171 | "mpm-sdkversion": "3.3.3",
172 | "User-Agent": "Mozilla/5.0 (Linux; Android 11; Redmi Note 8 Pro Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5223 MMWEBSDK/20230701 MMWEBID/2090 MicroMessenger/8.0.40.2420(0x28002837) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
173 | "mpm-model": "Redmi Note 8 Pro",
174 | "wepaytest-proxyip": "",
175 | "mpm-platform": "android",
176 | "mpm-appversion": "6.49.0",
177 | "mpm-sourcescene": "1007",
178 | "mpm-scene": "1007",
179 | "mpm-brand": "Redmi",
180 | "mpm-system": "Android 11",
181 | "content-type": "application/json",
182 | "mpm-version": "8.0.46",
183 | }
184 | # 账号token
185 | token = ''
186 | # 大于多少分提交游戏领取提现券
187 | maxScore = 7373
188 | activity_id = 1000013
189 | # 模式,True为开启pk,False为关闭
190 | module = False
191 | # pk_id
192 | game_pk_id = ''
193 | # pk_id分数
194 | pk_f = 7373
195 | if token == '':
196 | print('请输入token')
197 | exit()
198 | if module:
199 | logging.info('当前为pk模式,如果最后系统错误大概率是pk_id和分数不对应或已领取过pk奖励')
200 | if game_pk_id == '':
201 | print("请输入pk_id和相应分数")
202 | exit()
203 | else:
204 | logging.info('当前为正常模式,如果最后系统错误大概率是已领取过')
205 | while True:
206 | items = []
207 | datas = createGame()
208 | if datas is None:
209 | time.sleep(2)
210 | logging.info("not data sleep 2")
211 | continue
212 | gameId = datas["game_id"]
213 | score = 0
214 | for it in datas["play_script"]["dragon_boat_2023_play_script"]["tracks"]:
215 | for em in it["props"]:
216 | if "score" not in em.keys():
217 | continue
218 | upScore = em["score"]
219 | score = score + upScore
220 |
221 | logging.info(f"预测分数:{score}")
222 | if score < maxScore:
223 | continue
224 | logging.info(f'分数达标,开始玩游戏,请耐心等待。。。')
225 | startGame()
226 | score = 0
227 | for it in datas["play_script"]["dragon_boat_2023_play_script"]["tracks"]:
228 | for em in it["props"]:
229 | if "score" not in em.keys():
230 | continue
231 | upScore = em["score"]
232 | items.append(
233 | {
234 | "prop_id": em["prop_id"],
235 | "award_score": upScore,
236 | "fetch_timestamp_ms": getNowTime(),
237 | }
238 | )
239 | score = score + upScore
240 | time.sleep(0.09)
241 | submitGame(items, score)
242 | scoreItem = getScore()
243 | logging.info(f'分数:{scoreItem["gamer_play_score"]} 游戏id:{scoreItem["game_id"]}')
244 | if module:
245 | txq = scoreItem["gamer_play_score"]+pk_f
246 | else:
247 | txq = scoreItem["gamer_play_score"]
248 | logging.info(f'提现券:{txq}元')
249 | getConpun()
250 | break
251 |
--------------------------------------------------------------------------------
/money.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wdvipa/WeiXinGame/42425145a9a47afa9d2985279c003f7b0a8d7adc/money.jpg
--------------------------------------------------------------------------------