forked from myseil/smzdm_sgin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smzdm.py
43 lines (37 loc) · 1.99 KB
/
smzdm.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
# coding=utf-8
import requests
import json
# 设置Server酱post地址 不需要可以删除
serverChan = "https://sc.ftqq.com/*****************************************.send"
# 状态地址
current_url = 'https://zhiyou.smzdm.com/user/info/jsonp_get_current'
# 签到地址
checkin_url = 'https://zhiyou.smzdm.com/user/checkin/jsonp_checkin'
# 用用户名和密码登录后获取Cookie
userCookie = "**************************************************************"
headers = {
'Referer': 'https://www.smzdm.com/',
'Host': 'zhiyou.smzdm.com',
'Cookie': userCookie,
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
}
def req(url):
url = url
res = requests.get(url, headers=headers)
if res.status_code == 200:
data = json.loads(res.text)
return data
data = req(current_url)
if data['checkin']['has_checkin']:
info = '%s :%s 你目前积分:%s,经验值:%s,金币:%s,碎银子:%s,威望:%s,等级:%s,已经签到:%s天' % (data['sys_date'], data['nickname'], data['point'], data['exp'], data['gold'], data['silver'], data['prestige'], data['level'],data['checkin']['daily_checkin_num'])
print(info)
# 通过Server酱发送状态 不需要可以删除
requests.post(serverChan, data={'text': data['nickname'] + '已经签到过了', 'desp': info})
else:
checkin = req(checkin_url)['data']
# print(checkin)
info = '%s 目前积分:%s,增加积分:%s,经验值:%s,金币:%s,威望:%s,等级:%s' % (data['nickname'], checkin['point'], checkin['add_point'], checkin['exp'], checkin['gold'], checkin['prestige'], checkin['rank'])
print(info)
# 通过Server酱发送状态 不需要可以删除
requests.post(serverChan, data={'text': data['nickname'] + '签到信息', 'desp': info})