forked from wd210010/only_for_happly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python3 | ||
# -- coding: utf-8 -- | ||
# @Time : 2024/5/7 10:23 | ||
# ------------------------------- | ||
# cron "30 5 * * *" script-path=xxx.py,tag=匹配cron用 | ||
# const $ = new Env('宽仔签到'); | ||
|
||
import requests,json,os | ||
|
||
###变量kztk 多账号用&隔开 抓取宽哥之家小程序 点任务抓包 请求头的token | ||
kztk=os.getenv("kztk").split('&') | ||
|
||
|
||
|
||
for i in range(len(kztk)): | ||
print(f'开始第{i+1}个账号') | ||
headers = { | ||
'token': kztk[i], | ||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.48(0x18003030) NetType/WIFI Language/zh_CN miniProgram/wxb6bc0796e0f0db00', | ||
} | ||
resp1 = requests.get('https://shop.sctobacco.com/api/mc-server/mcMedia/listForMobile?&offset=0&limit=10&isShow=1',headers=headers) | ||
result =json.loads(resp1.text)['data']['rows'][0] | ||
appid = result['appid'] | ||
mediaId = result['mediaId'] | ||
|
||
#阅读 | ||
print('开始阅读文章') | ||
data = { | ||
'mpMediaId': mediaId, | ||
'mediaId': mediaId, | ||
'appid': appid | ||
} | ||
resp2 = requests.post('https://shop.sctobacco.com/api/mc-server/mcMedia/clickMedia',headers=headers, data=data) | ||
result2 =json.loads(resp2.text) | ||
if result2['code'] ==1: | ||
print(result2['message']) | ||
|
||
#签到 | ||
print('开始签到') | ||
resp3= requests.get('https://shop.sctobacco.com/api/ac-server/manage/acSignMemberLog/SignSubmit',headers=headers) | ||
result3 =json.loads(resp3.text) | ||
if result3['code']==1: | ||
print(result3['message']) | ||
else: | ||
print(result3['data']) |