1 Star 0 Fork 1

海盗船长HK / glados-checkin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
checkin.py 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
zhangyanming 提交于 2022-03-18 12:09 . Update checkin.py
import requests,json,os
# server酱开关,填off不开启(默认),填on同时开启cookie失效通知和签到成功通知
sever = os.environ["SERVE"]
# 填写server酱sckey,不开启server酱则不用填
sckey = os.environ["SCKEY"]
# 填入glados账号对应cookie
cookie = os.environ["COOKIE"]
def start():
url= "https://glados.rocks/api/user/checkin"
url2= "https://glados.rocks/api/user/status"
referer = 'https://glados.rocks/console/checkin'
#checkin = requests.post(url,headers={'cookie': cookie ,'referer': referer })
#state = requests.get(url2,headers={'cookie': cookie ,'referer': referer})
origin = "https://glados.rocks"
useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36"
payload={
'token': 'glados_network'
}
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})
# print(res)
if 'message' in checkin.text:
mess = checkin.json()['message']
print(state)
time = state.json()['data']['leftDays']
time = time.split('.')[0]
print(time)
if sever == 'on':
requests.get('https://sc.ftqq.com/' + sckey + '.send?text='+mess+',you have '+time+' days left')
else:
requests.get('https://sc.ftqq.com/' + sckey + '.send?text=cookie过期')
def main_handler(event, context):
return start()
if __name__ == '__main__':
start()
Python
1
https://gitee.com/68085386/glados-checkin.git
git@gitee.com:68085386/glados-checkin.git
68085386
glados-checkin
glados-checkin
master

搜索帮助