-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_wb.py
More file actions
56 lines (38 loc) · 1.27 KB
/
task_wb.py
File metadata and controls
56 lines (38 loc) · 1.27 KB
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
import asyncio
import os
import sys
# 添加项目根目录到Python路径
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from core import manually_weibo_sign, single_weibo_event_sign
from utils import push, init_config
from config import logger
# debugging
import logging
logger.setLevel(logging.DEBUG)
for handler in logger.handlers:
handler.setLevel(logging.DEBUG)
# debugging end
try:
from models import project_config
init_config(project_config.push_config)
except Exception as e:
logger.error(f"❌初始化推送配置失败:{e}")
print(f"❌初始化推送配置失败:{e}")
async def weibo_sign_task():
"""微博超话签到主函数"""
result = await manually_weibo_sign()
if result.is_success:
push(title="微博超话签到成功", push_message=result.message)
return result
async def weibo_event():
"""微博事件签到主函数"""
cookiestr = "xxxxxxx"
result = await single_weibo_event_sign(cookiestr)
logger.info(f"微博事件签到结果:{result}")
return result
if __name__ == "__main__":
async def main():
# logger.info("🎮开始执行微博超话签到...")
await weibo_sign_task()
# await weibo_event()
asyncio.run(main())