-
Notifications
You must be signed in to change notification settings - Fork 103
/
glados_Qinglong.py
46 lines (40 loc) · 1.94 KB
/
glados_Qinglong.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
import requests,json,os
# pushplus秘钥
sckey = os.environ。get("PUSHPLUS_TOKEN", "")
sendContent = ''
# glados账号cookie
cookies= os.environ。get("GLADOS_COOKIE", [])。split("&")
if cookies[0] == "":
print('未获取到COOKIE变量')
cookies = []
exit(0)
def start():
url= "https://glados.rocks/api/user/checkin"
url2= "https://glados.rocks/api/user/status"
referer = 'https://glados.rocks/console/checkin'
origin = "https://glados.rocks"
useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
payload={
'token': 'glados.one'
}
for cookie 在 cookies:
checkin = requests.post(url,headers={'cookie': cookie ,'referer': referer,'origin':origin,'user-agent':useragent,'content-type':'application/json;charset=UTF-8'},data=json.dumps(payload))
state = requests.get(url2,headers={'cookie': cookie ,'referer': referer,'origin':origin,'user-agent':useragent})
#--------------------------------------------------------------------------------------------------------#
time = state.json()['data']['leftDays']
time = time.split('.')[0]
email = state.json()['data']['email']
if 'message' 在 checkin.text:
mess = checkin.json()['message']
print(email+'----'+mess+'----剩余('+time+')天') # 日志输出
global sendContent
sendContent += email+'----'+mess+'----剩余('+time+')天\n'
else:
requests.get('http://www.pushplus.plus/send?token=' + sckey + '&content='+email+'更新cookie')
#--------------------------------------------------------------------------------------------------------#
if sckey != "":
requests.get('http://www.pushplus.plus/send?token=' + sckey + '&title=VPN签到成功'+'&content='+sendContent)
def main_handler(event, context):
return start()
if __name__ == '__main__':
start()