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
| import requests import json import os
import requests def send_wechat(token, title, msg): token = token title = title content = msg template = 'html' url = f"https://www.pushplus.plus/send?token={token}&title={title}&content={content}&template={template}" print(url) r = requests.get(url=url) print(r.text)
if __name__ == '__main__': sckey = os.environ.get("SENDKEY", "")
title = "" success, fail, repeats = 0, 0, 0 context = ""
cookies = os.environ.get("COOKIES", []).split("&") if cookies[0] != "":
check_in_url = "https://glados.space/api/user/checkin" status_url = "https://glados.space/api/user/status"
referer = 'https://glados.space/console/checkin' origin = "https://glados.space" 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 in cookies: checkin = requests.post(check_in_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(status_url, headers={ 'cookie': cookie, 'referer': referer, 'origin': origin, 'user-agent': useragent})
message_status = "" points = 0 message_days = "" if checkin.status_code == 200: result = checkin.json() check_result = result.get('message') points = result.get('points')
result = state.json() leftdays = int(float(result['data']['leftDays'])) email = result['data']['email'] print(check_result) if "Checkin! Got" in check_result: success += 1 message_status = "签到成功,会员点数 + " + str(points) elif "Checkin Repeats!" in check_result: repeats += 1 message_status = "重复签到,明天再来" else: fail += 1 message_status = "签到失败,请检查..."
if leftdays is not None: message_days = f"{leftdays} 天" else: message_days = "error" else: email = "" message_status = "签到请求URL失败, 请检查..." message_days = "error"
context += "账号: " + email + ", P: " + str(points) +", 剩余: " + message_days + " | "
title = message_status print("Send Content:" + "\n", context) else: title = f'# 未找到 cookies!'
print("sckey:", sckey) print("cookies:", cookies) if not sckey: print("Not push") else: send_wechat(sckey, title, context)
|