Open
Conversation
更新tg相关配置
tg机器人
tg机器人相关
修改只删除strm文件,不会删除nfo等元数据信息
Owner
|
|
期待这个功能 |
AkimioJR
reviewed
Jul 17, 2025
|
|
||
| # 菜单导航 | ||
| if callback_data.startswith("menu_") : | ||
| menu_type = callback_data[5 :] # 去掉 "menu_" 前缀 |
| @@ -0,0 +1,1271 @@ | |||
| from typing import Dict, List, Callable, Awaitable, Any, Optional, Union, Tuple, Set | |||
Owner
There was a problem hiding this comment.
Dict、List、Optional、Union、Tuple应该使用dict、list、| None、|、tuple替代
| pydantic == 2.9.2 | ||
| pypinyin == 0.53.0 | ||
| pypinyin == 0.53.0 | ||
| python-telegram-bot |
| rss_domain: api.ani.rip # AniOpen 项目 RSS 订阅域名(可选,默认为 api.ani.rip) | ||
|
|
||
| TelegramBot: | ||
| token: "" # 你的 Telegram 机器人令牌(从 BotFather 获取) |
Comment on lines
819
to
860
| 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" |
Comment on lines
26
to
28
| allowed_users: List[int] = None, | ||
| proxy_url: str = None, | ||
| admin_users: List[int] = None, |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
如图




tg机器人如图