forked from huaji8/huajiScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path游咔.py
72 lines (65 loc) · 1.79 KB
/
游咔.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
# app在这:http://yk0009.xyz/?invite=zkMTcxMzM1NQ
# 抓取token#uid 填入yuanshen_youka uid在请求体
# 没毛没利润没玩法
import os
import requests
import json
def headers(token):
headers = {
'Host': 'xin.hansilu.fun',
'token': token,
'content-type': 'application/x-www-form-urlencoded',
'content-length': '11',
'accept-encoding': 'gzip',
'user-agent': 'okhttp/4.8.1'
}
return headers
def sign(header,uid):
url = "https://xin.hansilu.fun/Api/Home/signIn"
data = {
"uid": uid
}
re = requests.post(url,headers=header,data=data)
data = json.loads(re.text)
print("签到结果:",data["state"]["msg"])
def video(header,uid):
url = "https://xin.hansilu.fun/Api/Home/lookVideoAd"
data = {
"uid": uid
}
re = requests.post(url,headers=header,data=data)
data = json.loads(re.text)
print("看视频结果:",data["state"]["msg"])
def userinfo(header,uid):
url = "https://xin.hansilu.fun/Api/User/getUserHome"
data = {
"uid": uid,
"fuid": uid
}
re = requests.post(url,headers=header,data=data)
data = json.loads(re.text)
print("用户剩余积分:",data["data"]["user"]["integral"])
def main_task(cookies):
token = cookies.split("#")[0]
uid = cookies.split("#")[1]
header = headers(token)
sign(header,uid)
video(header,uid)
userinfo(header,uid)
if __name__ == "__main__":
cookies = ''
if not cookies:
cookies = os.getenv('yuanshen_youka')
if not cookies:
print('没有token')
cookies = cookies.split("@")
print(f"一共获取到{len(cookies)}个账号")
i = 1
for cookie in cookies:
print(f"\n--------开始第{i}个账号--------")
try:
main_task(cookie)
except Exception as e:
print("发生错误:",e)
print(f"--------第{i}个账号执行完毕--------")
i += 1