-
Notifications
You must be signed in to change notification settings - Fork 16
/
taipingtong.py
448 lines (432 loc) · 19.5 KB
/
taipingtong.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
#抓这个ecustomer.cntaiping.com域名下的x-ac-token-ticket 一天多运行几次吧 后面加兑换
#备注名&x-ac-token-ticket 多账号换行
#变量名taipingtong
import time
import os
import random
import requests
import datetime
ck = os.environ.get("taipingtong")
kqid = 66 #1元e卡id
class TPT:
def __init__(self):
self.accounts_list = ck.strip().split('\n')
self.num_of_accounts = len(self.accounts_list)
print(f'NONE益达,共找到{self.num_of_accounts}个账号,开始运行\n')
def run(self):
for i, account in enumerate(self.accounts_list, start=1):
try:
name, ck = account.split('&')
except ValueError:
print("输入数据格式不正确,请检查输入并重新尝试。")
# 添加适当的处理逻辑,比如给 name 和 ck 赋予默认值或者提示用户重新输入
self.headers = {
'Host': 'ecustomer.cntaiping.com',
'Accept': 'application/json;charset=UTF-8',
'x-ac-token-ticket': ck,
'x-ac-channel-id': 'KHT',
'Accept-Language': 'zh-cn',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json',
'Origin': 'https://ecustomercdn.itaiping.com',
'Content-Length': '39',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/77777;yuangongejia#ios#kehutong#CZBIOS',
'Referer': 'https://ecustomercdn.itaiping.com/',
'x-ac-mc-type': 'gateway.user',
'Connection': 'keep-alive'
}
self._headers = {
'Host': 'ecustomer.cntaiping.com',
'Accept': 'application/json, text/plain, */*',
'API-TOKEN': ck,
'Accept-Language': 'zh-cn',
'Content-Type': 'application/json;charset=utf-8',
'Origin': 'https://ecustomercdn.itaiping.com',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/77777;yuangongejia#ios#kehutong#CZBIOS',
'Connection': 'keep-alive',
'Referer': 'https://ecustomercdn.itaiping.com/',
'ENV': 'app',
}
print(f"==============开始执行账号{i}==============")
if self.login(name, ck):
self.process_account(name, ck)
print(f"==============运行结束==============")
def login(self,name, ck):
url = "https://ecustomer.cntaiping.com/campaignsms/integral/queryIntegralDetailList"
json_data = {
'pageNo': 1,
'pageSize': 10,
'typePo': '3',
}
response = requests.post(url, headers=self.headers ,json=json_data)
f = response.json()
#print(response.text)
if f['success'] == True:
print(f"{name}: 登录成功")
time.sleep(2)
a = f['data']['list']
if a is not None:
for b in a:
effectDate = b['effectDate']
memo = b['memo']
overDate = b['overDate']
num = b['num']
createTime = b['createTime']
print(f"{memo}[{num}]-有效期[{createTime}]")
return True
else:
print(f"{name}: 登录失败,{f['msg']}")
return False
def process_account(self, name ,ck):
Surl = "https://ecustomer.cntaiping.com/campaignsms/couponAndsign"
_S = {}
print(f"==============每日签到==============")
response = requests.post(Surl, headers=self.headers , json=_S)
# print(response.text)
s = response.json()
if s['success'] == True:
message = s['data']['dailySignRsp']['message']
integralSend = s['data']['dailySignRsp']['integralSend']
self.integral = s['data']['dailySignRsp']['integral']
print(f"签到-{message}[{integralSend}]-当前有{self.integral}金币")
else:
print(f"签到失败,{s['msg']}")
Turl = "https://ecustomer.cntaiping.com/campaignsms/goldParty/task/list"
_T = {
'activityNumber': 'goldCoinParty',
'rewardFlag': '1',
'openMsgRemind': 0,
}
print(f"==============日常任务==============")
response = requests.post(Turl, headers=self.headers ,json=_T)
t = response.json()
if t['success'] == True:
c = t['data']['taskList']
for d in c :
_taskId = d['taskId']
_name = d['name']
time.sleep(4)
print(f"去完成{_name}任务")
Gurl = "https://ecustomer.cntaiping.com/campaignsms/goldParty/task/finish"
_G = {
'taskIds': [
_taskId,
],
}
response = requests.post(Gurl, headers=self.headers ,json=_G)
g = response.json()
#print(response.text)
if g['success'] == True:
print(f"完成{_name}任务成功")
else:
print(f"完成{_name}任务失败,{g['msg']}")
time.sleep(3)
Aurl = "https://ecustomer.cntaiping.com/campaignsms/goldParty/goldCoin/add"
_A = {
'taskIds': [
_taskId,
],
}
response = requests.post(Aurl, headers=self.headers ,json=_A)
a = response.json()
#print(response.text)
if a['success'] == True:
print(f"领取{_name}任务奖励成功")
else:
print(f"领取{_name}任务奖励失败,{a['msg']}")
else:
print(f"获取任务失败,{d['msg']}")
Murl = "https://ecustomer.cntaiping.com/informationms/app/config/get/1"
_M = {
"plugInId" : "701b3099297148a8ba979ad9c982b561",
"trackDesc" : "赚金币任务",
"city" : "1",
"pageSize" : 10,
"type" : "GENERAL_PLUGIN"
}
print(f"==============日常阅读==============")
response = requests.post(Murl, headers=self.headers ,json=_M)
m = response.json()
if m['success'] == True:
v = m['data']
for item in v:
cell_data = item['cell']['0'][0]
_title = cell_data['title']
_contentId = cell_data['contentId']
print(f"去阅读[{_title}]")
self.l = random.uniform(5, 6)
time.sleep(self.l)
Qurl = "https://ecustomer.cntaiping.com/informationms/app/v2/article/web/coinInfoV2"
_Q = {
'articleId': _contentId,
'source': 'TPT',
'detailUrl': f'https://ecustomercdn.itaiping.com/static/newscontent/#/info?articleId={_contentId}&source=TPT&x_utmId=10013&x_businesskey=articleId',
'deviceId': '',
'version': 'V2',
}
response = requests.post(Qurl, headers=self.headers ,json=_Q)
q = response.json()
if q['success'] == True:
self.p = q['data']['countDownCoinInfo']['coinNum']
# print(f"阅读[{_title}]成功获得{p}金币")
pass
else:
print(f"进入阅读[{_title}奖励失败,{p['msg']}]")
time.sleep(self.l)
Kurl = "https://ecustomer.cntaiping.com/informationms/app/v2/read/gold"
_K = {
"articleId": _contentId,
"source" : "TPT"
}
response = requests.post(Kurl, headers=self.headers ,json=_K)
k = response.json()
if k['success'] == True:
w = k['data']['coinTrackDto']['title']
print(f"阅读[{w}]成功获得{self.p}金币")
else:
print(f"阅读[{_title}失败,{k['msg']}]")
else:
print(f"阅读[{_title}]失败,{m['msg']}")
Zurl = "https://ecustomer.cntaiping.com/campaignsms/coinBubble/getAllCoins"
_Z = {}
print(f"==============领取阅读奖励==============")
response = requests.post(Zurl, headers=self.headers ,json=_Z)
z = response.json()
# print(response.text)
if z['success'] == True:
coinNum = z['data']['coinNum']
print(f"领取阅读奖励-{coinNum}金币")
else:
print(f"领取阅读奖励失败,{z['msg']}")
print(f"==============兑换卡券==============")
Qurl = "https://ecustomer.cntaiping.com/campaignsms/coin/exchange/receive"
_Q = {
'id': kqid,
}
response = requests.post(Qurl, headers=self.headers ,json=_Q)
q = response.json()
# print(response.text)
if q['success'] == True:
couponId = q['data']['couponId']
print(f"卡券兑换成功-{couponId}")
else:
print(f"卡券兑换失败,{q['msg']}")
print(f"==============水滴浇树==============")
#新人奖励
yurl = "https://ecustomer.cntaiping.com/love-tree/v2/api/task/complete-newcomer-water"
_y = {
"tid" : 1
}
response = requests.post(yurl, headers=self._headers ,json=_y)
y = response.json()
# print(response.text)
if y['code'] == 200:
water = y['data']['water']
print(f"完成新人奖励成功,获得了{water}水滴")
else:
print(f"完成新人奖励失败,{y['msg']}")
#每月登录奖励
time.sleep(2)
murl = "https://ecustomer.cntaiping.com/love-tree/v2/api/task/complete-task"
_m = {
"type" : 14
}
response = requests.post(murl, headers=self._headers ,json=_m)
m = response.json()
# print(response.text)
if m['code'] == 200:
water = m['data']['water']
print(f"完成每月登录奖励成功,获得了{water}水滴")
else:
print(f"完成每月登录奖励失败,{m['msg']}")
#查保单领水滴奖励
time.sleep(2)
curl = "https://ecustomer.cntaiping.com/love-tree/v2/api/task/complete-link-task"
_c = {
"tid" : 15
}
response = requests.post(curl, headers=self._headers ,json=_c)
c = response.json()
# print(response.text)
if c['code'] == 200:
water = c['data']['water']
print(f"完成查保单领水滴奖励成功,获得了{water}水滴")
else:
print(f"完成查保单领水滴奖励失败,{c['msg']}")
#三餐福袋奖励
time.sleep(2)
surl = "https://ecustomer.cntaiping.com/love-tree/v2/api/task/complete-red-envelope"
_s = {
"tid" : 3
}
response = requests.post(surl, headers=self._headers ,json=_s)
s = response.json()
# print(response.text)
if s['code'] == 200:
water = s['data']['water']
print(f"完成三餐福袋奖励成功,获得了{water}水滴")
else:
print(f"完成三餐福袋奖励失败,{s['msg']}")
#获取关关注id
for i in range(6):
time.sleep(2)
gurl = "https://ecustomer.cntaiping.com/userms/serviceAccount/queryAllServiceAccount/v1"
_g = {
"pageSize" : "15",
"page" : "1"
}
response = requests.post(gurl, headers=self._headers ,json=_g)
g = response.json()
# print(response.text)
if g['success'] == True:
#wzid = random.choice(g['data']['contents'])['id']
self.wzid = random.choice(g['data']['contents'])['id']
print(f"随机获取关注ID成功[{self.wzid}]")
time.sleep(2)
furl = "https://ecustomer.cntaiping.com/userms/serviceAccount/subscribe"
_f = {
"serviceAccountId" : self.wzid
}
response = requests.post(furl, headers=self.headers ,json=_f)
f = response.json()
#print(response.text)
if f['success'] == True:
pass
else:
print(f"关注文章失败,{f['msg']}")
break
time.sleep(2)
jurl = "https://ecustomer.cntaiping.com/love-tree/v2/api/task/get-task-result"
_j = {}
response = requests.post(jurl, headers=self._headers ,json=_j)
j = response.json()
#print(response.text)
if j['code'] == 200:
data = j['data']
if j['data'] and len(j['data']) > 0:
water = j['data'][0]['water']
print(f"完成关注太平通服务号成功获得了{water}水滴")
else:
print(f"完成关注太平通服务号未获得水滴")
else:
print(f"完成关注太平通服务号失败,{j['msg']}")
break
else:
print(f"获取文章ID失败,{g['msg']}")
break
#文章id
time.sleep(2)
hurl = "https://ecustomer.cntaiping.com/informationms/app/config/get/1"
_h = {
"plugInId" : "701b3099297148a8ba979ad9c982b561",
"trackDesc" : "赚金币任务",
"city" : "1",
"pageSize" : 10,
"type" : "GENERAL_PLUGIN"
}
response = requests.post(hurl, headers=self._headers ,json=_h)
q = response.json()
# print(response.text)
if q['success'] == True:
yd = q['data']
for item in yd:
_data = item['cell']['0'][0]
_serviceNo = _data['serviceNo']
contentId = _data['contentId']
print(f"文章ID成功[{_serviceNo}]-[{contentId}]")
time.sleep(2)
gurl = "https://ecustomer.cntaiping.com/informationms/app/v2/article/web/coinInfoV2"
_g = {
"detailUrl" : f'https://ecustomercdn.itaiping.com/static/newscontent/#/info?articleId={contentId}&source=TPT&x_utmId=10013&x_businesskey=articleId',
"deviceId" : "",
"version" : "V2",
"source" : "TPT",
"articleId" : contentId
}
response = requests.post(gurl, headers=self.headers ,json=_g)
g = response.json()
#print(response.text)
if g['success'] == True:
pass
else:
print(f"阅一读文章失败,{g['msg']}")
time.sleep(2)
vurl = "https://ecustomer.cntaiping.com/userms/serviceAccount/queryBasic"
_v = {
"id" : _serviceNo
}
response = requests.post(vurl, headers=self.headers ,json=_v)
v = response.json()
#print(response.text)
if v['success'] == True:
pass
else:
print(f"阅二读文章失败,{v['msg']}")
time.sleep(2)
lurl = "https://ecustomer.cntaiping.com/informationms/app/v2/read/gold"
_l = {
"articleId" : contentId,
"source" : "TPT"
}
response = requests.post(lurl, headers=self.headers ,json=_l)
l = response.json()
#print(response.text)
if l['success'] == True:
self.LL = l['data']['coinTrackDto']['title']
print(f"阅三读[{self.LL}]成功")
else:
print(f"阅读文章失败,{l['msg']}")
break
time.sleep(2)
durl = "https://ecustomer.cntaiping.com/love-tree/v2/api/task/get-task-result"
_d = {}
response = requests.post(durl, headers=self._headers ,json=_d)
d = response.json()
print(response.text)
#data = d['data']
if d['data'] and len(d['data']) > 0:
water = d['data'][0]['water']
print(f"完成阅读{self.LL}成功获得了{water}水滴")
else:
print(f"完成阅读[{self.LL}]未获得水滴")
else:
print(f"获取阅读文章ID失败,{q['msg']}")
#break
lurl = "https://ecustomer.cntaiping.com/love-tree/v2/api/user/open-welfare_box"
_l = {
"tree_user_id" : 256533
}
response = requests.post(lurl, headers=self._headers ,json=_l)
l = response.json()
# print(response.text)
if l['code'] == 200:
sd = y['data']['water']
print(f"领取神秘宝箱成功!获得了{sd}水滴")
else:
print(f"领取神秘宝箱失败,{l['msg']}")
yurl = "https://ecustomer.cntaiping.com/love-tree/v2/api/user/home"
print(f"==============查询水滴==============")
response = requests.get(yurl, headers=self._headers)
y = response.json()
# print(response.text)
if y['code'] == 200:
mwater = y['data']['water']
jscs = mwater // 50
print(f"查询当前有{mwater}水滴可以浇水{jscs}次")
for i in range(jscs):
time.sleep(2)
kurl = "https://ecustomer.cntaiping.com/love-tree/v2/api/tree/watering"
_k = {
"tree_user_id" : 256533
}
response = requests.post(kurl, headers=self._headers ,json=_k)
k = response.json()
if k['code'] == 200:
sy_water = k['data']['sy_water']
print(f"浇水成功!还剩余{sy_water}水滴")
else:
print(f"浇水失败,{k['msg']}")
else:
print(f"查询水滴失败,{y['msg']}")
tpt = TPT()
tpt.run()