forked from OreosLab/checkinpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathck_toolu.py
More file actions
48 lines (39 loc) · 1.23 KB
/
ck_toolu.py
File metadata and controls
48 lines (39 loc) · 1.23 KB
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
# -*- coding: utf-8 -*-
"""
cron: 0 6 * * *
new Env('在线工具');
"""
import re
import requests
from notify_mtr import send
from utils import get_data
class ToolLu:
def __init__(self, check_items):
self.check_items = check_items
def sign(self, cookie):
session = requests.Session()
url = "https://id.tool.lu/sign"
headers = {
"cookie": cookie,
"user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36",
}
res = session.get(url=url, headers=headers)
day = re.findall("你已经连续签到(.*),再接再厉!", res.text)
if len(day) == 0:
msg = "cookie 失效"
else:
day = day[0].replace(" ", "")
msg = f"连续签到 {day}"
return msg
def main(self):
msg_all = ""
for check_item in self.check_items:
cookie = check_item.get("cookie")
msg = self.sign(cookie)
msg_all += msg + "\n\n"
return msg_all
if __name__ == "__main__":
data = get_data()
_check_items = data.get("TOOLU", [])
res = ToolLu(check_items=_check_items).main()
send("在线工具", res)