Evilmass
commited on
Commit
·
6ed2c3e
1
Parent(s):
fa7ea4d
add gotify img
Browse files- _playwright/bilibili.py +10 -9
- _playwright/tsdm.py +3 -2
- _playwright/v2ex.py +3 -2
- _playwright/vits.py +3 -2
- _playwright/wuaipojie.py +2 -1
- _requests/aliyundrive.py +9 -8
- config/settings_prod.py +11 -4
- images/aliyundrive.png +0 -0
- images/bg.png +0 -0
- images/bilibili.png +0 -0
- images/huggingface.png +0 -0
- images/tsdm.jpg +0 -0
- images/v2ex.png +0 -0
- images/wuaipojie.png +0 -0
- utils.py +15 -5
_playwright/bilibili.py
CHANGED
|
@@ -17,6 +17,7 @@ from __init__ import (
|
|
| 17 |
bilibili_cookie_file,
|
| 18 |
bilibili_title,
|
| 19 |
bilibili_logger,
|
|
|
|
| 20 |
)
|
| 21 |
|
| 22 |
bilibili_live_rooms = get_bilibili_live_rooms_from_pi()
|
|
@@ -31,7 +32,7 @@ async def is_login(page):
|
|
| 31 |
else:
|
| 32 |
stderr = "Cookie 过期"
|
| 33 |
bilibili_logger.error(stderr)
|
| 34 |
-
push_msg(bilibili_title, stderr)
|
| 35 |
return False
|
| 36 |
|
| 37 |
|
|
@@ -54,7 +55,7 @@ async def sign(page):
|
|
| 54 |
else:
|
| 55 |
sign_res = f"签到失败"
|
| 56 |
bilibili_logger.error(sign_res)
|
| 57 |
-
push_msg(bilibili_title, sign_res)
|
| 58 |
msg.append(sign_res)
|
| 59 |
|
| 60 |
return "\n".join(msg)
|
|
@@ -82,14 +83,10 @@ async def live(page):
|
|
| 82 |
if await send_button.is_visible():
|
| 83 |
# 点击发送按钮
|
| 84 |
await send_button.click()
|
| 85 |
-
room_msg = (
|
| 86 |
-
f"直播间:【{bilibili_live_rooms[room_id]}】打卡成功,打卡时间:【{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}】"
|
| 87 |
-
)
|
| 88 |
bilibili_logger.info(room_msg)
|
| 89 |
else:
|
| 90 |
-
room_msg = (
|
| 91 |
-
f"直播间:【{bilibili_live_rooms[room_id]}】打卡失败,打卡时间:【{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}】"
|
| 92 |
-
)
|
| 93 |
bilibili_logger.error(room_msg)
|
| 94 |
msg.append(room_msg)
|
| 95 |
|
|
@@ -116,7 +113,11 @@ async def bilibili_sign():
|
|
| 116 |
sign_result = sign_task.result()
|
| 117 |
live_result = live_task.result()
|
| 118 |
# ""分割两个服务的消息
|
| 119 |
-
push_msg(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
if __name__ == "__main__":
|
|
|
|
| 17 |
bilibili_cookie_file,
|
| 18 |
bilibili_title,
|
| 19 |
bilibili_logger,
|
| 20 |
+
bilibili_img,
|
| 21 |
)
|
| 22 |
|
| 23 |
bilibili_live_rooms = get_bilibili_live_rooms_from_pi()
|
|
|
|
| 32 |
else:
|
| 33 |
stderr = "Cookie 过期"
|
| 34 |
bilibili_logger.error(stderr)
|
| 35 |
+
push_msg(bilibili_title, stderr, bilibili_img)
|
| 36 |
return False
|
| 37 |
|
| 38 |
|
|
|
|
| 55 |
else:
|
| 56 |
sign_res = f"签到失败"
|
| 57 |
bilibili_logger.error(sign_res)
|
| 58 |
+
push_msg(bilibili_title, sign_res, bilibili_img)
|
| 59 |
msg.append(sign_res)
|
| 60 |
|
| 61 |
return "\n".join(msg)
|
|
|
|
| 83 |
if await send_button.is_visible():
|
| 84 |
# 点击发送按钮
|
| 85 |
await send_button.click()
|
| 86 |
+
room_msg = f"直播间:【{bilibili_live_rooms[room_id]}】打卡成功,打卡时间:【{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}】"
|
|
|
|
|
|
|
| 87 |
bilibili_logger.info(room_msg)
|
| 88 |
else:
|
| 89 |
+
room_msg = f"直播间:【{bilibili_live_rooms[room_id]}】打卡失败,打卡时间:【{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}】"
|
|
|
|
|
|
|
| 90 |
bilibili_logger.error(room_msg)
|
| 91 |
msg.append(room_msg)
|
| 92 |
|
|
|
|
| 113 |
sign_result = sign_task.result()
|
| 114 |
live_result = live_task.result()
|
| 115 |
# ""分割两个服务的消息
|
| 116 |
+
push_msg(
|
| 117 |
+
title=bilibili_title,
|
| 118 |
+
message="\n".join([sign_result, "", live_result]),
|
| 119 |
+
imgurl=bilibili_img,
|
| 120 |
+
)
|
| 121 |
|
| 122 |
|
| 123 |
if __name__ == "__main__":
|
_playwright/tsdm.py
CHANGED
|
@@ -20,6 +20,7 @@ from __init__ import (
|
|
| 20 |
tsdm_cookie_file,
|
| 21 |
tsdm_title,
|
| 22 |
tsdm_logger,
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
|
|
@@ -32,7 +33,7 @@ async def is_login(page):
|
|
| 32 |
else:
|
| 33 |
stderr = "Cookie 过期"
|
| 34 |
tsdm_logger.error(stderr)
|
| 35 |
-
push_msg(tsdm_title, stderr)
|
| 36 |
return False
|
| 37 |
|
| 38 |
|
|
@@ -109,7 +110,7 @@ async def tsdm_sign():
|
|
| 109 |
sign_result = sign_task.result()
|
| 110 |
cliwork_result = cliwork_task.result()
|
| 111 |
# ""分割两个服务的消息
|
| 112 |
-
push_msg(tsdm_title, "\n".join([sign_result, "", cliwork_result]))
|
| 113 |
|
| 114 |
|
| 115 |
if __name__ == "__main__":
|
|
|
|
| 20 |
tsdm_cookie_file,
|
| 21 |
tsdm_title,
|
| 22 |
tsdm_logger,
|
| 23 |
+
tsdm_img,
|
| 24 |
)
|
| 25 |
|
| 26 |
|
|
|
|
| 33 |
else:
|
| 34 |
stderr = "Cookie 过期"
|
| 35 |
tsdm_logger.error(stderr)
|
| 36 |
+
push_msg(tsdm_title, stderr, tsdm_img)
|
| 37 |
return False
|
| 38 |
|
| 39 |
|
|
|
|
| 110 |
sign_result = sign_task.result()
|
| 111 |
cliwork_result = cliwork_task.result()
|
| 112 |
# ""分割两个服务的消息
|
| 113 |
+
push_msg(tsdm_title, "\n".join([sign_result, "", cliwork_result]), tsdm_img)
|
| 114 |
|
| 115 |
|
| 116 |
if __name__ == "__main__":
|
_playwright/v2ex.py
CHANGED
|
@@ -16,6 +16,7 @@ from __init__ import (
|
|
| 16 |
v2ex_cookie_file,
|
| 17 |
v2ex_title,
|
| 18 |
v2ex_logger,
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
|
|
@@ -28,7 +29,7 @@ async def is_login(page):
|
|
| 28 |
else:
|
| 29 |
stderr = "Cookie 过期"
|
| 30 |
v2ex_logger.error(stderr)
|
| 31 |
-
push_msg(v2ex_title, stderr)
|
| 32 |
return False
|
| 33 |
|
| 34 |
|
|
@@ -65,7 +66,7 @@ async def v2ex_sign():
|
|
| 65 |
await browser.close()
|
| 66 |
# 推送
|
| 67 |
sign_result = sign_task.result()
|
| 68 |
-
push_msg(v2ex_title, "\n".join([sign_result]))
|
| 69 |
|
| 70 |
|
| 71 |
if __name__ == "__main__":
|
|
|
|
| 16 |
v2ex_cookie_file,
|
| 17 |
v2ex_title,
|
| 18 |
v2ex_logger,
|
| 19 |
+
v2ex_img,
|
| 20 |
)
|
| 21 |
|
| 22 |
|
|
|
|
| 29 |
else:
|
| 30 |
stderr = "Cookie 过期"
|
| 31 |
v2ex_logger.error(stderr)
|
| 32 |
+
push_msg(v2ex_title, stderr, v2ex_img)
|
| 33 |
return False
|
| 34 |
|
| 35 |
|
|
|
|
| 66 |
await browser.close()
|
| 67 |
# 推送
|
| 68 |
sign_result = sign_task.result()
|
| 69 |
+
push_msg(v2ex_title, "\n".join([sign_result]), v2ex_img)
|
| 70 |
|
| 71 |
|
| 72 |
if __name__ == "__main__":
|
_playwright/vits.py
CHANGED
|
@@ -15,6 +15,7 @@ from __init__ import (
|
|
| 15 |
vits_cookie_file,
|
| 16 |
vits_title,
|
| 17 |
vits_logger,
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
|
|
@@ -27,7 +28,7 @@ async def is_login(page):
|
|
| 27 |
else:
|
| 28 |
stderr = "Cookie 过期"
|
| 29 |
vits_logger.error(stderr)
|
| 30 |
-
push_msg(vits_title, stderr)
|
| 31 |
return False
|
| 32 |
|
| 33 |
|
|
@@ -59,7 +60,7 @@ async def vits_sign():
|
|
| 59 |
await browser.close()
|
| 60 |
# 推送
|
| 61 |
sign_result = sign_task.result()
|
| 62 |
-
push_msg(vits_title, sign_result)
|
| 63 |
|
| 64 |
|
| 65 |
if __name__ == "__main__":
|
|
|
|
| 15 |
vits_cookie_file,
|
| 16 |
vits_title,
|
| 17 |
vits_logger,
|
| 18 |
+
vits_img,
|
| 19 |
)
|
| 20 |
|
| 21 |
|
|
|
|
| 28 |
else:
|
| 29 |
stderr = "Cookie 过期"
|
| 30 |
vits_logger.error(stderr)
|
| 31 |
+
push_msg(vits_title, stderr, vits_img)
|
| 32 |
return False
|
| 33 |
|
| 34 |
|
|
|
|
| 60 |
await browser.close()
|
| 61 |
# 推送
|
| 62 |
sign_result = sign_task.result()
|
| 63 |
+
push_msg(vits_title, sign_result, vits_img)
|
| 64 |
|
| 65 |
|
| 66 |
if __name__ == "__main__":
|
_playwright/wuaipojie.py
CHANGED
|
@@ -16,6 +16,7 @@ from __init__ import (
|
|
| 16 |
wuaipojie_cookie_file,
|
| 17 |
wuaipojie_title,
|
| 18 |
wuaipojie_logger,
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
|
|
@@ -53,7 +54,7 @@ async def wuaipojie_sign():
|
|
| 53 |
await browser.close()
|
| 54 |
# 推送
|
| 55 |
sign_result = sign_task.result()
|
| 56 |
-
push_msg(wuaipojie_title, "\n".join([sign_result]))
|
| 57 |
|
| 58 |
|
| 59 |
if __name__ == "__main__":
|
|
|
|
| 16 |
wuaipojie_cookie_file,
|
| 17 |
wuaipojie_title,
|
| 18 |
wuaipojie_logger,
|
| 19 |
+
wuaipojie_img,
|
| 20 |
)
|
| 21 |
|
| 22 |
|
|
|
|
| 54 |
await browser.close()
|
| 55 |
# 推送
|
| 56 |
sign_result = sign_task.result()
|
| 57 |
+
push_msg(wuaipojie_title, "\n".join([sign_result]), wuaipojie_img)
|
| 58 |
|
| 59 |
|
| 60 |
if __name__ == "__main__":
|
_requests/aliyundrive.py
CHANGED
|
@@ -18,6 +18,7 @@ from __init__ import (
|
|
| 18 |
aliyundrive_reward_url,
|
| 19 |
aliyundrive_title,
|
| 20 |
aliyundrive_logger,
|
|
|
|
| 21 |
)
|
| 22 |
|
| 23 |
# session
|
|
@@ -42,7 +43,7 @@ def validate_access_token():
|
|
| 42 |
if resp.status_code != 200:
|
| 43 |
msg = "阿里云 access_token 失效"
|
| 44 |
aliyundrive_logger.error(msg)
|
| 45 |
-
push_msg(aliyundrive_title, msg)
|
| 46 |
else:
|
| 47 |
aliyundrive_logger.info("阿里云 access_token 有效")
|
| 48 |
new_access_token = resp.json()["access_token"]
|
|
@@ -57,12 +58,12 @@ def get_aliyun_nickname():
|
|
| 57 |
# 获取用户名
|
| 58 |
user_res = session.post(aliyundrive_nickname_url, headers=headers, json=query_body)
|
| 59 |
if user_res.status_code == 200:
|
| 60 |
-
|
| 61 |
nickname = user_res.json()["nick_name"]
|
| 62 |
else:
|
| 63 |
-
|
| 64 |
-
aliyundrive_logger.error(
|
| 65 |
-
push_msg(title=aliyundrive_title, message=
|
| 66 |
return nickname
|
| 67 |
|
| 68 |
|
|
@@ -72,7 +73,7 @@ def sign():
|
|
| 72 |
if sign_res.status_code != 200:
|
| 73 |
sign_msg = f"阿里云盘签到失败,stderr:{sign_res.json()}"
|
| 74 |
aliyundrive_logger.error(sign_msg)
|
| 75 |
-
push_msg(title=aliyundrive_title, message=
|
| 76 |
else:
|
| 77 |
sign_msg = f"阿里云盘签到成功"
|
| 78 |
aliyundrive_logger.info(sign_msg)
|
|
@@ -100,7 +101,7 @@ def get_reward(signin_count):
|
|
| 100 |
else:
|
| 101 |
reward_msg = f"领取奖励失败,stderr:{reward_res.json()}"
|
| 102 |
aliyundrive_logger.error(reward_msg)
|
| 103 |
-
push_msg(title=aliyundrive_title, message=reward_msg)
|
| 104 |
return reward_msg
|
| 105 |
return False
|
| 106 |
|
|
@@ -113,7 +114,7 @@ def aliyundrive_sign():
|
|
| 113 |
get_reward(signin_count)
|
| 114 |
message = f"{nickname} 签到成功,本月累计签到 {signin_count} 天\n本次签到获得:{curent_reward}"
|
| 115 |
aliyundrive_logger.info(message)
|
| 116 |
-
push_msg(title=aliyundrive_title, message=message)
|
| 117 |
return message
|
| 118 |
|
| 119 |
|
|
|
|
| 18 |
aliyundrive_reward_url,
|
| 19 |
aliyundrive_title,
|
| 20 |
aliyundrive_logger,
|
| 21 |
+
aliyundrive_img,
|
| 22 |
)
|
| 23 |
|
| 24 |
# session
|
|
|
|
| 43 |
if resp.status_code != 200:
|
| 44 |
msg = "阿里云 access_token 失效"
|
| 45 |
aliyundrive_logger.error(msg)
|
| 46 |
+
push_msg(aliyundrive_title, msg, aliyundrive_img)
|
| 47 |
else:
|
| 48 |
aliyundrive_logger.info("阿里云 access_token 有效")
|
| 49 |
new_access_token = resp.json()["access_token"]
|
|
|
|
| 58 |
# 获取用户名
|
| 59 |
user_res = session.post(aliyundrive_nickname_url, headers=headers, json=query_body)
|
| 60 |
if user_res.status_code == 200:
|
| 61 |
+
user_msg = f"获取用户名成功,stdout:{user_res.json()}"
|
| 62 |
nickname = user_res.json()["nick_name"]
|
| 63 |
else:
|
| 64 |
+
user_msg = f"获取用户名失败,stderr:{user_res.json()}"
|
| 65 |
+
aliyundrive_logger.error(user_msg)
|
| 66 |
+
push_msg(title=aliyundrive_title, message=user_msg, img_url=aliyundrive_img)
|
| 67 |
return nickname
|
| 68 |
|
| 69 |
|
|
|
|
| 73 |
if sign_res.status_code != 200:
|
| 74 |
sign_msg = f"阿里云盘签到失败,stderr:{sign_res.json()}"
|
| 75 |
aliyundrive_logger.error(sign_msg)
|
| 76 |
+
push_msg(title=aliyundrive_title, message=sign_res, img_url=aliyundrive_img)
|
| 77 |
else:
|
| 78 |
sign_msg = f"阿里云盘签到成功"
|
| 79 |
aliyundrive_logger.info(sign_msg)
|
|
|
|
| 101 |
else:
|
| 102 |
reward_msg = f"领取奖励失败,stderr:{reward_res.json()}"
|
| 103 |
aliyundrive_logger.error(reward_msg)
|
| 104 |
+
push_msg(title=aliyundrive_title, message=reward_msg, img_url=aliyundrive_img)
|
| 105 |
return reward_msg
|
| 106 |
return False
|
| 107 |
|
|
|
|
| 114 |
get_reward(signin_count)
|
| 115 |
message = f"{nickname} 签到成功,本月累计签到 {signin_count} 天\n本次签到获得:{curent_reward}"
|
| 116 |
aliyundrive_logger.info(message)
|
| 117 |
+
push_msg(title=aliyundrive_title, message=message, img_url=aliyundrive_img)
|
| 118 |
return message
|
| 119 |
|
| 120 |
|
config/settings_prod.py
CHANGED
|
@@ -13,9 +13,7 @@ from option_logger import register_logger
|
|
| 13 |
# playwright
|
| 14 |
browser_headless = True
|
| 15 |
browser_proxy = {"server": None}
|
| 16 |
-
user_agent = (
|
| 17 |
-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
|
| 18 |
-
)
|
| 19 |
ignore_https_errors = True
|
| 20 |
|
| 21 |
# api
|
|
@@ -25,6 +23,7 @@ api_token = os.environ.get("token")
|
|
| 25 |
gotify_host = os.environ.get("gotify_host")
|
| 26 |
gotify_port = os.environ.get("gotify_port")
|
| 27 |
gotify_token = os.environ.get("gotify_token")
|
|
|
|
| 28 |
|
| 29 |
# mysql
|
| 30 |
mysql_option = {
|
|
@@ -52,6 +51,7 @@ vits_logger = register_logger("vits", logfile_mapping["vits"])
|
|
| 52 |
vits_cookie_file = join(PROD_PATH, "cookie/vits.json")
|
| 53 |
hf_username = os.environ.get("hf_username")
|
| 54 |
hf_password = os.environ.get("hf_password")
|
|
|
|
| 55 |
|
| 56 |
# wuaipojie
|
| 57 |
wuaipojie_title = "wuaipojie"
|
|
@@ -59,6 +59,7 @@ wuaipojie_logger = register_logger("wuaipojie", logfile_mapping["wuaipojie"])
|
|
| 59 |
wuaipojie_cookie_file = join(PROD_PATH, "cookie/wuaipojie.json")
|
| 60 |
wuaipojie_url = "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"
|
| 61 |
wuaipojie_sign_url = "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"
|
|
|
|
| 62 |
|
| 63 |
# v2ex
|
| 64 |
v2ex_title = "V2EX"
|
|
@@ -66,15 +67,19 @@ v2ex_logger = register_logger("v2ex", logfile_mapping["v2ex"])
|
|
| 66 |
v2ex_cookie_file = join(PROD_PATH, "cookie/v2ex.json")
|
| 67 |
v2ex_url = "https://v2ex.com"
|
| 68 |
v2ex_sign_url = "https://v2ex.com/mission/daily"
|
|
|
|
| 69 |
|
| 70 |
# bilibili
|
| 71 |
bilibili_title = "Bilibili"
|
| 72 |
bilibili_logger = register_logger("bilibili", logfile_mapping["bilibili"])
|
| 73 |
bilibili_cookie_file = join(PROD_PATH, "cookie/bilibili.json")
|
| 74 |
bilibili_url = "https://account.bilibili.com/account/home"
|
| 75 |
-
bilibili_sign_url =
|
|
|
|
|
|
|
| 76 |
bilibili_live_url = "https://live.bilibili.com" # 直播间地址
|
| 77 |
bilibili_live_rooms = os.environ.get("bilibili_live_rooms")
|
|
|
|
| 78 |
|
| 79 |
# tsdm
|
| 80 |
tsdm_title = "天使动漫"
|
|
@@ -95,6 +100,7 @@ tsdm_minds = {
|
|
| 95 |
"yl": "慵懒",
|
| 96 |
"shuai": "衰",
|
| 97 |
} # 心情
|
|
|
|
| 98 |
|
| 99 |
# aliyundrive
|
| 100 |
aliyundrive_title = "阿里云盘"
|
|
@@ -106,3 +112,4 @@ aliyundrive_nickname_url = "https://api.aliyundrive.com/adrive/v2/user/get"
|
|
| 106 |
aliyundrive_access_token_url = "https://auth.aliyundrive.com/v2/account/token"
|
| 107 |
aliyundrive_signin_url = "https://member.aliyundrive.com/v1/activity/sign_in_list"
|
| 108 |
aliyundrive_reward_url = "https://member.aliyundrive.com/v1/activity/sign_in_reward"
|
|
|
|
|
|
| 13 |
# playwright
|
| 14 |
browser_headless = True
|
| 15 |
browser_proxy = {"server": None}
|
| 16 |
+
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
|
|
|
|
|
|
|
| 17 |
ignore_https_errors = True
|
| 18 |
|
| 19 |
# api
|
|
|
|
| 23 |
gotify_host = os.environ.get("gotify_host")
|
| 24 |
gotify_port = os.environ.get("gotify_port")
|
| 25 |
gotify_token = os.environ.get("gotify_token")
|
| 26 |
+
gotify_img = "https://img.evimo.top/bg.png"
|
| 27 |
|
| 28 |
# mysql
|
| 29 |
mysql_option = {
|
|
|
|
| 51 |
vits_cookie_file = join(PROD_PATH, "cookie/vits.json")
|
| 52 |
hf_username = os.environ.get("hf_username")
|
| 53 |
hf_password = os.environ.get("hf_password")
|
| 54 |
+
vits_img = "https://img.evimo.top/huggingface.png"
|
| 55 |
|
| 56 |
# wuaipojie
|
| 57 |
wuaipojie_title = "wuaipojie"
|
|
|
|
| 59 |
wuaipojie_cookie_file = join(PROD_PATH, "cookie/wuaipojie.json")
|
| 60 |
wuaipojie_url = "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"
|
| 61 |
wuaipojie_sign_url = "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"
|
| 62 |
+
wuaipojie_img = "https://img.evimo.top/wuaipojie.png"
|
| 63 |
|
| 64 |
# v2ex
|
| 65 |
v2ex_title = "V2EX"
|
|
|
|
| 67 |
v2ex_cookie_file = join(PROD_PATH, "cookie/v2ex.json")
|
| 68 |
v2ex_url = "https://v2ex.com"
|
| 69 |
v2ex_sign_url = "https://v2ex.com/mission/daily"
|
| 70 |
+
v2ex_img = "https://img.evimo.top/v2ex.png"
|
| 71 |
|
| 72 |
# bilibili
|
| 73 |
bilibili_title = "Bilibili"
|
| 74 |
bilibili_logger = register_logger("bilibili", logfile_mapping["bilibili"])
|
| 75 |
bilibili_cookie_file = join(PROD_PATH, "cookie/bilibili.json")
|
| 76 |
bilibili_url = "https://account.bilibili.com/account/home"
|
| 77 |
+
bilibili_sign_url = (
|
| 78 |
+
"https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign" # 签到地址
|
| 79 |
+
)
|
| 80 |
bilibili_live_url = "https://live.bilibili.com" # 直播间地址
|
| 81 |
bilibili_live_rooms = os.environ.get("bilibili_live_rooms")
|
| 82 |
+
bilibili_img = "https://img.evimo.top/bilibili.png"
|
| 83 |
|
| 84 |
# tsdm
|
| 85 |
tsdm_title = "天使动漫"
|
|
|
|
| 100 |
"yl": "慵懒",
|
| 101 |
"shuai": "衰",
|
| 102 |
} # 心情
|
| 103 |
+
tsdm_img = "https://img.evimo.top/tsdm.jpg"
|
| 104 |
|
| 105 |
# aliyundrive
|
| 106 |
aliyundrive_title = "阿里云盘"
|
|
|
|
| 112 |
aliyundrive_access_token_url = "https://auth.aliyundrive.com/v2/account/token"
|
| 113 |
aliyundrive_signin_url = "https://member.aliyundrive.com/v1/activity/sign_in_list"
|
| 114 |
aliyundrive_reward_url = "https://member.aliyundrive.com/v1/activity/sign_in_reward"
|
| 115 |
+
aliyundrive_img = "https://img.evimo.top/aliyundrive.png"
|
images/aliyundrive.png
ADDED
|
images/bg.png
ADDED
|
images/bilibili.png
ADDED
|
images/huggingface.png
ADDED
|
images/tsdm.jpg
ADDED
|
images/v2ex.png
ADDED
|
images/wuaipojie.png
ADDED
|
utils.py
CHANGED
|
@@ -17,6 +17,7 @@ from __init__ import (
|
|
| 17 |
gotify_host,
|
| 18 |
gotify_port,
|
| 19 |
gotify_token,
|
|
|
|
| 20 |
mysql_option,
|
| 21 |
DIR_PATH,
|
| 22 |
DEBUG,
|
|
@@ -24,7 +25,6 @@ from __init__ import (
|
|
| 24 |
browser_proxy,
|
| 25 |
ignore_https_errors,
|
| 26 |
user_agent,
|
| 27 |
-
aliyundrive_access_token_url,
|
| 28 |
)
|
| 29 |
|
| 30 |
|
|
@@ -107,12 +107,22 @@ def get_domain_ip(host: str) -> str:
|
|
| 107 |
|
| 108 |
|
| 109 |
# gotify 推送
|
| 110 |
-
def push_msg(title, message):
|
| 111 |
gotify_ip = get_domain_ip(gotify_host)
|
| 112 |
url = f"http://{gotify_ip}:{gotify_port}/message?token={gotify_token}"
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
|
| 118 |
def get_bilibili_live_rooms_from_pi() -> dict:
|
|
|
|
| 17 |
gotify_host,
|
| 18 |
gotify_port,
|
| 19 |
gotify_token,
|
| 20 |
+
gotify_img,
|
| 21 |
mysql_option,
|
| 22 |
DIR_PATH,
|
| 23 |
DEBUG,
|
|
|
|
| 25 |
browser_proxy,
|
| 26 |
ignore_https_errors,
|
| 27 |
user_agent,
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
|
|
|
|
| 107 |
|
| 108 |
|
| 109 |
# gotify 推送
|
| 110 |
+
def push_msg(title: str = "无标题", message: str = "无内容", img_url: str = gotify_img):
|
| 111 |
gotify_ip = get_domain_ip(gotify_host)
|
| 112 |
url = f"http://{gotify_ip}:{gotify_port}/message?token={gotify_token}"
|
| 113 |
+
resp = requests.post(
|
| 114 |
+
url,
|
| 115 |
+
json={
|
| 116 |
+
"title": title,
|
| 117 |
+
"message": message,
|
| 118 |
+
"priority": 10,
|
| 119 |
+
"extras": {
|
| 120 |
+
"client::display": {"contentType": "text/markdown"},
|
| 121 |
+
"client::notification": {"bigImageUrl": img_url},
|
| 122 |
+
},
|
| 123 |
+
},
|
| 124 |
+
)
|
| 125 |
+
return resp.json()
|
| 126 |
|
| 127 |
|
| 128 |
def get_bilibili_live_rooms_from_pi() -> dict:
|