-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathsign.py
1903 lines (1777 loc) · 75 KB
/
sign.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
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 -*-
import asyncio
from httpx import AsyncClient
from time import time, sleep, asctime
from datetime import datetime
from calendar import monthrange
from loguru import logger
from fastapi import FastAPI, BackgroundTasks, Body, WebSocket, WebSocketDisconnect
from fastapi.middleware.cors import CORSMiddleware
from starlette.requests import Request
from typing import Dict, Union
from diskcache import Cache
from json import dumps
import hmac
import hashlib
from base64 import b64encode
from pathlib import Path
from uuid import uuid4
from random import uniform, sample, choice
from urllib.parse import urlparse, parse_qs
from http import cookies
# 使用apscheduler 调用定时任务
from datetime import datetime, timedelta
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
# from apscheduler.jobstores.redis import RedisJobStore
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from dateutil.parser import parse
import socket
import sys
import os
import string
db_path = str(Path(__file__).parent / "tmp")
cache = Cache(db_path)
description = """
脚本输入参数及路由地址
--pt_pin [/signBeanAct]京东Cookie中获取pt_pin值
--pt_key [/signBeanAct]京东Cookie中获取pt_key值
--csai [/csairSign]南航账户Cookie中sign_user_token值
--sichuanair [/sichuanairSign]川航账户Cookie中access-token值
--ctrip [/ctripSign]携程账户Cookie中cticket值
--meituan [/meituan]美团账户Cookie中token值
--weimob [/weimob]统一快乐星球账户Cookie中X-WX-Token值
--10086 [/10086]中国移动账户Cookie中SESSION_TOKEN值
--10010 [/10010]中国联通账户Cookie中ecs_token值
--dp [/dp]东鹏账户header中sid值
--95516 [/95516]云闪付账户header中Authorization值
--kraf [/kraf]卡亨星球账户header中token值
--erke [/erke]鸿星尔克账户的memberId值
--decathlon [/decathlon]迪卡侬账户的Authorization值
--ys [/ys]萤石账户的sessionid值
--juejin [/juejin]掘金账户的sessionid值
--tuhu [/tuhu]途虎养车账户的Authorization值
京东pt_pin和pt_key需同时传入!!!
"""
print(description)
args = sys.argv
for i, arg in enumerate(args):
try:
if arg.startswith("-"):
k = arg.strip("-")
v = args[i + 1]
if v.startswith("-"):
continue
if v:
if k.startswith("pt_"):
if k == "pt_pin":
for i_, v_ in enumerate(v.split(";")):
try:
# cache.set(v_, args[i + 3].split(";")[i_])
cache.set(f'jd_{v_}', args[i + 3].split(";")[i_])
except:
pass
else:
for v_ in v.split(";"):
cache.set(f'{k}_{v_}', v_)
except Exception as e:
pass
scheduler = AsyncIOScheduler(
jobstores={
# "default": RedisJobStore(**{
# "host": '127.0.0.1',
# "port": 6379,
# "db": 10,
# "max_connections": 10
# })
"default": SQLAlchemyJobStore(url=f'sqlite:///{db_path}/cache.db')
},
executorsexecutors={
'default': ThreadPoolExecutor(20),
'processpool': ProcessPoolExecutor(5),
},
job_defaultsjob_defaults={
'coalesce': False,
'max_instances': 3
},
timezone="Asia/Shanghai")
app = FastAPI(title="定时脚本")
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# 程序开始
@app.on_event("startup")
async def startup_event():
print("程序开始")
print(f'设备IP: {socket.gethostbyname(socket.gethostname())} 当127.0.0.1无法访问时,可以使用设备ip替换')
for k in cache.iterkeys():
if k.startswith("jd_"):
if not cache[k]:
cache.delete("test_pageId")
try:
scheduler.start()
print(scheduler.get_jobs())
scheduler.remove_all_jobs()
except Exception as e:
print(f'定时任务启动异常{e}')
# 程序停止
@app.on_event("shutdown")
async def shutdown_event():
print("程序结束")
scheduler.shutdown(wait=False)
# 京豆签到
@app.post("/signBeanAct", tags=["京东签到"])
async def jd_sign(request: Request, background_tasks: BackgroundTasks,
pt_pin: Union[str, None] = Body(default="jd_XXX"),
pt_key: Union[str, None] = Body(default="AAJkPgXXX_XXX"), time: Union[str, None] = Body(default="09:00:00")):
# cache.set(pt_pin, pt_key)
cache.set(f'jd_{pt_pin}', pt_key)
data_time = parse(time)
background_tasks.add_task(signBeanAct, **{"pt_pin": pt_pin, "pt_key": pt_key})
task_id = str(uuid4())
scheduler.add_job(id=pt_pin, name=f'{pt_pin}', func=signBeanAct, kwargs={"pt_pin": pt_pin, "pt_key": pt_key}, trigger='cron', hour=data_time.hour, minute=data_time.minute, second=data_time.second, replace_existing=True)
return {"code": 200, "msg": f'{pt_pin} 已更新', "task_id": f'{task_id}'}
# 类token签到签到
@app.post("/{path}", tags=["类token签到"], description=description)
async def token_sign(request: Request, path: str, background_tasks: BackgroundTasks,
token: Union[str, None] = Body(default="XXX"), time: Union[str, None] = Body(default="09:00:00")):
result = {"code": 400, "msg": "请检查路由路径!"}
data_time = parse(time)
path_dict = {"csairSign": csairSign, "sichuanairSign": sichuanairSign, "ctripSign": ctripSign, "dragon_boat_2023":dragon_boat_2023, "meituan": meituan, "weimob": weimob, "10086": m10086, "10010": m10010, "dp": youzan_dp, "95516": m95516, "kraf": kraf, "erke": demogic_erke, "decathlon": decathlon, "ys": ys, "juejin": juejin, "tuhu": tuhu}
if path in path_dict.keys():
background_tasks.add_task(path_dict[path], **{"token": token})
scheduler.add_job(id=token, name=f'{token}', func=path_dict[path], kwargs={"token": token}, trigger='cron', hour=data_time.hour, minute=data_time.minute, second=data_time.second, replace_existing=True)
result.update({"code": 200, "msg": f'{path} {token} 已更新'})
return result
# Cookie签到
@app.post("/cookie/{path}", tags=["cookie签到"])
async def cookie_sign(request: Request, path: str, background_tasks: BackgroundTasks,
cookie: Union[str, None] = Body(default="XXX"), time: Union[str, None] = Body(default="09:00:00")):
Cookie = cookies.SimpleCookie()
Cookie.load(cookie)
cookie = {k: morsel.value for k, morsel in Cookie.items()}
result = {"code": 400, "msg": "请检查路由路径!"}
path_dict = {"qqstock": qqstock}
if path in path_dict.keys():
background_tasks.add_task(path_dict[path], **{"cookie": cookie})
data_time = parse(time)
scheduler.add_job(id="", name="", func=path_dict[path], kwargs={"cookie": cookie}, trigger='cron', hour=data_time.hour, minute=data_time.minute, second=data_time.second, replace_existing=True)
result.update({"code": 200, "msg": f'{path} cookie 已更新'})
return result
# WebSocket连接管理器
class ConnectionManager:
def __init__(self):
self.active_connections: List[WebSocket] = []
async def connect(self, websocket: WebSocket):
await websocket.accept()
self.active_connections.append(websocket)
await websocket.send_text("服务已启动!")
def disconnect(self, websocket: WebSocket):
self.active_connections.remove(websocket)
async def send_personal_message(self, message: str, websocket: WebSocket):
await websocket.send_text(message)
async def broadcast(self, message: str):
for connection in self.active_connections:
await connection.send_text(message)
manager = ConnectionManager()
@app.websocket("/ws/{client_id}")
async def websocket_endpoint(websocket: WebSocket, client_id: int, background_tasks: BackgroundTasks):
print(websocket.client.host, client_id, websocket.query_params._dict)
await manager.connect(websocket)
await asyncio.sleep(2)
try:
while True:
data = await websocket.receive_text()
print(data)
await manager.send_personal_message(data, websocket)
await asyncio.sleep(2)
await manager.send_personal_message("任务已完成!", websocket)
# await manager.broadcast(f"{client_id} : {data}")
except WebSocketDisconnect:
manager.disconnect(websocket)
await manager.broadcast(f"{client_id} 下线!")
# 请求函数
async def req(**kwargs):
url = kwargs.get("url", "")
if not url: return None
headers = kwargs.get("headers", {"User-Agent": "okhttp/3.12.1;jdmall;android;version/10.3.4;build/92451;"})
proxy = None
proxies = kwargs.get("proxies", {"all://": proxy} if proxy else {})
try:
async with asyncio.Semaphore(100):
async with AsyncClient(http2=kwargs.get("http2", False), proxies=proxies, headers=headers,
cookies=kwargs.get("cookies", {}), verify=False,
trust_env=False,
follow_redirects=True, timeout=20) as client:
rs = await client.request(method=kwargs.get("method", "GET"), url=url, params=kwargs.get("params", {}),
data=kwargs.get("data", {}), json=kwargs.get("json", {}), files=kwargs.get("files", {}),
headers=headers)
return rs
except Exception as e:
logger.error(f'req {url} {e}')
retry = kwargs.get("retry", 0)
retry += 1
if retry > 2:
return None
return await req(**kwargs | {"retry": retry})
# 钉钉通知
async def dingAlert(**kwargs):
access_token = kwargs.get("access_token", "")
secret = kwargs.get("secret", "")
if access_token and secret:
timestamp = str(round(time() * 1000))
sign = b64encode(
hmac.new(secret.encode(), f'{timestamp}\n{secret}'.encode(), digestmod=hashlib.sha256).digest()).decode()
meta = {
"method": "POST",
"url": "https://oapi.dingtalk.com/robot/send",
"params": {
"access_token": access_token,
"timestamp": timestamp,
"sign": sign,
},
"data": dumps({
'msgtype': 'text',
'text': {'content': f'{kwargs.get("msg", "测试")} {asctime()}'}
}),
"headers": {"Content-Type": "application/json"}
}
res = await req(**meta)
# print(res.text)
if res and not res.json().get('errcode'):
return True
else:
logger.error(f'{res.text}')
return False
# 京豆签到
async def signBeanAct(**kwargs):
pt_key = kwargs.get("pt_key", "")
pt_pin = kwargs.get("pt_pin", "")
result = {
"code": 400,
"msg": f'请输入pt_key及pt_pin',
"time": int(time())
}
if not all([pt_pin, pt_key]):
return result
meta = {
"method": "POST",
"url": "https://api.m.jd.com/client.action",
"data": {
'functionId': 'signBeanAct',
'body': '{}',
'appid': 'signed_wh5_ihub',
'client': 'apple',
'clientVersion': '13.0.2',
'h5st': '20240528100518226;5iy5yi6zngmi9yy4;9d49c;tk03w8a731b9741lMisyKzMrMjR382m8OHl6CME_42gdIK27Ztj59og7qFiXW6ANYumVHShrpZ3_ZS0YdGWqK3iY4Ppz;a791835d42061f132ff014304320d32c1e961322573832c7224985fdbbdb4a80;4.7;1716861918226;TKmWymVS34wMWdBCuoFxiVU9ZqmOQttKGrKnVObP83GJZYMza1mupKRvk-ZU6Nj4VdHOVgWbZu9qpwinIhHDWj703eS-Lz7cpZSUJmuAoevLoTGJlVk6nrDCJdsEqPdA9VL9QQJR-PzYFJipNAfyfKvauarIRTW7fGPA3pkTLjrAv_LsOFwkARWPBstGvW-pydLMlupoMyLwh15Je73wD50dMGxrcZXqP7KOLYCx4Hx-qv2YVtqPIE7qCyGHs292qExyfL-Qs_zDVBv1VTC1WM4xDMmWUHeHJUS_WWDFGYnOuVooASH9TGgekE09b_Aj42dBNZkEFasDO7ahC5QYbLg43mTNIeOt1gtErtxLkus9fR6JaZOlgE5dzuZ_tAfhzDpmY2LQb1zwv8oA91VEmsQRYtqe3KzB7K89QdjAvxWa1hwGxzRNDtBwYXJoTMRJ0YDA',
},
"headers": {
"User-Agent": "jdapp",
"Referer": "https://pro.m.jd.com",
},
"cookies": {
"pt_key": pt_key,
"pt_pin": pt_pin
}
}
res = await req(**meta)
result.update({"msg": f'pt_key: {pt_key}; pt_pin: {pt_pin} 已失效,请重新获取pt_key和pt_pin'})
if res.status_code == 200:
text = res.text
# print(text)
try:
res = res.json()
if res.get("errorMessage"):
cache.delete(pt_pin)
else:
if res["data"]["status"] == '1':
result.update({
"code": 200,
"msg": f'{pt_pin} {res["data"]["newUserAward"]["title"]}' if res["data"].get(
"newUserAward") else f"{pt_pin} 今天已签到",
})
else:
result.update({
"code": 200,
"msg": f"京东用户:{pt_pin} 今天已签到",
})
except Exception as e:
logger.error(f'{text} {e}')
result.update({"msg": f"京豆签到程序异常 {kwargs}"})
# 京东快递
meta.update({
"url": "https://lop-proxy.jd.com/jiFenApi/signInAndGetReward",
"params": {},
"json": [{"userNo": "$cooMrdGatewayUid$"}],
"headers": {
"AppParams": '{"appid":158,"ticket_type":"m"}',
# "uuid": "16999712042251211957764",
"uuid": "%.f" % (time() * 10 ** 13),
"LOP-DN": "jingcai.jd.com"
}
})
await req(**meta)
# 钉钉通知
logger.info(result)
await dingAlert(**result)
return result
# 南航签到
async def csairSign(**kwargs):
result = {
"code": 400,
"msg": f'请输入sign_user_token',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
cache.set(f'csai_{token}', token)
# 签到
createTime = int(time() * 1000)
meta = {
"method": "POST",
"url": "https://wxapi.csair.com/marketing-tools/activity/join",
"params": {
"type": "APPTYPE",
"chanel": "ss",
"lang": "zh"
},
"json": {
"activityType": "sign",
"channel": "app",
"entrance": None
},
"headers": {"Content-Type": "application/json"},
"cookies": {
"sign_user_token": token,
"TOKEN": token,
"cs1246643sso": token,
}
}
res = await req(**meta)
if res.status_code == 200:
try:
info = res.json()
if info.get("respCode") == "S00011":
result.update({"code": 200, "msg": f'南航用户:{token} 检查token是否有效'})
cache.delete(f'csai_{token}')
if info.get("respCode") == "S2001":
result.update({"code": 200, "msg": f'南航用户:{token} 今天已签到!'})
else:
result.update({"msg": f'{token} {info.get("respMsg", "")}'})
# 奖励列表
meta.update({
"url": "https://wxapi.csair.com/marketing-tools/award/awardList",
"json": {"activityType": "sign", "awardStatus": "waitReceive", "pageNum": 1, "pageSize": 100},
})
res = await req(**meta)
if res.status_code == 200:
for d in res.json()["data"]["list"]:
logger.info(d["id"])
meta.update({
"url": "https://wxapi.csair.com/marketing-tools/award/getAward",
"json": {"activityType": "sign", "signUserRewardId": d["id"]},
})
res = await req(**meta)
if res.status_code == 200:
logger.info(res.json()["data"]["result"])
except Exception as e:
logger.error(f'南航签到程序异常 {e}')
result.update({"msg": f"南航签到程序异常 {kwargs}"})
logger.info(result)
# 签到日历
month_start = datetime(datetime.now().year, datetime.now().month, 1).strftime("%Y%m%d")
month_end = datetime(datetime.now().year, datetime.now().month,
monthrange(datetime.now().year, datetime.now().month)[1]).strftime("%Y%m%d")
meta = {
"url": "https://wxapi.csair.com/marketing-tools/sign/getSignCalendar",
"params": {
"type": "APPTYPE",
"chanel": "ss",
"lang": "zh",
"startQueryDate": month_start,
"endQueryDate": month_end
},
"cookies": {"sign_user_token": token}
}
res = await req(**meta)
if res:
try:
info = res.json()
if info.get("respCode") == "0000":
result.update({
"code": 200,
"msg": f'南航用户:{token} 当月 {info["data"]["dateList"]} 已签到',
})
else:
result.update({"msg": f'{token} {info.get("respMsg", "")}'})
except Exception as e:
logger.error(f'{text} {e}')
result.update({"msg": f"南航签到程序异常 {kwargs}"})
# 钉钉通知
logger.info(result)
await dingAlert(**result)
return result
# 川航签到
async def sichuanairSign(**kwargs):
result = {
"code": 400,
"msg": f'请输入access-token',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
cache.set(f'sichuanair_{token}', token)
meta = {
"method": "POST",
"url": "https://fx.sichuanair.com/api/v1/sign/get-sign-rotation",
"params": {
"access-token": token
},
}
res = await req(**meta)
if res.status_code == 200:
try:
info = res.json()
if info.get("code") == 200:
result.update({"code": 200, "msg": f'川航用户:{token} 今天已签到'})
else:
cache.delete(f'sichuanair_{token}')
result.update({"msg": f'{token} {info.get("message", "")}'})
except Exception as e:
logger.error(f'川航签到程序异常 {e}')
result.update({"msg": f"南航签到程序异常 {kwargs}"})
# 钉钉通知
logger.info(result)
await dingAlert(**result)
return result
# 携程签到
async def ctripSign(**kwargs):
result = {
"code": 400,
"msg": f'请输入cticket',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
token = kwargs["token"]
cache.set(f'ctrip_{token}', token)
meta = {
"method": "POST",
"url": "https://m.ctrip.com/restapi/soa2/22769/signToday",
"params": {
# "_fxpcqlniredt": "09031177218518661420",
# "x-traceID": "09031177218518661420-1682060530972-8434515"
},
"data": dumps({
# "platform": "H5",
"openId": "",
# "rmsToken": "",
# "head": {
# "cid": "09031177218518661420",
# "ctok": "",
# "cver": "1.0",
# "lang": "01",
# "sid": "8888",
# "syscode": "09",
# "auth": "",
# "xsid": "",
# "extension": []
# }
}),
"cookies": {"cticket": token},
}
res = await req(**meta)
# print(res.text)
if res and res.status_code == 200:
msg = res.json()["message"]
# if res.json()["code"] == "":
# cache.delete(f'csai_{token}')
result.update({
"code": 200,
"msg": f'携程用户:{token} {msg}',
})
# 钉钉通知
logger.info(result)
await dingAlert(**result)
return result
# 微信龙舟游戏
async def dragon_boat_2023(**kwargs):
result = {
"code": 400,
"msg": f'请输入session_token',
"time": int(time())
}
session_token = kwargs.get("token", "")
if not session_token:
return result
activity_id = 1000005
# 目标分数及提现额度
total_score = 10000
# 获取game_id
meta = {
"method": "POST",
"url": "https://payapp.weixin.qq.com/coupon-center-activity/game/create",
"params": {
"session_token": session_token},
"headers": {
"Content-Type": "application/json",
"X-Requested-With": "com.tencent.mm",
},
"json": {"activity_id": activity_id, "game_pk_id": ""}
}
res = await req(**meta)
if res:
res = res.json()
if res.get("data"):
game_id = res["data"]["game_id"]
game_score = 0
score_items = []
for tracks in res["data"]["play_script"]["dragon_boat_2023_play_script"]["tracks"]:
for prop in tracks["props"]:
if prop.get("score"):
score_items.append({"prop_id": prop["prop_id"], "award_score": prop["score"],
"fetch_timestamp_ms": int(round(time() * 1000))})
game_score += prop["score"]
logger.info(f'游戏ID: {game_id} 游戏总分: {game_score}')
if game_score < total_score:
sleep(uniform(0, 0.2))
return await dragon_boat_2023(**kwargs)
else:
logger.error(f'账号状态: {res}')
cache.delete(f'dragon_boat_2023_{session_token}')
return res
cache.set(f'dragon_boat_2023_{session_token}', session_token)
# 开始游戏
meta.update({
"url": "https://payapp.weixin.qq.com/coupon-center-report/statistic/batchreport",
"json": {
"source_scene": "scene",
"device": "DEVICE_ANDROID",
"device_platform": "DEVICE_ANDROID",
"device_system": "DEVICE_ANDROID",
"device_brand": "DEVICE_ANDROID",
"device_model": "DEVICE_ANDROID",
"wechat_version": "1.0.0",
"wxa_sdk_version": "1.0.0",
"wxa_custom_version": "1.1.6",
"event_list": [
{
"event_code": "ActivityGameBegin",
"event_target": str(activity_id),
"intval1": 2,
"strval1": game_id,
}
],
}
})
res = await req(**meta)
if res:
logger.info(f'开始: {res.text}')
# 游戏间隔时间
sleep(25)
# 提交分数
meta.update({
"url": "https://payapp.weixin.qq.com/coupon-center-activity/game/report",
"json": {
"activity_id": activity_id,
"game_id": game_id,
"game_report_score_info": {
"score_items": score_items,
"game_score": game_score,
"total_score": game_score,
},
}
})
res = await req(**meta)
if res:
logger.info(f'提交: {res.text}')
res = res.json()
if res.get("msg"):
return res
# 获取分数
meta.update(
{
"method": "GET",
"url": "https://payapp.weixin.qq.com/coupon-center-activity/game/get",
"params": {
"session_token": session_token,
"activity_id": "1000000",
"game_id": game_id,
"sid": "a5299654f1f5e423c1fc9757f9bf071d",
"coutom_version": "6.30.6"
},
"json": {}
}
)
res = await req(**meta)
if res:
logger.info(f'分数: {res.text}')
# 反馈
meta.update({
"method": "POST",
"url": "https://payapp.weixin.qq.com/coupon-center-activity/award/obtain",
"params": {
"session_token": session_token},
"json": {
"activity_id": activity_id,
"game_id": game_id,
"obtain_ornament": True,
"request_id": f'osd2L5ZiTu4UDWiNrB8bxnlVB-bQ_lj440mdj_{"".join(sample("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 4))}',
"sid": "3bec088206a229c0cd925c464809cd24",
"coutom_version": "6.30.8",
}
})
res = await req(**meta)
if res:
logger.info(f'反馈: {res.text}')
# 美团
async def meituan(**kwargs):
result = {
"code": 400,
"msg": f'请输入token',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
cache.set(f'meituan_{token}', token)
meta = {
"method": "POST",
"url": "https://mediacps.meituan.com/gundam/gundamGrabV4",
"params": {
"yodaReady": "h5",
"csecplatform": "4",
"csecversion": "2.2.1",
"mtgsig": {"a1": "1.1", "a2": 1697448144738,
"a3": "u626yx251w20527zyu3u86u04986u3u581y62xzuyu597958zz4xw60z",
"a5": "El5tTKIDIoaunAdQRzBvNtJBlIIZKjUZLZ==",
"a6": "hs1.4a4gsvX1s4RLQYqBR3sFhAcJZUrn8+3VWbJ+meaysJ2qQF48MWzawMI/8cXpLkxCgeHru+9OaWxcRKi7x76XJ3HkJvJ3GxbJAa4mOXU4A8LE=",
"x0": 4, "d1": "0b94373b8946cbddef86192182d2fcfd"}},
"data": """{"gundamId":531693,"instanceId":"16970942475020.88256599968703330","actualLongitude":113404419,"actualLatitude":23163929,"needTj":true,"couponConfigIdOrderCommaString":"620969479,2189245219456,2237835510400,4298495230601,10393817973385,8650758750857,9217094451849,9769502114441,9285949325961,7458408104585,11075935339145,4987378139785,9219588883081,8368840966793,7285182431881,7349815083657,9123712533129,7281017291401,9218550006409,7282280694409,5513815065225,603844019,11131204469385,9137512120969,11040176931465,516213972,622936732,622197908,622740453,10494188389001,10495566742153","couponAllConfigIdOrderString":"620969479,2189245219456,2237835510400,4298495230601,10393817973385,8650758750857,9217094451849,9769502114441,9285949325961,7458408104585,11075935339145,4987378139785,9219588883081,8368840966793,7285182431881,7349815083657,9123712533129,7281017291401,9218550006409,7282280694409,5513815065225,603844019,11131204469385,9137512120969,11040176931465,516213972,622936732,622197908,622740453,10494188389001,10495566742153","rubikCouponKey":"PrizePool-200043026","platform":13,"app":-1,"h5Fingerprint":"eJylWFeP40iS/iuFeijMQj0lejOLwoGeFEUjenKxaNCJ3ohGNIv770d17+zO3D3cAUcKzIzIzGBEZGR8Qf3j/ZkO77+9g5/H/f7tfZCSgwJWADiIaXz/DcRIHEEIEAEQHPv2Hv+Zh8LIt/docNj33/6GE8A3EAWwv784xsH4G0wC3wgE+fu3f/cg5Pi9ZkjHhPd8mvrxt/O5CYcqnT6XsGjC4rNJi2kO28+4a85Zch6LNqvTz3xq6v9I6+9RsX/9nPhxUH2YpV/Z3CZh81l3YZIOHz+p70XyBcmU27IfYTwVz2LaXiyYAHAS/wj7vkq3LwyN0TsSkRAOQhAY42QapiCAJCRGhggRwr+ROAGiyTR29wlGEBJBEeyj7bK5SNIv8CP+gj6a6SU270D0mv5qJB/z1HyPw6YPi6z96qb8UOjFatKkmJsvxf6I87Bt0/prbouufS1/KQJiBBiH0D1MiRBPEBADIyzBYTAMsTuBY9EPGw7t4Y/v9fr92LIv+BMEPsGP+VDlq7s4OgpcxZWUn+Oi+XMwfc9lkxAq1f6Yx3R4+YKAMBAkYRj9wZH+xJm6Km2/qEwwJU+vnkia/jqqNO+7Yw1SdOTU6LFPpYGx7tYO4rOkL49R3gn0AowlS66Wy9K2ZaY2hzEr3O/ifGwLdVzsRTie0/GKQluzyAOHOzw+ZOTZOdzyZNGwcB55e7XLa6yI38PpAfy6dT0Fc5MRkUPa/CqRpiD8cOCUDs3XR/+FSZioXtG9SLjrx/fDG2NSHVEwhM34FYl5mbh1pZUcorHVqpZ8pbpG6e/ZpLgcoFpq6ZcKErhGHTDAcrWoSbEyRLM4SHFvYCCopcZOeSxSmLohgMIgkAbxSyygk9YkWwQ7iwcniO/RiwaBe+jeMMXKC2VPSt+1UcWyJ826HXI5WGGpyYe4xd8nOBUO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a1u8npdnHaQ+d2WSooc2LWFu/1hFAnrEuKTgapW8oYNTMX9uJ0kpp2ZUblUCvUId7aLJb2/ePQSRVtT4AHPDHr/hloyEMCvfixyySGZXlH0dX1MYL6GZ7F0aYpqHoOdrNoz1xF2/CUo9BtNKuQYlRbFW5qrHh+iMX3AhYuBDfIFrhyS6yHz6tyga7AZFT0feNSr2768nbB02gRW9JDExgK2jW+4trdyquzQxNnp8IHwzsTdKLlpH6U2//5X6a6SiM="}""",
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
"Content-Type": "application/json;charset=utf-8",
},
"cookies": {"token": token}
}
res = await req(**meta)
if res:
try:
logger.info(res.text)
if res.status_code != 200:
result.update({"msg": f"mt {token} 领取失败!"})
cache.delete(f'meituan_{token}')
else:
t = str(time_ns())
meta.update({
"method": "POST",
"url": "https://promotion.waimai.meituan.com/playcenter/common/v1/doaction",
"params": {},
"data": {},
"json": {
"activityViewId": "jXL-9iEaRTsv-FZdpX4Z4g",
"actionCode": 1000,
"lat": 23.16397476196289,
"lng": 113.40444946289062,
"gdId": 422324,
"instanceId": f'{t[:14]}.{t[14:].zfill(16)}',
"fpPlatform": 13,
"utmSource": "",
"utmCampaign": "",
}
})
res = await req(**meta)
if res:
logger.info(res.text)
result.update({"msg": f"mt {token} 签到成功!"})
except Exception as e:
result.update({"msg": f"mt {token} 签到程序异常"})
# 钉钉通知
await dingAlert(**result)
# 统一快乐星球
async def weimob(**kwargs):
result = {
"code": 400,
"msg": f'请输入X-WX-Token',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
meta = {
"method": "POST",
"url": "https://xapi.weimob.com/api3/onecrm/mactivity/sign/misc/sign/activity/core/c/sign",
"json": {"appid": "wx532ecb3bdaaf92f9",
"basicInfo": {"vid": 6013753979957, "vidType": 2, "bosId": 4020112618957, "productId": 146,
"productInstanceId": 3168798957, "productVersionId": "12017",
"merchantId": 2000020692957, "tcode": "weimob", "cid": 176205957},
"extendInfo": {"wxTemplateId": 7083,
"childTemplateIds": [{"customId": 90004, "version": "[email protected]"},
{"customId": 90002, "version": "[email protected]"},
{"customId": 90006, "version": "[email protected]"},
{"customId": 90008, "version": "[email protected]"}], "analysis": [],
"quickdeliver": {"enable": False}, "bosTemplateId": 1000001061,
"youshu": {"enable": False}, "source": 1, "channelsource": 5,
"refer": "onecrm-signgift", "mpScene": 1089},
"queryParameter": {"tracePromotionId": "100006218", "tracepromotionid": "100006218"},
"i18n": {"language": "zh", "timezone": "8"}, "pid": "4020112618957", "storeId": "0",
"customInfo": {"source": 0, "wid": 10613173124}, "tracePromotionId": "100006218",
"tracepromotionid": "100006218"}
,
"headers": {
"X-WX-Token": token,
},
}
res = await req(**meta)
logger.info(res.text)
if res:
res = res.json()
if res["errcode"] == 1041:
cache.delete(f'weimob_{token}')
else:
cache.set(f'weimob_{token}', token)
result.update({"msg": res.get("errmsg", "")})
await dingAlert(**result)
# 中国移动
async def m10086(**kwargs):
result = {
"code": 400,
"msg": f'请输入SESSION_TOKEN',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
# 公众号签到
meta = {
"url": "https://wx.10086.cn/qwhdhub/api/mark/do/mark",
"headers": {
"x-requested-with": "XMLHttpRequest",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.42(0x18002a2a) NetType/4G Language/zh_CN",
"login-check": "1",
"Cookie": f"SESSION_TOKEN={token}",
}
}
res = await req(**meta)
try:
if res:
logger.info(f'公众号签到 {res.text}')
res = res.json()
cache.set(f'10086_{token}', token)
result.update({"msg": f'10086_{token} {res.get("msg", "")}'})
# app签到
meta.update({
"method": "POST",
"url": "https://wx.10086.cn/qwhdhub/api/mark/mark31/domark",
"json": {"date": datetime.now().strftime("%Y%m%d")}
})
res = await req(**meta)
logger.info(f'app 签到 {res.text}')
# # 补签
# meta.update({
# "url": "https://wx.10086.cn/qwhdhub/api/mark/mark31/redomark",
# })
# res = await req(**meta)
# logger.info(f'app 补签{res.text}')
# 任务列表
meta.update({
"url": "https://wx.10086.cn/qwhdhub/api/mark/task/taskList",
"json": {},
})
res = await req(**meta)
print(res.text)
for t in res.json()["data"]["tasks"]:
taskName, taskId, taskType, jumpUrl = t["taskName"], t["taskId"], t["taskCategory"], t["jumpUrl"]
# 任务详情
meta.update({
"method": "POST",
"url": "https://wx.10086.cn/qwhdhub/api/mark/task/taskInfo",
"json": {"taskId": str(taskId)},
})
res = await req(**meta)
logger.info(f'taskInfo {taskName} {taskType} {taskId} {res.text}')
taskType = res.json()["data"]["taskType"]
# if jumpUrl.isalnum():
# meta.update({
# "url": "https://wx.10086.cn/qwhdhub/api/mark/mark31/isMark31",
# "headers": {
# "Referer": f'{res.json()["data"]["backUrl"]}?function={taskId}&completeTaskId={taskType}'
# }
# })
# res = await req(**meta)
# print(res.text)
# # 公众号任务 获取回调地址 (需要sid)
# meta.update({
# "method": "POST",
# "url": "https://wx.10086.cn/website/nrapigate/nrmix/activityGroup/getSignTask",
# "json": {"ystitle": "", "taskId": str(taskId)},
# })
# res = await req(**meta)
# logger.info(f'getSignTask {taskName} {taskType} {taskId} {res.text}')
#
# # 公众号任务完成
# meta.update({
# "url": "https://wx.10086.cn/website/nrapigate/nrmix/activityGroup/finishSignTask",
# "json": {"ystitle": "", "taskId": str(taskId)},
# })
# res = await req(**meta)
# logger.info(f'finishSignTask {taskName} {taskType} {taskId} {res.text}')
# app任务完成
meta.update({
"url": "https://wx.10086.cn/qwhdhub/api/mark/task/finishTask",
"json": {"taskId": str(taskId), "taskType": str(taskType)},
})
res = await req(**meta)
logger.info(f'finishTask {taskName} {taskType} {taskId} {res.text}')
# 领取奖励
meta.update({
"url": "https://wx.10086.cn/qwhdhub/api/mark/task/getTaskAward",
"json": {"taskId": str(t["taskId"])}
})
res = await req(**meta)
logger.info(f'getTaskAward {taskName} {taskType} {taskId} {res.text}')
except Exception as e:
logger.error(f'10086 {token} 签到程序异常:{e}')
cache.delete(f'10086_{token}')
await dingAlert(**result)
# 中国联通
async def m10010(**kwargs):
result = {
"code": 400,
"msg": f'请输入ecs_token',
"time": int(time())
}
token = kwargs.get("token", "")
if not token:
return result
cache.set(f'10010_{token}', token)
# 签到
meta = {
"method": "POST",
"url": "https://act.10010.com/SigninApp/signin/daySign",
"json": {
"shareCl": "",
"shareCode": ""
},
"headers": {
"Cookie": f"ecs_token={token}"
},
}
res = await req(**meta)
try:
if res.status_code == 200:
logger.info(f'10010 daySign {res.text}')
res = res.json()
if res["status"] == "0001":
cache.delete(f"10010_{token}")
result.update({"code": 200, "msg": f'10010用户:{token} 检查token是否有效'})
return result
result.update({"msg": f'10010 {res["msg"]}'})
# 任务
meta.update({
"url": "https://act.10010.com/SigninApp/superSimpleTask/getTask",
})
res = await req(**meta)
for r in res.json()["data"]:
for t in r["taskMsg"]:
# print(t)
if t["achieve"] == '0':
# meta.update({
# "url": "https://act.10010.com/SigninApp/task/doTask",
# "json": {
# "id": "eda7a0714642495f9ffd9fe16be1c57a",
# # "orderId": "6750f3ae1e79489289ad4e1a08b0fa66",
# # "imei": "FBE7973D-8368-465C-AF0A-AA979110ECC2",
# # "prizeType": "nq",
# "positionFlag": "3"
# }
# })
meta.update({
"url": "https://act.10010.com/SigninApp/simplyDotask/accomplishDotask",
"json": {
"actId": t.get("actId", ""),
"taskId": t.get("taskId", ""),
"systemCode": "QDQD",
"orderId": "",
"taskName": t.get("title", ""),
"taskType": t.get("taskType", "2")
}
})
res = await req(**meta)
meta.update({
"url": "https://act.10010.com/SigninApp/simplyDotask/doTaskS",
"json": {
"actId": t.get("actId", ""),
"taskId": t.get("taskId", ""),
# "taskType": "2",
"taskType": t.get("taskType", "2"),
},
})
res = await req(**meta)
logger.info(f'{r["id"]} {res.text}')
except Exception as e:
logger.error(f'10010 签到程序异常:{e}')
cache.delete(f"10010_{token}")
result.update({"msg": f"10010 签到程序异常"})
# 钉钉通知
await dingAlert(**result)
return result
# 有赞(东鹏特饮)
async def youzan_dp(**kwargs):
result = {