-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathsfsy.py
More file actions
1733 lines (1645 loc) · 78.4 KB
/
sfsy.py
File metadata and controls
1733 lines (1645 loc) · 78.4 KB
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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding=UTF-8 -*-
# @Project QL_TimingScript
# @fileName sfsy.py
# @author Echo
# @EditTime 2025/3/19
# cron: 0 10,15,18 * * *
# const $ = new Env("顺丰速运");
"""
开启抓包,小程序-我的-积分
抓 https://mcs-mimp-web.sf-express.com/mcs-mimp/share/weChat/activityRedirect?source=xxxxxxxxxxxx
将整个url地址填入变量sfsy_url
本脚本收集来自https://github.com/arvinsblog/deepsea
"""
import asyncio
import hashlib
import json
import random
import time
from datetime import datetime
import httpx
from fn_print import fn_print
from get_env import get_env
from sendNotify import send_notification_message_collection
sfsy_tokens = get_env("sfsy_url", "\n")
inviteId = [
'7B0443273B2249CB9CDB7B48B94DEC13', '809FAF1E02D045D7A0DB185E5C91CFB1', '',
'', '']
class Sfsy:
def __init__(self, url_info: str, index):
self.today = datetime.now().strftime("%Y-%m-%d")
self.user = None
self.send_uid = None
self.anniversary_black = False
self.member_day_black = False
self.member_day_red_packet_drew_today = False
self.member_day_red_packet_map = {}
self.answer = False
self.max_level = 8
self.packet_threshold = 1 << (self.max_level - 1)
self.client = httpx.AsyncClient(
verify=False,
timeout=60
)
url_info_list = url_info.split("@")
url_info_list_len = len(url_info_list)
self.url = url_info_list[0]
last_url_info = url_info_list[url_info_list_len - 1]
if url_info_list_len > 0 and "UID_" in last_url_info:
self.send_uid = last_url_info
self.index = index + 1
self.headers = {
'Host': 'mcs-mimp-web.sf-express.com',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090551) XWEB/6945 Flue',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'sec-fetch-site': 'none',
'sec-fetch-mode': 'navigate',
'sec-fetch-user': '?1',
'sec-fetch-dest': 'document',
'accept-language': 'zh-CN,zh',
'platform': 'MINI_PROGRAM',
}
self.get_sign()
async def generate_device_id(self, characters='abcdef0123456789'):
template = 'xxxxxxxx-xxxx-xxxx'
return ''.join(
random.choice(characters) if c == 'x' else
random.choice(characters).upper() if c == 'X' else
c
for c in template
)
async def login(self):
await self.client.get(self.url, headers=self.headers)
self.user_id = self.client.cookies.get("_login_user_id_", "")
self.phone = self.client.cookies.get("_login_mobile_", "")
self.mobile = self.phone[:3] + "*" * 4 + self.phone[7:]
if self.phone != "":
fn_print(f"用户【{self.phone}】 - 登录成功!✔️")
return True
else:
fn_print(f"用户【{self.phone}】 - 登录失败!❌")
return False
def get_sign(self):
timestamp = str(int(round(time.time() * 1000)))
token = 'wwesldfs29aniversaryvdld29'
sysCode = 'MCS-MIMP-CORE'
data = f'token={token}×tamp={timestamp}&sysCode={sysCode}'
signature = hashlib.md5(data.encode()).hexdigest()
data = {
'sysCode': sysCode,
'timestamp': timestamp,
'signature': signature
}
self.headers.update(data)
return data
async def sign_in(self):
"""
签到
:return:
"""
fn_print(">>> 开始签到...")
response = await self.client.post(
url='https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~integralTaskSignPlusService~automaticSignFetchPackage',
headers=self.headers,
json={
"comeFrom": "vioin",
"channelFrom": "WEIXIN"
}
)
if response.status_code == 200:
data = response.json()
if data.get("success"):
days = data.get("obj", {}).get("ountDay", 0)
if data.get("obj") and data.get("obj").get("integralTaskSignPackageVOList"):
reward_name = data["obj"]["integralTaskSignPackageVOList"][0]["packetName"]
fn_print(f">>> 用户【{self.phone}】 - 签到成功!✔️ - 获得【{reward_name}】, 本周累计签到{days}天")
else:
fn_print(f">>> 用户【{self.phone}】 - 今日已签到!✖️ - 本周累计签到{days + 1}天")
else:
fn_print(f">>> 用户【{self.phone}】 - 签到失败!❌ - {data.get('errorMessage')}")
else:
fn_print(">>> 用户【{self.phone}】 - 签到异常!‼️")
async def super_welfare_benefit_sign_in(self):
"""
超值福利签到
:return:
"""
fn_print(">>> 超值福利签到...")
try:
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberActLengthy~redPacketActivityService~superWelfare~receiveRedPacket",
headers=self.headers,
json={'channel': 'czflqflqdlhbxcx'}
)
data = response.json()
if data.get("success"):
gift_list = data.get("obj", {}).get("giftList", [])
if gift_list is None:
gift_list = []
if data.get("obj", {}).get("extraGiftList", []):
extra_gift_list = data.get("obj", {}).get("extraGiftList", [])
if extra_gift_list is not None:
gift_list.extend(extra_gift_list)
gift_name = ",".join([gift["giftName"] for gift in gift_list])
receive_status = data.get("obj", {}).get("receiveStatus")
status_msg = "领取成功" if receive_status == 1 else "已经领取过"
fn_print(f">>> 用户【{self.phone}】 - 超值福利签到成功!✔️ - {status_msg} - 【{gift_name}】")
else:
error_message = data.get('errorMessage') or json.dumps(data) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 超值福利签到失败!❌ - {error_message}")
except Exception as e:
fn_print(f">>> 用户【{self.phone}】 - 签到异常!‼️ - {e}")
async def get_task_list(self, flag=False):
"""
获取任务列表
:param flag:
:return:
"""
if not flag: fn_print(">>> 获取任务列表...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~integralTaskStrategyService~queryPointTaskAndSignFromES",
headers=self.headers,
json={
'channelType': '1',
'deviceId': await self.generate_device_id()
}
)
data = response.json()
if data.get("success") and data.get("obj") != []:
total_point = data.get("obj").get("totalPoint")
if flag:
fn_print(f">>> 用户【{self.phone}】 - 当前积分:{total_point}")
return data["obj"]["taskTitleLevels"]
async def do_task(self):
"""
完成任务
:return:
"""
fn_print(f">>> 用户【{self.phone}】 - 前往完成【{self.title}】任务...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonRoutePost/memberEs/taskRecord/finishTask",
headers=self.headers,
json={'taskCode': self.task_code}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】完成成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】完成失败!❌ - {data.get('errorMessage')}")
async def receive_task(self):
"""
领取任务奖励
:return:
"""
fn_print(f">>> 用户【{self.phone}】 - 前往领取{self.title}任务奖励...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~integralTaskStrategyService~fetchIntegral",
headers=self.headers,
json={
"strategyId": self.strategy_id,
"taskId": self.task_id,
"taskCode": self.task_code,
"deviceId": await self.generate_device_id()
}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】奖励领取成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】奖励领取失败!❌ - {data.get('errorMessage')}")
async def processe_tasks(self):
tasks = await self.get_task_list()
for task in tasks:
self.task_id = task["taskId"]
self.task_code = task["taskCode"]
self.strategy_id = task["strategyId"]
self.title = task["title"]
status = task["status"]
skip_keys = ['用行业模板寄件下单', '去新增一个收件偏好', '参与积分活动']
if status == 3:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】 - 已完成!✅")
continue
if self.title in skip_keys:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】 - 已跳过!♻️")
continue
else:
await self.do_task()
await asyncio.sleep(3)
await self.receive_task()
async def do_honey_task(self):
"""
做蜂蜜任务
:return:
"""
fn_print(">>> 开始做蜂蜜任务...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberEs~taskRecord~finishTask",
headers=self.headers,
json={
"taskCode": self.task_code
}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 蜂蜜任务【{self.task_type}】完成成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 蜂蜜任务【{self.task_type}】完成失败!❌ - {data.get('errorMessage')}")
async def receive_honey_task(self):
"""
领取蜂蜜任务奖励
:return:
"""
fn_print(f">>> 用户【{self.phone}】 - 前往收取蜂蜜任务奖励...")
self.headers.update(
{
"syscode": "MCS-MIMP-CORE",
"channel": "wxwdsj",
"accept": "application/json, text/plain, */*",
"content-type": "application/json;charset=UTF-8",
"platform": "MINI_PROGRAM"
}
)
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~receiveHoney",
headers=self.headers,
json={"taskType": self.task_type}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 收取蜂蜜任务【{self.task_type}】奖励成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 收取蜂蜜任务【{self.task_type}】奖励失败!❌ - {data.get('errorMessage')}")
async def get_honey_task_list_and_start(self):
"""
获取蜂蜜任务列表
:return:
"""
fn_print(">>> 获取采蜜换大礼包任务列表...")
self.headers.update(
{"channel": "wxwdsj"}
)
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~taskDetail",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
for i in data["obj"]["list"]:
self.task_type = i["taskType"]
status = i["status"]
if status == 3:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.task_type}】 - 已完成!✅")
if self.task_type == "BEES_GAME_TASK_TYPE":
self.bee_need_help = False
continue
if "taskCode" in i:
self.task_code = i["taskCode"]
if self.task_type == "DAILY_VIP_TASK_TYPE":
await self.get_coupom_list()
else:
await self.do_honey_task()
if self.task_type == "BEES_GAME_TASK_TYPE":
await self.honey_damaoxian()
await asyncio.sleep(2)
async def honey_damaoxian(self):
"""
蜂蜜大冒险
:return:
"""
fn_print(">>> 执行大冒险任务...")
game_num = 5
for i in range(1, game_num):
if game_num < 0: break
fn_print(f">> 第{i}次大冒险...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeGameService~gameReport",
headers=self.headers,
json={
"gatherHoney": 20,
}
)
data = response.json()
if data.get("success"):
game_num = data["obj"]["gameNum"]
fn_print(f"> 大冒险成功!剩余次数:{game_num}")
await asyncio.sleep(2)
game_num -= 1
elif data.get("errorMessage") == "容量不足":
fn_print(f"> 大冒险失败!容量不足,需要扩容")
await self.honey_expand()
else:
fn_print(f"> 大冒险失败!❌ - {data.get('errorMessage')}")
async def honey_expand(self):
"""
扩容
:return:
"""
fn_print(">>> 开始扩容...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~expand",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 成功扩容【{data.get('obj')}】!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 扩容失败!❌ - {data.get('errorMessage')}")
async def get_coupom(self):
"""
领取生活权益优惠券
:return:
"""
fn_print(">>> 开始领取生活权益优惠券...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberGoods~pointMallService~createOrder",
headers=self.headers,
json={
"from": "Point_Mall",
"orderSource": "POINT_MALL_EXCHANGE",
"goodsNo": self.goodsNo,
"quantity": 1,
"taskCode": self.task_code
}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 领取生活权益优惠券成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 领取生活权益优惠券失败!❌ - {data.get('errorMessage')}")
async def get_coupom_list(self):
"""
获取生活权益优惠券列表
:return:
"""
fn_print(">>> 获取生活权益优惠券列表...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberGoods~mallGoodsLifeService~list",
headers=self.headers,
json={
"memGrade": 1,
"categoryCode": "SHTQ",
"showCode": "SHTQWNTJ"
}
)
data = response.json()
if data.get("success"):
goods_list = data["obj"][0]["goodsList"]
for goods in goods_list:
exchange_times_limit = goods["exchangeTimesLimit"]
if exchange_times_limit >= 7:
self.goodsNo = goods["goodsNo"]
fn_print(f">> 当前选择券号: {self.goodsNo}")
await self.get_coupom()
break
else:
fn_print(f">>> 用户【{self.phone}】 - 获取生活权益优惠券列表失败!❌ - {data.get('errorMessage')}")
async def honey_index_data(self, flag=False):
if not flag: fn_print(">>> 执行采蜜换大礼包...")
random_invite = random.choice([invite for invite in inviteId if invite != self.user_id])
self.headers.update(
{
"channel": "wxwdsj"
}
)
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~indexData",
headers=self.headers,
json={
"inviteUserId": random_invite
}
)
data = response.json()
if data.get("success"):
usableHoney = data.get('obj').get('usableHoney')
if flag:
fn_print(f">>> 用户【{self.phone}】 - 当前蜂蜜:{usableHoney}")
return
task_detail = data.get('obj').get('taskDetail')
activity_end_time = data.get("obj").get('activityEndTime', '')
activity_end_time = datetime.strptime(activity_end_time, "%Y-%m-%d %H:%M:%S")
current_time = datetime.now()
if current_time.date() == activity_end_time.date():
fn_print(f"本期活动今日结束❗请及时兑换")
else:
fn_print(f"本期活动结束时间 【{activity_end_time}】")
if task_detail != []:
for task in task_detail:
self.task_type = task["type"]
await self.receive_honey_task()
await asyncio.sleep(2)
async def ear_end_2023_task_list(self):
fn_print(">>> 执行周年庆任务...")
self.headers.update(
{
"channel": "32annixcx",
"platform": "MINI_PROGRAM",
"syscode": "MCS-MIMP-CORE"
}
)
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~activityTaskService~taskList",
headers=self.headers,
json={
"activityCode": "ANNIVERSARY_2025",
"channelType": "MINI_PROGRAM"
}
)
data = response.json()
if data.get("success"):
task_list = data.get("obj")
for task in task_list:
self.title = task["taskName"]
self.task_type = task["taskType"]
status = task["status"]
if status == 3:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】 - 已完成!✅")
continue
if self.task_type == "INTEGRAL_EXCHANGE":
await self.ear_end_2023_exchange_card()
elif self.task_type == "PLAY_ACTIVITY_GAME":
await self.dragonboat_2024_index()
await self.dragonboat_2024_game_init()
elif self.task_type == "CLICK_MY_SETTING":
self.task_code = task["taskCode"]
await self.add_deliver_prefer()
if "taskCode" in task:
self.task_code = task["taskCode"]
await self.do_task()
await asyncio.sleep(3)
await self.ear_end_2023_receive_task()
else:
fn_print(f">>> 用户【{self.phone}】 - 暂不支持【{self.title}】任务❗")
await self.ear_end_2023_get_award()
async def add_deliver_prefer(self):
fn_print(f">>> 开始【{self.title}】任务...")
response = await self.client.post(
url="https://ucmp.sf-express.com/cx-wechat-member/member/deliveryPreference/addDeliverPrefer",
headers=self.headers,
json={
"country": "中国",
"countryCode": "A000086000",
"province": "四川省",
"provinceCode": "A510000000",
"city": "成都市",
"cityCode": "A510100000",
"county": "成华区",
"countyCode": "A510108000",
"address": "兴元华盛一期",
"latitude": "30.712051069985897",
"longitude": "104.1025074699607",
"memberId": "",
"locationCode": "028",
"deptCode": "028VP",
"aoiId": "62556EACB8E91B9DE0530EF4520A0CFC",
"aoiType": "120302",
"appliedAoiId": "62556EACB8E91B9DE0530EF4520A0CFC",
"zoneCode": "CN",
"postCode": "",
"workdayPrefer": {
"noDeliverDays": [],
"remark": "",
"startDeliverTime": "",
"content": [
{
"timeRange": "00:00-24:00",
"tag": "8",
"storeInfo": None,
"location": {
"tag": "1",
"userSelect": ""
},
"deliverFlag": "True"
}
]
},
"weekdendPrefer": {
"noDeliverDays": [],
"remark": "",
"startDeliverTime": "",
"content": [
{
"timeRange": "00:00-24:00",
"tag": "8",
"storeInfo": None,
"location": {
"tag": "1",
"userSelect": ""
},
"deliverFlag": "True"
}
]
},
"takeWay": "00",
"empCode": "",
"channelCode": "wxapp",
"taskId": self.task_id,
"extJson": "{\"noDeliverDetail\":[]}"
}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 新增一个收件偏好成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】失败!❌ - {data.get('errorMessage')}")
async def ear_end_2023_exchange_card(self):
fn_print(f">>> 开始积分兑换年卡任务...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonNoLoginPost/~memberNonactivity~yearEnd2023TaskService~integralExchange",
headers=self.headers,
json={
"exchangeNum": 2,
"activityCode": "YEAR_END_2023",
"channelType": "MINI_PROGRAM"
}
)
data = response.json()
if data.get("success"):
received_account_list = data["obj"]["receivedAccountList"]
for card in received_account_list:
fn_print(f">>> 用户【{self.phone}】 - 兑换年卡成功!✅ - 获得【{card['urrency']}】卡【{card['amount']}】张!")
else:
fn_print(f">>> 用户【{self.phone}】 - 任务【{self.title}】失败!❌ - {data.get('errorMessage')}")
async def ear_end_2023_get_award(self):
fn_print(f">>> 开始抽取卡片...")
for index in range(10):
for i in range(0, 3):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2025ClaimService~claim",
headers=self.headers,
json={"cardType": i}
)
data = response.json()
if data.get("success"):
received_account_list = data["obj"]["receivedAccountList"]
for card in received_account_list:
fn_print(
f">>> 用户【{self.phone}】 - 抽取卡片成功!✅ - 获得【{card['currency']}】卡【{card['amount']}】张!")
elif data.get("errorMessage") == "用户账户余额不足":
fn_print(f">>> 用户【{self.phone}】 - 用户账户余额不足!❌")
break
elif data.get("errorMessage") == "用户信息失效,请退出重新进入":
fn_print(f">>> 用户【{self.phone}】 - 用户信息失效,请退出重新进入❌")
break
else:
fn_print(f">>> 用户【{self.phone}】 - 抽取卡片失败!❌ - {data.get('errorMessage')}")
break
await asyncio.sleep(3)
async def ear_end_2023_query(self):
fn_print(f">>> 开始查询卡片数量...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2025ClaimService~claimStatus",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
obj = data.get("obj", None)
if obj is None: return False
current_account_list = obj.get("currentAccountList", [])
if not current_account_list:
fn_print(">> 当前无卡片!")
else:
for card in current_account_list:
currency = card.get("currency")
total_amount = card.get("totalAmount")
balance = card.get("balance")
if currency == "DAI_BI":
currency_name = "坐以待币🪙"
elif currency == 'CHENG_GONG':
currency_name = '成功人士⌚'
elif currency == 'GAN_FAN':
currency_name = '干饭圣体🍚'
elif currency == 'DING_ZHU':
currency_name = '都顶得住🦾'
elif currency == 'ZHI_SHUI':
currency_name = '心如止水🏄'
else:
currency_name = currency
fn_print(f">>> 用户【{self.phone}】 - 卡片【{currency_name}】 - 数量:{balance}")
total_fortune_times = obj.get("totalFortuneTimes", 0)
fn_print(f">>> 用户【{self.phone}】 - 总卡片数量:{total_fortune_times}")
return True
else:
fn_print(f">>> 用户【{self.phone}】 - 查询卡片数量失败!❌ - {data.get('errorMessage')}")
return False
async def ear_end_2023_receive_task(self):
fn_print(f">>> 开始领取【{self.title}】任务奖励...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonNoLoginPost/~memberNonactivity~yearEnd2023TaskService~fetchMixTaskReward",
headers=self.headers,
json={
"activityCode": "YEAR_END_2023",
"channelType": "MINI_PROGRAM",
"taskType": self.task_type
}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 领取【{self.title}】任务奖励成功!✅")
else:
fn_print(f">>> 用户【{self.phone}】 - 领取【{self.title}】任务奖励失败!❌ - {data.get('errorMessage')}")
async def anniversary_2024_weekly_gift_status(self):
fn_print(f">>> 开始周年庆任务...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024IndexService~weeklyGiftStatus",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
weekly_gift_list = data.get("obj", {}).get("weeklyGiftList", [])
for weekly_gift in weekly_gift_list:
if not weekly_gift.get("received"):
receive_start_time = datetime.strptime(weekly_gift['receiveStartTime'], '%Y-%m-%d %H:%M:%S')
receive_end_time = datetime.strptime(weekly_gift['receiveEndTime'], '%Y-%m-%d %H:%M:%S')
current_time = datetime.now()
if receive_start_time <= current_time <= receive_end_time:
await self.anniversary_2024_receive_weekly_gift()
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 查询每周领券失败!❌ - {error_message}")
if "系统繁忙" in error_message or "用户手机号校验未通过" in error_message:
self.anniversary_black = True
async def anniversary_2024_receive_weekly_gift(self):
fn_print(f">>> 开始领取每周领券...")
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024IndexService~receiveWeeklyGift",
headers=self.headers
)
data = response.json()
if data.get("success"):
product_names = [product['productName'] for product in data.get('obj', [])]
fn_print(f">>> 用户【{self.phone}】 - 领取每周领券【{product_names}】成功!✅")
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 领取每周领券失败!❌ - {error_message}")
if "系统繁忙" in error_message or "用户手机号校验未通过" in error_message:
self.anniversary_black = True
async def anniversary_2024_task_list(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~activityTaskService~taskList",
headers=self.headers,
json={
"activityCode": "ANNIVERSARY_2024",
"channelType": "MINI_PROGRAM"
}
)
data = response.json()
if data.get("success"):
task_list = data.get("obj", [])
for task in filter(lambda x: x['status'] == 1, task_list):
if self.anniversary_black:
return
for _ in range(task['canReceiveTokenNum']):
await self.anniversary_2024_fetch_task_reward(task)
for task in filter(lambda x: x['status'] == 2, task_list):
if self.anniversary_black:
return
if task['taskType'] in ['PLAY_ACTIVITY_GAME', 'PLAY_HAPPY_ELIMINATION', 'PARTAKE_SUBJECT_GAME']:
pass
elif task['taskType'] == 'FOLLOW_SFZHUNONG_VEDIO_ID':
pass
elif task['taskType'] in ['BROWSE_VIP_CENTER', 'GUESS_GAME_TIP', 'CREATE_SFID', 'CLICK_MY_SETTING',
'CLICK_TEMPLATE', 'REAL_NAME', 'SEND_SUCCESS_RECALL', 'OPEN_SVIP',
'OPEN_FAST_CARD', 'FIRST_CHARGE_NEW_EXPRESS_CARD', 'CHARGE_NEW_EXPRESS_CARD',
'INTEGRAL_EXCHANGE']:
pass
else:
for _ in range(task['restFinishTime']):
if self.anniversary_black:
break
await self.anniversary_2024_finish_task(task)
async def anniversary_2024_finish_task(self, task):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonRoutePost/memberEs/taskRecord/finishTask",
headers=self.headers,
json={'taskCode': task['taskCode']}
)
data = response.json()
if data.get("success"):
fn_print(f">>> 用户【{self.phone}】 - 完成任务【{task['taskName']}】成功!✅")
await self.anniversary_2024_fetch_mix_task_reward(task)
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 完成任务【{task['taskName']}】失败!❌ - {error_message}")
async def anniversary_2024_fetch_mix_task_reward(self, task):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024TaskService~fetchMixTaskReward",
headers=self.headers,
json={
'taskType': task['taskType'],
'activityCode': 'ANNIVERSARY_2024',
'channelType': 'MINI_PROGRAM'
}
)
data = response.json()
if data.get("success"):
reward_info = data.get('obj', {}).get('account', {})
received_list = [f"[{item['currency']}]X{item['amount']}" for item in
reward_info.get('receivedAccountList', [])]
turned_award = reward_info.get('turnedAward', {})
if turned_award.get("productName"):
received_list.append(f"[优惠券]{turned_award['productName']}")
fn_print(f">> 领取任务【{task['taskName']}】奖励成功!✅ - 获得:{received_list}")
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">> 领取任务【{task['taskName']}】奖励失败!❌ - {error_message}")
if '用户手机号校验未通过' in error_message:
self.anniversary_black = True
async def anniversary_2024_unbox(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024CardService~unbox",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
account_info = data.get("obj", {}).get("account", {})
unbox_list = [f"[{item['currency']}]X{item['amount']}" for item in
account_info.get('receivedAccountList', [])]
fn_print(">> 拆盒子📦: %s" % ', '.join(unbox_list) or '空气')
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">> 拆盒子失败!❌ - {error_message}")
if '用户手机号校验未通过' in error_message:
self.anniversary_black = True
async def anniversary_2024_game_list(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024GameParkService~list",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
topic_pk_info = data['obj'].get('topicPKInfo', {})
search_word_info = data['obj'].get('searchWordInfo', {})
happy_elimination_info = data['obj'].get('happyEliminationInfo', {})
if not topic_pk_info.get("isPassFlag"):
fn_print("> 开始话题PK赛")
await self.anniversary_2024_topic_pk_topic_list()
if not search_word_info.get("isPassFlag") or not search_word_info.get("isFinishDailyFlag"):
fn_print("> 开始找字游戏")
for i in range(1, 11):
wait_time = random.randint(1000, 3000) / 1000.0
await asyncio.sleep(wait_time)
if not await self.anniversary_2024_happy_elimination_win(i):
break
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">> 查询游戏状态失败!❌ - {error_message}")
if '用户手机号校验未通过' in error_message:
self.anniversary_black = True
async def anniversary_2024_search_word_win(self, index):
flag = True
try:
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024SearchWordService~win",
headers=self.headers,
json={
"index": index
}
)
data = response.json()
if data.get("success"):
currency_list = data.get('obj', {}).get('currencyDTOList', [])
rewards = ', '.join([f"[{c.get('currency')}]X{c.get('amount')}" for c in currency_list])
fn_print(
f">>> 用户【{self.phone}】 - 找字游戏第{index}关胜利!✅ - {rewards if rewards else '未获得奖励'}")
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 找字游戏第{index}关失败!❌ - {error_message}")
if '系统繁忙' in error_message:
flag = False
except Exception as e:
fn_print(f">>> 用户【{self.phone}】 - 找字游戏异常‼️ - {e}")
flag = False
finally:
return flag
async def anniversary_2024_happy_elimination_win(self, index):
flag = True
try:
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024HappyEliminationService~win",
headers=self.headers,
json={
"index": index
}
)
data = response.json()
if data.get("success"):
is_award = data['obj'].get('isAward')
currency_dto_list = data['obj'].get('currencyDTOList', [])
rewards = ', '.join([f"[{c.get('currency')}]X{c.get('amount')}" for c in currency_dto_list])
fn_print(f">>> 用户【{self.phone}】 - 第{index}关胜利!✅ - {rewards if rewards else '未获得奖励'}")
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 第{index}关失败!❌ - {error_message}")
if '系统繁忙' in error_message:
flag = False
except Exception as e:
fn_print(f">>> 用户【{self.phone}】 - 第{index}关异常‼️ - {e}")
flag = False
finally:
return flag
async def anniversary_2024_topic_pk_choose_side(self, index):
flag = True
self.headers.update(
{
"channel": "31annizyw"
}
)
try:
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024TopicPkService~chooseSide",
headers=self.headers,
json={
"index": index,
"choose": 0
}
)
data = response.json()
if data.get("success"):
currency_dto_list = data['obj'].get('currencyDTOList', [])
rewards = ', '.join([f"[{c.get('currency')}]X{c.get('amount')}" for c in currency_dto_list])
fn_print(
f">>> 用户【{self.phone}】 - 话题PK赛选择话题{index}成功!✅ - {rewards if rewards else '未获得奖励'}")
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">>> 用户【{self.phone}】 - 话题PK赛选择话题{index}失败!❌ - {error_message}")
if '系统繁忙' in error_message:
flag = False
except Exception as e:
fn_print(f">>> 用户【{self.phone}】 - 话题PK赛选择话题{index}异常‼️ - {e}")
flag = False
finally:
return flag
async def anniversary_2024_topic_pk_topic_list(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024TopicPkService~topicList",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
topics = data['obj'].get('topics', [])
for topic in topics:
if not topic.get('choose'):
index = topic.get('index', 1)
wait_time = random.randint(2000, 4000) / 1000.0
await asyncio.sleep(wait_time)
if not self.anniversary_2024_topic_pk_choose_side(index):
break
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">> 查询话题PK赛记录失败!❌ - {error_message}")
async def anniversary_2024_query_account_status_refresh(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024CardService~queryAccountStatus",
headers=self.headers,
json={}
)
data = response.json()
if not data.get("success"):
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">> 查询账户状态失败!❌ - {error_message}")
async def anniversary_2024_title_list(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024GuessService~titleList",
headers=self.headers,
json={}
)
data = response.json()
if data.get("success"):
guess_title_info_list = data.get('obj', {}).get('guessTitleInfoList', [])
today_titles = [title for title in guess_title_info_list if title['gameDate'] == self.today]
for title_info in today_titles:
if title_info['answerStatus']:
fn_print(f">> 今日已回答过竞猜")
else:
answer = self.answer
if answer:
await self.anniversary_2024_answer(title_info)
print(f"进行了答题: {answer}")
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
fn_print(f">> 查询每日口令竞猜失败!❌ - {error_message}")
async def anniversary_2024_title_list_award(self):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024GuessService~titleList",
headers=self.headers
)
data = response.json()
if data.get("success"):
guess_title_info_list = data.get('obj', {}).get('guessTitleInfoList', [])
today_awards = [title for title in guess_title_info_list if title['gameDate'] == self.today]
for award_info in today_awards:
if award_info['answerStatus']:
awards = award_info.get('awardList', []) + award_info.get('puzzleList', [])
awards_description = ', '.join([f"{award['productName']}" for award in awards])
print(f'>> 口令竞猜奖励: {awards_description}' if awards_description else '今日无奖励')
else:
print('>> 今日还没回答竞猜')
else:
error_message = data.get('errorMessage') or json.dumps(response) or '无返回'
print(f">> 查询每日口令竞猜失败!❌ - {error_message}")
async def anniversary_2024_answer(self, answer_info):
response = await self.client.post(
url="https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~anniversary2024GuessService~answer",
headers=self.headers,
json={
'period': answer_info['period'],
'answerInfo': answer_info