forked from OreosLab/checkinpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ck_ccava.py
42 lines (34 loc) · 1.07 KB
/
ck_ccava.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
# -*- coding: utf-8 -*-
"""
cron: 55 18 * * *
new Env('CCAVA');
"""
import requests
from notify_mtr import send
from utils import get_data
class DuoKan:
def __init__(self, check_items):
self.check_items = check_items
def sign(self, cookie):
url = "https://pc.ccava.net/zb_users/plugin/mochu_us/cmd.php?act=qiandao"
res = requests.get(url, headers={"Cookie": cookie})
data = res.json()
if "登录" in data["msg"]:
msg = "cookie 失效"
elif "今天" in data["msg"]:
msg = f'重复签到, 剩余 {data["giod"]} 月光币'
else:
msg = f'签到成功, 剩余 {data["giod"]} 月光币'
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("CCAVA", [])
res = DuoKan(check_items=_check_items).main()
send("CCAVA", res)