forked from 1053960054/HarbourToulu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jd_jinggengInvite.py
559 lines (541 loc) · 23.6 KB
/
jd_jinggengInvite.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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File: jd_jinggengInvite.py(jinggeng邀请入会有礼)
Author: HarbourJ
Date: 2022/8/1 22:37
TG: https://t.me/HarbourToulu
cron: 1 1 1 1 1 1
new Env('jinggeng邀请入会有礼');
活动入口: https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id=9e80809282a4bdc90182ab254c7e0a12&user_id=1000121005
变量设置: export redis_url="xxx", export redis_port="xxx"(没有可省略), export redis_pwd="xxx"(没有可省略)
export jinggengInviteJoin="9e80809282a4bdc90182ab254c7e0a12&1000121005"(活动id&店铺id)
Update: 2022/11/01 更新入会算法,内置船新入会本地算法
"""
import time, requests, sys, re, os, json, random
from bs4 import BeautifulSoup
from datetime import datetime
from urllib.parse import quote_plus, unquote_plus
from functools import partial
print = partial(print, flush=True)
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
try:
from jd_sign import *
except ImportError as e:
print(e)
if "No module" in str(e):
print("请先运行HarbourJ库依赖一键安装脚本(jd_check_dependent.py),安装jd_sign.so依赖")
sys.exit()
try:
from jdCookie import get_cookies
getCk = get_cookies()
except:
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py")
sys.exit(3)
redis_url = os.environ.get("redis_url") if os.environ.get("redis_url") else "172.17.0.1"
redis_port = os.environ.get("redis_port") if os.environ.get("redis_port") else "6379"
redis_pwd = os.environ.get("redis_pwd") if os.environ.get("redis_pwd") else ""
jinggengInviteJoin = os.environ.get("jinggengInviteJoin") if os.environ.get("jinggengInviteJoin") else ""
inviterNicks = [
"Ny0m1K1tVHIJvt0j4SQ9RbRPXMHHf%2BDrNmMVfT8S5hq3SjYMAACrbEHZQ40J5yPY",
"pWGUWZJQ3actex0X2vQyLsjNhNaYFy2HteErE6izlhTf9nrGY7gBkCdGU4C6z%2FxD",
"3TQTImsIN0s9T85f1wS70V4tLNYA4seuA67MOIYQxEk3Vl9%2BAVo4NF%2BtgyeIc6A6kdK3rLBQpEQH9V4tdrrh0w%3D%3D"
]
if "&" not in jinggengInviteJoin:
print("⚠️jinggengInviteJoin变量有误!退出程序!")
sys.exit()
ac_id = jinggengInviteJoin.split("&")[0]
user_id = jinggengInviteJoin.split("&")[1]
inviterNick = random.choice(inviterNicks)
activity_url = f"https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id={ac_id}&user_id={user_id}&inviterNick={inviterNick}"
print(f"【🛳活动入口】https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id={ac_id}&user_id={user_id}")
def redis_conn():
try:
import redis
try:
pool = redis.ConnectionPool(host=redis_url, port=redis_port, decode_responses=True, socket_connect_timeout=5, password=redis_pwd)
r = redis.Redis(connection_pool=pool)
r.get('conn_test')
print('✅redis连接成功')
return r
except:
print("⚠️redis连接异常")
except:
print("⚠️缺少redis依赖,请运行pip3 install redis")
def getToken(ck, r=None):
try:
# redis缓存Token 活动域名+pt_pin
pt_pin = unquote_plus(re.compile(r'pt_pin=(.*?);').findall(ck)[0])
except:
# redis缓存Token 活动域名+ck前7位(获取pin失败)
pt_pin = ck[:15]
try:
if r is not None:
Token = r.get(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}')
# print("Token过期时间", r.ttl(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}'))
if Token is not None:
print(f"♻️获取缓存Token")
return Token
else:
s.headers = {
'Connection': 'keep-alive',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': '',
'Cookie': ck,
'Host': 'api.m.jd.com',
'Referer': '',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
sign_txt = sign({"url": f"{activityUrl}", "id": ""}, 'isvObfuscator')
# print(sign_txt)
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
if f.status_code != 200:
print(f.status_code)
return
else:
if "参数异常" in f.text:
return
Token_new = f.json()['token']
if r.set(f'{activityUrl.split("https://")[1].split("-")[0]}_{pt_pin}', Token_new, ex=1800):
print("✅Token缓存成功")
else:
print("❌Token缓存失败")
return Token_new
else:
s.headers = {
'Connection': 'keep-alive',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': '',
'Cookie': ck,
'Host': 'api.m.jd.com',
'Referer': '',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
sign_txt = sign({"url": f"{activityUrl}", "id": ""}, 'isvObfuscator')
# print(sign_txt)
f = s.post('https://api.m.jd.com/client.action', verify=False, timeout=30)
if f.status_code != 200:
print(f.status_code)
return
else:
if "参数异常" in f.text:
return
Token = f.json()['token']
print(f"✅获取实时Token")
return Token
except:
return
def getJdTime():
url = "http://api.m.jd.com/client.action?functionId=queryMaterialProducts&client=wh5"
headers = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Host': 'api.m.jd.com',
'Proxy-Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'
}
try:
response = requests.request("GET", url, headers=headers, timeout=2)
if response.status_code == 200:
res = response.json()
jdTime = res['currentTime2']
except:
jdTime = int(round(time.time() * 1000))
return jdTime
def randomString(e, flag=False):
t = "0123456789abcdef"
if flag: t = t.upper()
n = [random.choice(t) for _ in range(e)]
return ''.join(n)
def refresh_cookies(res):
if res.cookies:
cookies = res.cookies.get_dict()
set_cookie = [(set_cookie + "=" + cookies[set_cookie]) for set_cookie in cookies]
global activityCookie
activityCookieMid = [i for i in activityCookie.split(';') if i != '']
for i in activityCookieMid:
for x in set_cookie:
if i.split('=')[0] == x.split('=')[0]:
if i.split('=')[1] != x.split('=')[1]:
activityCookieMid.remove(i)
activityCookie = ''.join(sorted([(set_cookie + ";") for set_cookie in list(set(activityCookieMid + set_cookie))]))
def getActivity(index=1, isOpenCard=0, inviterCode=None, getIndex=0):
url = f"{activityUrl}&isOpenCard={isOpenCard}&from=kouling"
if len(token) == 0:
IsvToken = ''
else:
IsvToken = f"IsvToken={token};"
headers = {
'Host': 'jinggeng-isv.isvjcloud.com',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'User-Agent': ua,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Referer': url,
'Cookie': IsvToken + activityCookie
}
response = requests.request("GET", url, headers=headers)
html_text = response.text
if response.status_code == 493:
print(response.status_code, "⚠️ip疑似黑了,休息一会再来撸~")
sys.exit()
# if response.cookies:
cookies = response.cookies.get_dict()
set_cookies = [(set_cookie + "=" + cookies[set_cookie]) for set_cookie in cookies]
set_cookie = ''.join(sorted([(set_cookie + ";") for set_cookie in set_cookies]))
if getIndex == 3:
return set_cookie
if "活动时间" in html_text:
refresh_cookies(response)
soup = BeautifulSoup(html_text, 'html.parser')
errorMsg = soup.find('input', attrs={'id': 'errorMsg'})['value']
inviteSucc = soup.find('input', attrs={'id': 'inviteSucc'})['value']
if len(errorMsg) != 0:
errorMsg0 = errorMsg
if len(inviteSucc) != 0:
errorMsg0 = inviteSucc
if index == 1:
if getIndex == 2:
pass
shop_title = soup.find('input', attrs={'id': 'shop_title'})['value'].replace(' ', '')
actName = soup.find('input', attrs={'id': 'actName'})['value']
shop_sid = soup.find('input', attrs={'id': 'shop_sid'})['value']
inviteSuccNums = (soup.find('input', attrs={'id': 'helpLogs'})['value'])
inviteSetting2s = eval(soup.find('input', attrs={'id': 'inviteSetting2'})['value'])
print(f"店铺名称: {shop_title} \n活动名称: {actName} \n店铺ID: {shop_sid}")
num1 = {'1': 'one', '2': 'two', '3': 'three', '4': 'four'}
num2 = {'1': 'leveOneNum', '2': 'leveTwoNum', '3': 'leveThreeNum', '4': 'leveFourNum'}
needInviteNums = []
for a in range(len(inviteSetting2s)):
b = a + 1
inviteSetting2 = inviteSetting2s[num1[str(b)]]
# equityEndTime = inviteSetting2['equityEndTime']
freezeQuantity = inviteSetting2['freezeQuantity']
availableQuantity = inviteSetting2['availableQuantity']
equityType = inviteSetting2['equityType']
equityName = inviteSetting2['equityName']
leveNum = inviteSetting2[num2[str(b)]]
if equityType == "JD_GOODS":
denomination = ''
else:
denomination = inviteSetting2['denomination']
awardId = inviteSetting2['id']
# inviteSucc = soup.find('input', attrs={'id': 'inviteSucc'})['value']
print(f"奖品{b}: {equityName} 奖励: {denomination} 总数: {freezeQuantity}份 剩余: {availableQuantity}份 需要邀请: {leveNum}人")
if availableQuantity > 0:
needInviteNums.append((leveNum, awardId, equityType))
if len(needInviteNums) == 0:
print(f"⛈⛈⛈活动奖品全部发完啦!")
sys.exit()
return errorMsg, inviteSuccNums, needInviteNums
return errorMsg0
elif "活动已结束" in html_text:
print("😭活动已结束,下次早点来~")
sys.exit()
else:
return set_cookie
def setMixNick(token):
url = "https://jinggeng-isv.isvjcloud.com/front/setMixNick"
payload = f"strTMMixNick={token}&userId={user_id}&source=01"
headers = {
'Host': 'jinggeng-isv.isvjcloud.com',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'https://jinggeng-isv.isvjcloud.com',
'User-Agent': ua,
'Connection': 'keep-alive',
'Referer': f'{activityUrl}&isOpenCard=0&from=kouling',
'Content-Length': '116',
'Cookie': activityCookie
}
try:
response = requests.request("POST", url, headers=headers, data=payload)
res = response.text
setMixNick0 = eval(res.replace('true', 'True').replace('false', 'False').replace('none', 'None'))['msg']
refresh_cookies(response)
return setMixNick0
except Exception as e:
print(e)
return
def recordActPvUvdata(token):
url = "https://jinggeng-isv.isvjcloud.com/ql/front/reportActivity/recordActPvUvData"
payload = F"userId={user_id}&actId={ac_id}"
headers = {
'Host': 'jinggeng-isv.isvjcloud.com',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'https://jinggeng-isv.isvjcloud.com',
'User-Agent': ua,
'Connection': 'keep-alive',
'Referer': f'{activityUrl}&isOpenCard=0&from=kouling',
'Content-Length': '56',
'Cookie': f"IsvToken={token};" + activityCookie
}
response = requests.request("POST", url, headers=headers, data=payload)
refresh_cookies(response)
def checkTokenInSession(token):
url = "https://jinggeng-isv.isvjcloud.com/front/checkTokenInSession"
payload = f"userId={user_id}&token={token}"
headers = {
'Host': 'jinggeng-isv.isvjcloud.com',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'https://jinggeng-isv.isvjcloud.com',
'User-Agent': ua,
'Connection': 'keep-alive',
'Referer': f'{activityUrl}&isOpenCard=0&from=kouling',
'Content-Length': '99',
'Cookie': activityCookie
}
response = requests.request("POST", url, headers=headers, data=payload)
refresh_cookies(response)
def shopmember(cookie):
url = f'https://shopmember.m.jd.com/shopcard/?venderId={user_id}&channel=401&returnUrl={quote_plus(activityUrl + "&isOpenCard=1")}'
headers = {
'Host': 'shopmember.m.jd.com',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Connection': 'keep-alive',
'Cookie': cookie,
'User-Agent': ua,
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Referer': 'https://jinggeng-isv.isvjcloud.com/',
'Accept-Encoding': 'gzip, deflate, br'
}
requests.request("GET", url, headers=headers)
def bindWithVender(cookie):
try:
s.headers = {
'Connection': 'keep-alive',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': ua,
'Cookie': cookie,
'Host': 'api.m.jd.com',
'Referer': f'https://shopmember.m.jd.com/shopcard/?venderId={user_id}&returnUrl={quote_plus(activityUrl + "&isOpenCard=1")}',
'Accept-Language': 'zh-Hans-CN;q=1 en-CN;q=0.9',
'Accept': '*/*'
}
s.params = {
'appid': 'jd_shop_member',
'functionId': 'bindWithVender',
'body': json.dumps({
'venderId': user_id,
'shopId': user_id,
'bindByVerifyCodeFlag': 1
}, separators=(',', ':'))
}
res = s.post('https://api.m.jd.com/', verify=False, timeout=30).json()
if res['success']:
if "火爆" in res['message'] or "失败" in res['message']:
print(f"\t⛈⛈⛈{res['message']}")
else:
print(f"\t🎉🎉🎉{res['message']}")
return res['message']
except Exception as e:
print(e)
def receiveInviteJoinAward(token, awardId):
url = "https://jinggeng-isv.isvjcloud.com/ql/front/receiveInviteJoinAward"
payload = f"act_id={ac_id}&user_id={user_id}&awardId={awardId}"
headers = {
'Host': 'jinggeng-isv.isvjcloud.com',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'https://jinggeng-isv.isvjcloud.com',
'User-Agent': ua,
'Connection': 'keep-alive',
'Referer': f'{activityUrl}&isOpenCard=0&from=kouling&sid=09a25fb32a08d0b0fbdef65ab52a40dw&un_area=15_1213_1215_50108',
'Content-Length': '99',
'Cookie': f"IsvToken={token};" + activityCookie
}
response = requests.request("POST", url, headers=headers, data=payload).text
res = eval(response.replace('true', 'True').replace('false', 'False').replace('none', 'None'))
if res['succ'] is True:
msg = eval(str(res['msg']).replace('\\\\', ''))
if msg['isSendSucc']:
awardType = msg['drawAwardDto']['awardType'].replace('JD_BEAN', '京豆').replace('JD_POINT', '积分')
awardDenomination = msg['drawAwardDto']['awardDenomination']
print(f"\t🎉🎉成功领取{awardDenomination}{awardType}")
else:
print(f"\t🎉🎉{res['msg']}")
if __name__ == '__main__':
r = redis_conn()
try:
cks = getCk
if not cks:
sys.exit()
except:
print("未获取到有效COOKIE,退出程序!")
sys.exit()
global inviterCode, inviteSuccNums, activityUrl, needInviteNums, rewardIndex, firstCk
inviteSuccNums = 0
inviterCode = inviterNick
activityUrl = activity_url
needInviteNums = None
rewardIndex = 0
num = 0
for cookie in cks:
num += 1
if num == 1:
firstCk = cookie
if num % 5 == 0:
print("⏰等待5s")
time.sleep(5)
global ua, activityCookie, token, getIndex
getIndex = 0
ua = userAgent()
try:
pt_pin = re.compile(r'pt_pin=(.*?);').findall(cookie)[0]
pt_pin = unquote_plus(pt_pin)
except IndexError:
pt_pin = f'用户{num}'
print(f'\n******开始【京东账号{num}】{pt_pin} *********\n')
print(datetime.now())
token = ''
activityCookie = ''
activityCookie = getActivity(num, 0, inviterCode, 0)
try:
token = getToken(cookie, r)
if token is None:
if num == 1:
print(f"⚠️车头获取Token失败,退出本程序!")
# sys.exit()
os._exit()
print(f"⚠️获取Token失败!⏰等待3s")
time.sleep(3)
continue
except:
print(f"⚠️获取Token失败!⏰等待3s")
time.sleep(3)
continue
time.sleep(1.5)
setMixNick0 = setMixNick(token)
if setMixNick0 is None:
if num == 1:
print(f"⚠️车头获取邀请码失败,退出本程序!")
sys.exit()
else:
continue
else:
print(f"邀请码->: {setMixNick0}")
time.sleep(1)
print(f"准备助力-->: {inviterCode}")
inviteSuccNum = getActivity(num, 0, inviterCode, 1)
if num == 1:
errorMsg0 = inviteSuccNum[0]
if "跳开卡页面" not in errorMsg0:
print("无法助力自己")
inviteSuccNums0 = inviteSuccNum[1]
needInviteNums = inviteSuccNum[2]
inviteSuccNums = len(eval(inviteSuccNums0))
print(f"🛳已经邀请{inviteSuccNums}人")
for i, needNum0 in enumerate(needInviteNums):
needNum = needNum0[0]
awardId = needNum0[1]
equityType = needNum0[2]
if inviteSuccNums >= needNum:
print(f"🎉恭喜已完成第{i + 1}档邀请,快去领奖吧!")
time.sleep(1)
recordActPvUvdata(token)
checkTokenInSession(token)
time.sleep(1)
if equityType == "JD_GOODS":
print(f"\t🎉🎉成功获得实物奖励,请尽快前往领取:{activityUrl}")
else:
receiveInviteJoinAward(token, awardId)
rewardIndex += 1
time.sleep(3)
if i + 1 == len(needInviteNums):
print("🎉🎉🎉奖励全部领取完毕~")
sys.exit()
time.sleep(1)
inviterCode = setMixNick0
activityUrl = f"https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id={ac_id}&user_id={user_id}&inviterNick={inviterCode}"
continue
else:
errorMsg1 = inviteSuccNum
# print("num != 1", errorMsg1)
if "跳开卡页面" not in errorMsg1:
if "已成功邀请您加入本店会员" in errorMsg1:
print("⛈已经是会员了,无法完成助力")
else:
print(f"🛳{errorMsg1}")
time.sleep(1)
continue
time.sleep(1.5)
recordActPvUvdata(token)
checkTokenInSession(token)
time.sleep(1)
shopmember(cookie)
print("现在去开卡")
open_result = bindWithVender(cookie)
if open_result is not None:
if "火爆" in open_result or "失败" in open_result:
time.sleep(1.5)
print("\t尝试重新入会 第1次")
open_result = bindWithVender(cookie)
if "火爆" in open_result or "失败" in open_result:
time.sleep(1.5)
print("\t尝试重新入会 第2次")
open_result = bindWithVender(cookie)
time.sleep(1)
if num == 1:
getIndex = 2
errorMsg2 = getActivity(num, 1, inviterCode, getIndex)
time.sleep(2)
recordActPvUvdata(token)
checkTokenInSession(token)
# print(errorMsg2, '============================')
if num == 1 and "开卡失败" in errorMsg2:
print(f"⚠️车头疑似火爆号,退出本程序!")
sys.exit()
if "已成功邀请您加入本店会员" in errorMsg2:
inviteSuccNums += 1
print(f"🛳已经邀请{inviteSuccNums}人")
for i, needNum1 in enumerate(needInviteNums):
needNum = needNum1[0]
awardId = needNum1[1]
equityType = needNum1[2]
if inviteSuccNums >= needNum:
if rewardIndex >= i + 1:
time.sleep(1)
continue
print(f"🎉恭喜已完成第{i + 1}档邀请,快去领奖吧!")
token = getToken(firstCk, r)
activityCookie = getActivity(1, 0, inviterCode, 3)
setMixNick(token)
time.sleep(0.5)
recordActPvUvdata(token)
time.sleep(0.5)
if equityType == "JD_GOODS":
print(f"\t🎉🎉成功获得实物奖励,请尽快前往领取:{activityUrl}")
else:
receiveInviteJoinAward(token, awardId)
rewardIndex += 1
time.sleep(3)
if i + 1 == len(needInviteNums):
print("🎉🎉🎉奖励全部领取完毕~")
sys.exit()
if num == 1:
inviterCode = setMixNick0
activityUrl = f"https://jinggeng-isv.isvjcloud.com/ql/front/showInviteJoin?id={ac_id}&user_id={user_id}&inviterNick={inviterCode}"
time.sleep(3)