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