forked from OreosLab/checkinpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ck_toolu.py
47 lines (38 loc) · 1.2 KB
/
ck_toolu.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
# -*- 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
@staticmethod
def sign(cookie):
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",
}
response = requests.get(url, headers=headers)
day = re.findall("你已经连续签到(.*),再接再厉!", response.text)
if len(day) == 0:
return "cookie 失效"
day = day[0].replace(" ", "")
return f"连续签到 {day}"
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", [])
result = ToolLu(check_items=_check_items).main()
send("在线工具", result)