-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 修复无法构建docker镜像的问题 * Update Dockerfile * 🔧 自动更新requirements * chore: 添加自动每日运行时间提示 * chore: 将时间类型从str改成int * Add files via upload * chore: 更新日志收集方法 * chore: 遵守代码规范 * chore: update issue templates * chore: 删除测试代码 * chore: 更改日志输出样式 * chore: docker生成配置时随机生成自动运行时间 * chore: trailing-whitespace * chore: 日志添加换行 * chore: 未配置验证码解决方案时直接跳过 * chore: 使用遍历方法找到键值,提升泛用性 * chore: 使用cron执行自动任务 * chore: snake_case * chore: 修改运行时间 * Update config.py * chore: 添加签到重试,仅每日签到获取token * 🔧 自动更新requirements * chore: 更新版本号 * Update config.py --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6f5bc44
commit f85232e
Showing
7 changed files
with
94 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
''' | ||
Date: 2023-11-13 20:29:19 | ||
LastEditors: Night-stars-1 [email protected] | ||
LastEditTime: 2023-11-24 16:23:43 | ||
LastEditTime: 2023-12-03 01:53:48 | ||
''' | ||
# new Env("MIUI-Auto-Task") # pylint: disable=missing-module-docstring | ||
# cron 30 8 * * * miuitask.py | ||
|
||
import asyncio | ||
|
||
from utils.api.login import Login | ||
from utils.api.sign import BaseSign | ||
from utils.api.sign import BaseSign, CheckIn | ||
from utils.config import ConfigManager | ||
from utils.logger import InterceptHandler, log | ||
from utils.request import notify_me | ||
|
@@ -25,7 +25,6 @@ async def main(): | |
for account in _conf.accounts: | ||
login_obj = Login(account) | ||
if cookies := await login_obj.login(): | ||
token = await get_token(cookies["cUserId"]) | ||
sign_obj = BaseSign(cookies) | ||
daily_tasks = await sign_obj.check_daily_tasks() | ||
sign_task_obj = sign_obj.AVAILABLE_SIGNS # 签到任务对象合集 | ||
|
@@ -34,6 +33,7 @@ async def main(): | |
log.info(f"开始执行{task.name}任务") | ||
if task_obj := sign_task_obj.get(task.name): # 签到任务对象 | ||
if getattr(account, task_obj.__name__): | ||
token = await get_token(cookies["cUserId"]) if task_obj == CheckIn else None | ||
await task_obj(cookies, token).sign() | ||
else: | ||
log.info(f"任务{task.name}被禁用") | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters