This commit is contained in:
2026-05-09 20:10:44 +00:00
parent 226d9d0508
commit 90d4000081
5 changed files with 484 additions and 2 deletions
+30
View File
@@ -28,10 +28,40 @@ password = "meow"
otp_key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
api_key = "01234567-0123-0123-0123-0123456789ab"
[openai]
token = "sk-your-openai-token"
[paths]
qb_download_dir = "/data/QB"
jellyfin_dir = "/data/Jellyfin"
[telegram]
# 也可以不写在 config.toml,改用环境变量 TELEGRAM_BOT_TOKEN
bot_token = "123456:telegram-bot-token"
# 建议限制允许使用 bot 的 chat id;不配置则所有 chat 都可以触发下载
allowed_chat_ids = [123456789]
workers = 2
progress_interval = 10
```
2. 装依赖:`uv sync`
3. 跑: `uv run launcher.py tt114514 tt1919810 ...`
## Telegram bot
配置好 `[telegram]` 后运行:
```bash
uv run telegram_bot.py
```
然后给 bot 发送 `/download tt0903747`,或者 `/download` 加任意包含 IMDB tt id 的 URL/text。URL 被 decode 后包含 tt id 也可以识别。bot 会启动现有的 `workflow.py`,并把下载进度、当前步骤和日志路径持续更新到 Telegram 消息里。
如果在群聊里开着 Telegram bot privacy mode,请使用 `/download@YourBotUsername tt0903747`。普通的 `@YourBotUsername tt0903747` mention 通常不会被 Telegram 投递给 bot。
可用命令:
- `/help`:查看用法
- `/download tt0903747`:开始处理 IMDB ID
- `/status`:查看当前队列/运行中的 IMDB ID
- `/chatid`:查看当前 Telegram chat id,方便配置 `allowed_chat_ids`