-
Notifications
You must be signed in to change notification settings - Fork 87
添加远程TG控制,修改删除只删除strm文件,保留nfo等元数据 #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
更新tg相关配置
tg机器人
tg机器人相关
修改只删除strm文件,不会删除nfo等元数据信息
|
|
期待这个功能 |
AkimioJR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改意见(之前忘记提交了)
|
|
||
| # 菜单导航 | ||
| if callback_data.startswith("menu_") : | ||
| menu_type = callback_data[5 :] # 去掉 "menu_" 前缀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该使用.replace()函数
| @@ -0,0 +1,1271 @@ | |||
| from typing import Dict, List, Callable, Awaitable, Any, Optional, Union, Tuple, Set | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dict、List、Optional、Union、Tuple应该使用dict、list、| None、|、tuple替代
| pydantic == 2.9.2 | ||
| pypinyin == 0.53.0 | ||
| pypinyin == 0.53.0 | ||
| python-telegram-bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需提供准确的版本信息
| rss_domain: api.ani.rip # AniOpen 项目 RSS 订阅域名(可选,默认为 api.ani.rip) | ||
|
|
||
| TelegramBot: | ||
| token: "" # 你的 Telegram 机器人令牌(从 BotFather 获取) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释需要对齐
| async def _handle_admin_system_status(self, query) -> None: | ||
| """Handle admin system status action""" | ||
| import platform | ||
| import psutil # 确保已安装 psutil 库 | ||
|
|
||
| # 系统信息 | ||
| system_info = f"系统: {platform.system()} {platform.release()}\n" | ||
| system_info += f"Python: {platform.python_version()}\n" | ||
|
|
||
| # CPU 使用率 | ||
| cpu_percent = psutil.cpu_percent(interval=1) | ||
| system_info += f"CPU 使用率: {cpu_percent}%\n" | ||
|
|
||
| # 内存使用率 | ||
| memory = psutil.virtual_memory() | ||
| memory_percent = memory.percent | ||
| memory_used = memory.used / (1024 * 1024 * 1024) # 转换为 GB | ||
| memory_total = memory.total / (1024 * 1024 * 1024) # 转换为 GB | ||
| system_info += f"内存使用率: {memory_percent}% ({memory_used:.2f}GB / {memory_total:.2f}GB)\n" | ||
|
|
||
| # 磁盘使用率 | ||
| disk = psutil.disk_usage('/') | ||
| disk_percent = disk.percent | ||
| disk_used = disk.used / (1024 * 1024 * 1024) # 转换为 GB | ||
| disk_total = disk.total / (1024 * 1024 * 1024) # 转换为 GB | ||
| system_info += f"磁盘使用率: {disk_percent}% ({disk_used:.2f}GB / {disk_total:.2f}GB)\n" | ||
|
|
||
| # 进程信息 | ||
| process = psutil.Process() | ||
| process_cpu = process.cpu_percent(interval=1) | ||
| process_memory = process.memory_info().rss / (1024 * 1024) # 转换为 MB | ||
| system_info += f"进程 CPU 使用率: {process_cpu}%\n" | ||
| system_info += f"进程内存使用: {process_memory:.2f}MB\n" | ||
|
|
||
| # 运行时间 | ||
| boot_time = psutil.boot_time() | ||
| uptime = time.time() - boot_time | ||
| uptime_text = self._format_duration(uptime) | ||
| system_info += f"系统运行时间: {uptime_text}\n" | ||
|
|
||
| # AutoFilm 信息 | ||
| system_info += f"\nAutoFilm 版本: {settings.APP_VERSION}\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段读取系统配置信息不应放在这个类里面
| allowed_users: List[int] = None, | ||
| proxy_url: str = None, | ||
| admin_users: List[int] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型不正确,cython编译后运行会报错
如图




tg机器人如图