-
Notifications
You must be signed in to change notification settings - Fork 355
/
ck_everphoto.py
56 lines (45 loc) · 1.77 KB
/
ck_everphoto.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
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
"""
:author @CAB233
:url https://github.com/CAB233/everphoto_checkin
cron: 3 22 * * *
new Env('时光相册');
"""
import requests
from notify_mtr import send
from utils import get_data
class EverPhoto:
def __init__(self, check_items):
self.check_items = check_items
def main(self):
msg_all = ""
url = "https://openapi.everphoto.cn/sf/3/v4/PostCheckIn"
login_url = "https://web.everphoto.cn/api/auth"
for check_item in self.check_items:
mobile = check_item.get("mobile")
password = check_item.get("password")
login_key = f"mobile={mobile}&password={password}"
header = {
"user-agent": "EverPhoto/4.5.0 (Android;4050002;MuMu;23;dev)",
"application": "tc.everphoto",
}
data = requests.post(login_url, login_key, headers=header).json()["data"]
header = {
"user-agent": "EverPhoto/4.5.0 (Android;4050002;MuMu;23;dev)",
"application": "tc.everphoto",
"content-type": "application/json",
"host": "openapi.everphoto.cn",
"connection": "Keep-Alive",
"authorization": f'Bearer {data["token"]}',
}
res = requests.post(url, headers=header).json()
checkin_result = res["data"]["checkin_result"]
continuity = res["data"]["continuity"]
msg = f"是否为今日第一次签到:{checkin_result}\n累积签到天数:{continuity}"
msg_all += msg + "\n\n"
return msg_all
if __name__ == "__main__":
_data = get_data()
_check_items = _data.get("EVERPHOTO", [])
result = EverPhoto(check_items=_check_items).main()
send("时光相册", result)