diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b971fb06..14524e44 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -2,10 +2,8 @@ import { defineConfig } from 'vitepress' const version = `v3.2` -export default defineConfig({ - title: 'AutoBangumi', - description: 'Automatic anime downloading and organization from RSS feeds', - +// Shared configuration +const sharedConfig = { head: [ ['link', { rel: 'icon', type: 'image/svg+xml', href: '/light-logo.svg' }], ['meta', { property: 'og:image', content: '/social.png' }], @@ -13,23 +11,13 @@ export default defineConfig({ ['meta', { property: 'og:url', content: 'https://www.autobangumi.org' }], ['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-3Z8W6WMN7J' }], ['script', {}, `window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-3Z8W6WMN7J');`], - ], + ] as any, themeConfig: { logo: { dark: '/dark-logo.svg', light: '/light-logo.svg', }, - - editLink: { - pattern: 'https://github.com/EstrellaXD/Auto_Bangumi/edit/main/docs/:path', - text: 'Edit this page on GitHub', - }, - - search: { - provider: 'local', - }, - socialLinks: [ { icon: 'github', link: 'https://github.com/EstrellaXD/Auto_Bangumi' }, { @@ -39,88 +27,218 @@ export default defineConfig({ link: 'https://t.me/autobangumi', }, ], - - nav: [ - { text: 'About', link: '/home/' }, - { text: 'Quick Start', link: '/deploy/quick-start' }, - { text: 'FAQ', link: '/faq/' }, - { text: 'API', link: '/api/' }, - ], - - footer: { - message: `AutoBangumi is released under the MIT License. (latest: ${version})`, - copyright: 'Copyright © 2021-present @EstrellaXD & AutoBangumi Contributors', + search: { + provider: 'local', }, + }, +} - sidebar: [ - { - items: [ - { text: 'About', link: '/home/' }, - { text: 'Quick Start', link: '/deploy/quick-start' }, - { text: 'How It Works', link: '/home/pipline' }, - ], - }, - { - text: 'Deployment', - items: [ - { text: 'Docker CLI', link: '/deploy/docker-cli' }, - { text: 'Docker Compose', link: '/deploy/docker-compose' }, - { text: 'Synology NAS (DSM)', link: '/deploy/dsm' }, - { text: 'Local Deployment', link: '/deploy/local' }, - ], - }, - { - text: 'Configuration', - items: [ - { text: 'RSS Feed Setup', link: '/config/rss' }, - { text: 'Program Settings', link: '/config/program' }, - { text: 'Downloader Settings', link: '/config/downloader' }, - { text: 'Parser Settings', link: '/config/parser' }, - { text: 'Notification Settings', link: '/config/notifier' }, - { text: 'Bangumi Manager', link: '/config/manager' }, - { text: 'Proxy Settings', link: '/config/proxy' }, - { text: 'Experimental Features', link: '/config/experimental' }, - ], - }, - { - text: 'Features', - items: [ - { text: 'RSS Management', link: '/feature/rss' }, - { text: 'Bangumi Management', link: '/feature/bangumi' }, - { text: 'Calendar View', link: '/feature/calendar' }, - { text: 'File Renaming', link: '/feature/rename' }, - { text: 'Torrent Search', link: '/feature/search' }, - ], - }, - { - text: 'FAQ', - items: [ - { text: 'Common Questions', link: '/faq/' }, - { text: 'Troubleshooting', link: '/faq/troubleshooting' }, - { text: 'Network Issues', link: '/faq/network' }, - ], - }, - { - text: 'API Reference', - items: [ - { text: 'REST API', link: '/api/' }, - ], - }, - { - text: 'Changelog', - items: [ - { text: '3.2 Release Notes', link: '/changelog/3.2' }, - { text: '3.1 Release Notes', link: '/changelog/3.1' }, - { text: '3.0 Release Notes', link: '/changelog/3.0' }, - { text: '2.6 Release Notes', link: '/changelog/2.6' }, - ], - }, - { - text: 'Developer Guide', - items: [ - { text: 'Contributing', link: '/dev/' }, - ], - }, +// Chinese sidebar (default) +const zhSidebar = [ + { + items: [ + { text: '关于', link: '/home/' }, + { text: '快速开始', link: '/deploy/quick-start' }, + { text: '工作原理', link: '/home/pipline' }, ], }, + { + text: '部署', + items: [ + { text: 'Docker CLI', link: '/deploy/docker-cli' }, + { text: 'Docker Compose', link: '/deploy/docker-compose' }, + { text: '群晖 NAS (DSM)', link: '/deploy/dsm' }, + { text: '本地部署', link: '/deploy/local' }, + ], + }, + { + text: '配置', + items: [ + { text: 'RSS 订阅设置', link: '/config/rss' }, + { text: '程序设置', link: '/config/program' }, + { text: '下载器设置', link: '/config/downloader' }, + { text: '解析器设置', link: '/config/parser' }, + { text: '通知设置', link: '/config/notifier' }, + { text: '番剧管理设置', link: '/config/manager' }, + { text: '代理设置', link: '/config/proxy' }, + { text: '实验性功能', link: '/config/experimental' }, + ], + }, + { + text: '功能', + items: [ + { text: 'RSS 管理', link: '/feature/rss' }, + { text: '番剧管理', link: '/feature/bangumi' }, + { text: '日历视图', link: '/feature/calendar' }, + { text: '文件重命名', link: '/feature/rename' }, + { text: '种子搜索', link: '/feature/search' }, + ], + }, + { + text: '常见问题', + items: [ + { text: '常见问题', link: '/faq/' }, + { text: '故障排除', link: '/faq/troubleshooting' }, + { text: '网络问题', link: '/faq/network' }, + ], + }, + { + text: 'API 参考', + items: [ + { text: 'REST API', link: '/api/' }, + ], + }, + { + text: '更新日志', + items: [ + { text: '3.2 版本说明', link: '/changelog/3.2' }, + { text: '3.1 版本说明', link: '/changelog/3.1' }, + { text: '3.0 版本说明', link: '/changelog/3.0' }, + { text: '2.6 版本说明', link: '/changelog/2.6' }, + ], + }, + { + text: '开发者指南', + items: [ + { text: '参与贡献', link: '/dev/' }, + ], + }, +] + +// English sidebar +const enSidebar = [ + { + items: [ + { text: 'About', link: '/en/home/' }, + { text: 'Quick Start', link: '/en/deploy/quick-start' }, + { text: 'How It Works', link: '/en/home/pipline' }, + ], + }, + { + text: 'Deployment', + items: [ + { text: 'Docker CLI', link: '/en/deploy/docker-cli' }, + { text: 'Docker Compose', link: '/en/deploy/docker-compose' }, + { text: 'Synology NAS (DSM)', link: '/en/deploy/dsm' }, + { text: 'Local Deployment', link: '/en/deploy/local' }, + ], + }, + { + text: 'Configuration', + items: [ + { text: 'RSS Feed Setup', link: '/en/config/rss' }, + { text: 'Program Settings', link: '/en/config/program' }, + { text: 'Downloader Settings', link: '/en/config/downloader' }, + { text: 'Parser Settings', link: '/en/config/parser' }, + { text: 'Notification Settings', link: '/en/config/notifier' }, + { text: 'Bangumi Manager', link: '/en/config/manager' }, + { text: 'Proxy Settings', link: '/en/config/proxy' }, + { text: 'Experimental Features', link: '/en/config/experimental' }, + ], + }, + { + text: 'Features', + items: [ + { text: 'RSS Management', link: '/en/feature/rss' }, + { text: 'Bangumi Management', link: '/en/feature/bangumi' }, + { text: 'Calendar View', link: '/en/feature/calendar' }, + { text: 'File Renaming', link: '/en/feature/rename' }, + { text: 'Torrent Search', link: '/en/feature/search' }, + ], + }, + { + text: 'FAQ', + items: [ + { text: 'Common Questions', link: '/en/faq/' }, + { text: 'Troubleshooting', link: '/en/faq/troubleshooting' }, + { text: 'Network Issues', link: '/en/faq/network' }, + ], + }, + { + text: 'API Reference', + items: [ + { text: 'REST API', link: '/en/api/' }, + ], + }, + { + text: 'Changelog', + items: [ + { text: '3.2 Release Notes', link: '/en/changelog/3.2' }, + { text: '3.1 Release Notes', link: '/en/changelog/3.1' }, + { text: '3.0 Release Notes', link: '/en/changelog/3.0' }, + { text: '2.6 Release Notes', link: '/en/changelog/2.6' }, + ], + }, + { + text: 'Developer Guide', + items: [ + { text: 'Contributing', link: '/en/dev/' }, + ], + }, +] + +export default defineConfig({ + title: 'AutoBangumi', + description: '基于 RSS 的全自动番剧下载与整理工具', + ...sharedConfig, + + locales: { + root: { + label: '简体中文', + lang: 'zh-CN', + themeConfig: { + nav: [ + { text: '关于', link: '/home/' }, + { text: '快速开始', link: '/deploy/quick-start' }, + { text: '常见问题', link: '/faq/' }, + { text: 'API', link: '/api/' }, + ], + sidebar: zhSidebar, + editLink: { + pattern: 'https://github.com/EstrellaXD/Auto_Bangumi/edit/main/docs/:path', + text: '在 GitHub 上编辑此页', + }, + footer: { + message: `AutoBangumi 基于 MIT 许可证发布。(最新版本: ${version})`, + copyright: 'Copyright © 2021-present @EstrellaXD & AutoBangumi Contributors', + }, + docFooter: { + prev: '上一页', + next: '下一页', + }, + outline: { + label: '目录', + }, + lastUpdated: { + text: '最后更新于', + }, + returnToTopLabel: '返回顶部', + sidebarMenuLabel: '菜单', + darkModeSwitchLabel: '主题', + langMenuLabel: '切换语言', + }, + }, + en: { + label: 'English', + lang: 'en-US', + link: '/en/', + themeConfig: { + nav: [ + { text: 'About', link: '/en/home/' }, + { text: 'Quick Start', link: '/en/deploy/quick-start' }, + { text: 'FAQ', link: '/en/faq/' }, + { text: 'API', link: '/en/api/' }, + ], + sidebar: enSidebar, + editLink: { + pattern: 'https://github.com/EstrellaXD/Auto_Bangumi/edit/main/docs/:path', + text: 'Edit this page on GitHub', + }, + footer: { + message: `AutoBangumi is released under the MIT License. (latest: ${version})`, + copyright: 'Copyright © 2021-present @EstrellaXD & AutoBangumi Contributors', + }, + }, + }, + }, }) diff --git a/docs/api/index.md b/docs/api/index.md index 3fd718c6..844aa014 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,26 +1,26 @@ -# REST API Reference +# REST API 参考 -AutoBangumi exposes a REST API at `/api/v1`. All endpoints (except login and setup) require JWT authentication. +AutoBangumi 在 `/api/v1` 路径下提供 REST API。除登录和设置向导外,所有端点都需要 JWT 认证。 -**Base URL:** `http://your-host:7892/api/v1` +**基础 URL:** `http://your-host:7892/api/v1` -**Authentication:** Include the JWT token as a cookie or `Authorization: Bearer ` header. +**认证:** 将 JWT 令牌作为 cookie 或 `Authorization: Bearer ` 请求头传入。 -**Interactive Docs:** When running in development mode, Swagger UI is available at `http://your-host:7892/docs`. +**交互式文档:** 在开发模式下运行时,可在 `http://your-host:7892/docs` 访问 Swagger UI。 --- -## Authentication +## 认证 -### Login +### 登录 ``` POST /auth/login ``` -Authenticate with username and password. +使用用户名和密码进行认证。 -**Request Body:** +**请求体:** ```json { "username": "string", @@ -28,33 +28,33 @@ Authenticate with username and password. } ``` -**Response:** Sets authentication cookie with JWT token. +**响应:** 设置包含 JWT 令牌的认证 cookie。 -### Refresh Token +### 刷新令牌 ``` GET /auth/refresh_token ``` -Refresh the current authentication token. +刷新当前的认证令牌。 -### Logout +### 登出 ``` GET /auth/logout ``` -Clear authentication cookies and log out. +清除认证 cookie 并登出。 -### Update Credentials +### 更新凭据 ``` POST /auth/update ``` -Update username and/or password. +更新用户名和/或密码。 -**Request Body:** +**请求体:** ```json { "username": "string", @@ -66,194 +66,194 @@ Update username and/or password. ## Passkey / WebAuthn -Passwordless authentication using WebAuthn/FIDO2 Passkeys. +使用 WebAuthn/FIDO2 Passkey 进行无密码认证。 -### Register Passkey +### 注册 Passkey ``` POST /passkey/register/options ``` -Get WebAuthn registration options (challenge, relying party info). +获取 WebAuthn 注册选项(质询、依赖方信息)。 ``` POST /passkey/register/verify ``` -Verify and save the Passkey registration response from the browser. +验证并保存来自浏览器的 Passkey 注册响应。 -### Authenticate with Passkey +### 使用 Passkey 认证 ``` POST /passkey/auth/options ``` -Get WebAuthn authentication challenge options. +获取 WebAuthn 认证质询选项。 ``` POST /passkey/auth/verify ``` -Verify the Passkey authentication response and issue a JWT token. +验证 Passkey 认证响应并签发 JWT 令牌。 -### Manage Passkeys +### 管理 Passkey ``` GET /passkey/list ``` -List all registered Passkeys for the current user. +列出当前用户所有已注册的 Passkey。 ``` POST /passkey/delete ``` -Delete a registered Passkey by credential ID. +通过凭据 ID 删除已注册的 Passkey。 --- -## Configuration +## 配置 -### Get Configuration +### 获取配置 ``` GET /config/get ``` -Retrieve the current application configuration. +获取当前应用程序配置。 -**Response:** Full configuration object including `program`, `downloader`, `rss_parser`, `bangumi_manager`, `notification`, `proxy`, and `experimental_openai` sections. +**响应:** 完整配置对象,包括 `program`、`downloader`、`rss_parser`、`bangumi_manager`、`notification`、`proxy` 和 `experimental_openai` 部分。 -### Update Configuration +### 更新配置 ``` PATCH /config/update ``` -Partially update the application configuration. Only include fields you want to change. +部分更新应用程序配置。只需包含您想要更改的字段。 -**Request Body:** Partial configuration object. +**请求体:** 部分配置对象。 --- -## Bangumi (Anime Rules) +## 番剧(动画规则) -### List All Bangumi +### 列出所有番剧 ``` GET /bangumi/get/all ``` -Get all anime download rules. +获取所有动画下载规则。 -### Get Bangumi by ID +### 通过 ID 获取番剧 ``` GET /bangumi/get/{bangumi_id} ``` -Get a specific anime rule by ID. +通过 ID 获取特定动画规则。 -### Update Bangumi +### 更新番剧 ``` PATCH /bangumi/update/{bangumi_id} ``` -Update an anime rule's metadata (title, season, episode offset, etc.). +更新动画规则的元数据(标题、季度、集数偏移等)。 -### Delete Bangumi +### 删除番剧 ``` DELETE /bangumi/delete/{bangumi_id} ``` -Delete a single anime rule and its associated torrents. +删除单个动画规则及其关联的种子。 ``` DELETE /bangumi/delete/many/ ``` -Batch delete multiple anime rules. +批量删除多个动画规则。 -**Request Body:** +**请求体:** ```json { "bangumi_ids": [1, 2, 3] } ``` -### Disable / Enable Bangumi +### 禁用/启用番剧 ``` DELETE /bangumi/disable/{bangumi_id} ``` -Disable an anime rule (keeps files, stops downloading). +禁用动画规则(保留文件,停止下载)。 ``` DELETE /bangumi/disable/many/ ``` -Batch disable multiple anime rules. +批量禁用多个动画规则。 ``` GET /bangumi/enable/{bangumi_id} ``` -Re-enable a previously disabled anime rule. +重新启用之前禁用的动画规则。 -### Poster Refresh +### 刷新海报 ``` GET /bangumi/refresh/poster/all ``` -Refresh poster images for all anime from TMDB. +从 TMDB 刷新所有动画的海报图片。 ``` GET /bangumi/refresh/poster/{bangumi_id} ``` -Refresh the poster image for a specific anime. +刷新特定动画的海报图片。 -### Calendar +### 日历 ``` GET /bangumi/refresh/calendar ``` -Refresh the anime broadcast calendar data from Bangumi.tv. +从 Bangumi.tv 刷新动画放送日历数据。 -### Reset All +### 重置全部 ``` GET /bangumi/reset/all ``` -Delete all anime rules. Use with caution. +删除所有动画规则。请谨慎使用。 --- -## RSS Feeds +## RSS 订阅源 -### List All Feeds +### 列出所有订阅源 ``` GET /rss ``` -Get all configured RSS feeds. +获取所有已配置的 RSS 订阅源。 -### Add Feed +### 添加订阅源 ``` POST /rss/add ``` -Add a new RSS feed subscription. +添加新的 RSS 订阅源。 -**Request Body:** +**请求体:** ```json { "url": "string", @@ -262,79 +262,79 @@ Add a new RSS feed subscription. } ``` -### Enable / Disable Feeds +### 启用/禁用订阅源 ``` POST /rss/enable/many ``` -Enable multiple RSS feeds. +启用多个 RSS 订阅源。 ``` PATCH /rss/disable/{rss_id} ``` -Disable a single RSS feed. +禁用单个 RSS 订阅源。 ``` POST /rss/disable/many ``` -Batch disable multiple RSS feeds. +批量禁用多个 RSS 订阅源。 -### Delete Feeds +### 删除订阅源 ``` DELETE /rss/delete/{rss_id} ``` -Delete a single RSS feed. +删除单个 RSS 订阅源。 ``` POST /rss/delete/many ``` -Batch delete multiple RSS feeds. +批量删除多个 RSS 订阅源。 -### Update Feed +### 更新订阅源 ``` PATCH /rss/update/{rss_id} ``` -Update an RSS feed's configuration. +更新 RSS 订阅源的配置。 -### Refresh Feeds +### 刷新订阅源 ``` GET /rss/refresh/all ``` -Manually trigger a refresh of all RSS feeds. +手动触发刷新所有 RSS 订阅源。 ``` GET /rss/refresh/{rss_id} ``` -Refresh a specific RSS feed. +刷新特定的 RSS 订阅源。 -### Get Torrents from Feed +### 获取订阅源中的种子 ``` GET /rss/torrent/{rss_id} ``` -Get the list of torrents parsed from a specific RSS feed. +获取从特定 RSS 订阅源解析的种子列表。 -### Analysis & Subscription +### 分析与订阅 ``` POST /rss/analysis ``` -Analyze an RSS URL and extract anime metadata without subscribing. +分析 RSS URL 并提取动画元数据,但不订阅。 -**Request Body:** +**请求体:** ```json { "url": "string" @@ -345,53 +345,53 @@ Analyze an RSS URL and extract anime metadata without subscribing. POST /rss/collect ``` -Download all episodes from an RSS feed (for completed anime). +从 RSS 订阅源下载所有剧集(用于已完结动画)。 ``` POST /rss/subscribe ``` -Subscribe to an RSS feed for automatic ongoing downloads. +订阅 RSS 订阅源以自动下载连载中的动画。 --- -## Search +## 搜索 -### Search Bangumi (Server-Sent Events) +### 搜索番剧(Server-Sent Events) ``` GET /search/bangumi?keyword={keyword}&provider={provider} ``` -Search for anime torrents. Returns results as a Server-Sent Events (SSE) stream for real-time updates. +搜索动画种子。以 Server-Sent Events (SSE) 流的形式返回结果,提供实时更新。 -**Query Parameters:** -- `keyword` — Search keyword -- `provider` — Search provider (e.g., `mikan`, `nyaa`, `dmhy`) +**查询参数:** +- `keyword` — 搜索关键词 +- `provider` — 搜索提供者(例如 `mikan`、`nyaa`、`dmhy`) -**Response:** SSE stream with parsed search results. +**响应:** 包含解析后搜索结果的 SSE 流。 -### List Search Providers +### 列出搜索提供者 ``` GET /search/provider ``` -Get the list of available search providers. +获取可用搜索提供者的列表。 --- -## Program Control +## 程序控制 -### Get Status +### 获取状态 ``` GET /status ``` -Get program status including version, running state, and first_run flag. +获取程序状态,包括版本、运行状态和 first_run 标志。 -**Response:** +**响应:** ```json { "status": "running", @@ -400,99 +400,99 @@ Get program status including version, running state, and first_run flag. } ``` -### Start Program +### 启动程序 ``` GET /start ``` -Start the main program (RSS checking, downloading, renaming). +启动主程序(RSS 检查、下载、重命名)。 -### Restart Program +### 重启程序 ``` GET /restart ``` -Restart the main program. +重启主程序。 -### Stop Program +### 停止程序 ``` GET /stop ``` -Stop the main program (WebUI remains accessible). +停止主程序(WebUI 仍可访问)。 -### Shutdown +### 关闭 ``` GET /shutdown ``` -Shutdown the entire application (restarts the Docker container). +关闭整个应用程序(重启 Docker 容器)。 -### Check Downloader +### 检查下载器 ``` GET /check/downloader ``` -Test connectivity to the configured downloader (qBittorrent). +测试与已配置的下载器(qBittorrent)的连接。 --- -## Downloader Management +## 下载器管理 -Manage torrents in the downloader directly from AutoBangumi. +直接从 AutoBangumi 管理下载器中的种子。 -### List Torrents +### 列出种子 ``` GET /downloader/torrents ``` -Get all torrents in the Bangumi category. +获取 Bangumi 分类中的所有种子。 -### Pause Torrents +### 暂停种子 ``` POST /downloader/torrents/pause ``` -Pause torrents by hash. +通过哈希暂停种子。 -**Request Body:** +**请求体:** ```json { "hashes": ["hash1", "hash2"] } ``` -### Resume Torrents +### 恢复种子 ``` POST /downloader/torrents/resume ``` -Resume paused torrents by hash. +通过哈希恢复已暂停的种子。 -**Request Body:** +**请求体:** ```json { "hashes": ["hash1", "hash2"] } ``` -### Delete Torrents +### 删除种子 ``` POST /downloader/torrents/delete ``` -Delete torrents with optional file deletion. +删除种子,可选择是否删除文件。 -**Request Body:** +**请求体:** ```json { "hashes": ["hash1", "hash2"], @@ -502,34 +502,34 @@ Delete torrents with optional file deletion. --- -## Setup Wizard +## 设置向导 -These endpoints are only available during first-run setup (before setup is complete). They do **not** require authentication. After setup completes, all endpoints return `403 Forbidden`. +这些端点仅在首次运行设置期间可用(设置完成前)。它们**不**需要认证。设置完成后,所有端点返回 `403 Forbidden`。 -### Check Setup Status +### 检查设置状态 ``` GET /setup/status ``` -Check if setup wizard is needed (first run). +检查是否需要设置向导(首次运行)。 -**Response:** +**响应:** ```json { "need_setup": true } ``` -### Test Downloader Connection +### 测试下载器连接 ``` POST /setup/test-downloader ``` -Test connection to a downloader with provided credentials. +使用提供的凭据测试与下载器的连接。 -**Request Body:** +**请求体:** ```json { "type": "qbittorrent", @@ -540,30 +540,30 @@ Test connection to a downloader with provided credentials. } ``` -### Test RSS Feed +### 测试 RSS 订阅源 ``` POST /setup/test-rss ``` -Validate an RSS feed URL is accessible and parseable. +验证 RSS 订阅源 URL 是否可访问和可解析。 -**Request Body:** +**请求体:** ```json { "url": "https://mikanime.tv/RSS/MyBangumi?token=xxx" } ``` -### Test Notification +### 测试通知 ``` POST /setup/test-notification ``` -Send a test notification with provided settings. +使用提供的设置发送测试通知。 -**Request Body:** +**请求体:** ```json { "type": "telegram", @@ -572,48 +572,48 @@ Send a test notification with provided settings. } ``` -### Complete Setup +### 完成设置 ``` POST /setup/complete ``` -Save all configuration and mark setup as complete. Creates the sentinel file `config/.setup_complete`. +保存所有配置并将设置标记为完成。创建标记文件 `config/.setup_complete`。 -**Request Body:** Full configuration object. +**请求体:** 完整配置对象。 --- -## Logs +## 日志 -### Get Logs +### 获取日志 ``` GET /log ``` -Retrieve the full application log file. +获取完整的应用程序日志文件。 -### Clear Logs +### 清除日志 ``` GET /log/clear ``` -Clear the log file. +清除日志文件。 --- -## Response Format +## 响应格式 -All API responses follow a consistent format: +所有 API 响应遵循统一格式: ```json { "msg_en": "Success message in English", - "msg_zh": "Success message in Chinese", + "msg_zh": "成功消息(中文)", "status": true } ``` -Error responses include appropriate HTTP status codes (400, 401, 403, 404, 500) with error messages in both languages. +错误响应包含适当的 HTTP 状态码(400、401、403、404、500)以及中英文错误消息。 diff --git a/docs/changelog/2.6.md b/docs/changelog/2.6.md index 3b546ed2..99add6d5 100644 --- a/docs/changelog/2.6.md +++ b/docs/changelog/2.6.md @@ -1,43 +1,43 @@ -# [2.6] Release Notes +# [2.6] 发布说明 -## Upgrade Notes from Older Versions +## 从旧版本升级说明 -Starting from version 2.6, AutoBangumi (AB) configuration has moved from environment variables to `config.json`. Note the following before upgrading. +从 2.6 版本开始,AutoBangumi (AB) 配置已从环境变量迁移到 `config.json`。升级前请注意以下事项。 -### Environment Variable Migration +### 环境变量迁移 -Old environment variables are automatically converted to `config.json` on the first startup after upgrading to 2.6. The generated `config.json` is placed in the `/app/config` folder. -Once you've mapped the `/app/config` folder, old environment variables no longer affect AB's operation. You can delete `config.json` to regenerate from environment variables. +升级到 2.6 后首次启动时,旧环境变量会自动转换为 `config.json`。生成的 `config.json` 放置在 `/app/config` 文件夹中。 +一旦您映射了 `/app/config` 文件夹,旧环境变量将不再影响 AB 的运行。您可以删除 `config.json` 以从环境变量重新生成。 -### Container Volume Mapping +### 容器卷映射 -After version 2.6, the following folders need to be mapped: +2.6 版本之后,需要映射以下文件夹: -- `/app/config`: Configuration folder containing `config.json` -- `/app/data`: Data folder containing `bangumi.json`, etc. +- `/app/config`:配置文件夹,包含 `config.json` +- `/app/data`:数据文件夹,包含 `bangumi.json` 等 -### Data Files +### 数据文件 -Due to major updates, we don't recommend using old data files. AB will automatically generate a new `bangumi.json` in `/app/data`. +由于重大更新,我们不建议使用旧数据文件。AB 会在 `/app/data` 中自动生成新的 `bangumi.json`。 -Don't worry — QB won't re-download previously downloaded anime. +不用担心 — QB 不会重新下载之前已下载的动画。 -### Subsequent Configuration Changes +### 后续配置更改 -AB can now edit configuration directly in the WebUI. After editing, restart the container for changes to take effect. +AB 现在可以直接在 WebUI 中编辑配置。编辑后重启容器即可生效。 -## How to Upgrade +## 如何升级 ### Docker Compose -You can use your existing docker-compose.yml file to upgrade: +您可以使用现有的 docker-compose.yml 文件进行升级: ```bash docker compose stop autobangumi docker compose pull autobangumi ``` -Then modify docker-compose.yml to add volume mappings: +然后修改 docker-compose.yml 添加卷映射: ```yaml version: "3.8" @@ -60,7 +60,7 @@ services: - 8.8.8.8 ``` -Then start AB: +然后启动 AB: ```bash docker compose up -d autobangumi @@ -68,70 +68,70 @@ docker compose up -d autobangumi ### Portainer -In Portainer, modify the volume mappings and click `Recreate` to complete the upgrade. +在 Portainer 中,修改卷映射并点击 `Recreate` 完成升级。 -### What to do if the upgrade causes issues +### 升级导致问题怎么办 -Since configurations may vary, upgrades might cause the program to fail. Delete all previous data and generated configuration files, then restart the container and reconfigure in the WebUI. +由于配置可能各不相同,升级可能会导致程序失败。删除所有之前的数据和生成的配置文件,然后重启容器并在 WebUI 中重新配置。 -## New Features +## 新功能 -### Configuration Method Change +### 配置方式变更 -After v2.6, program configuration has moved from Docker environment variables to `config.json`. -The new WebUI also provides a web-based configuration editor. Access the AB URL and find `Settings` in the sidebar to modify configuration. Restart the container after editing. +v2.6 之后,程序配置已从 Docker 环境变量迁移到 `config.json`。 +新版 WebUI 还提供了基于 Web 的配置编辑器。访问 AB URL 并在侧边栏找到 `设置` 来修改配置。编辑后重启容器。 -### Custom Reverse Proxy URL and AB as Proxy Relay +### 自定义反向代理 URL 和 AB 作为代理中继 -To handle situations where [Mikan Project](https://mikanani.me) is inaccessible, AB provides three approaches: +为了处理 [Mikan Project](https://mikanani.me) 无法访问的情况,AB 提供了三种方法: -1. HTTP and SOCKS Proxy +1. HTTP 和 SOCKS 代理 - This feature existed in older versions. After upgrading to 2.6, just check the proxy configuration in the WebUI to access Mikan Project normally. + 此功能在旧版本中就存在。升级到 2.6 后,只需在 WebUI 中检查代理配置即可正常访问 Mikan Project。 - However, qBittorrent still can't access Mikan's RSS and torrent URLs directly, so you need to add a proxy in qBittorrent as well. See #198 for details. + 但是,qBittorrent 仍然无法直接访问 Mikan 的 RSS 和种子 URL,因此您也需要在 qBittorrent 中添加代理。详见 #198。 -2. Custom Reverse Proxy URL +2. 自定义反向代理 URL - Version 2.6 added a `custom_url` option for custom reverse proxy URLs. - Set it to your properly configured reverse proxy URL. AB will use this custom URL to access Mikan Project, and QB can download normally. + 2.6 版本添加了 `custom_url` 选项用于自定义反向代理 URL。 + 将其设置为您正确配置的反向代理 URL。AB 将使用此自定义 URL 访问 Mikan Project,QB 可以正常下载。 -3. AB as Proxy Relay +3. AB 作为代理中继 - After configuring a proxy in AB, AB can serve as a local proxy relay (currently only for RSS-related functions). - Set `custom_url` to `http://abhost:abport` where `abhost` is AB's IP and `abport` is AB's port. - AB will push its own address to qBittorrent, which will use AB as a proxy to access Mikan Project. + 在 AB 中配置代理后,AB 可以作为本地代理中继(目前仅用于 RSS 相关功能)。 + 将 `custom_url` 设置为 `http://abhost:abport`,其中 `abhost` 是 AB 的 IP,`abport` 是 AB 的端口。 + AB 将把自己的地址推送给 qBittorrent,qBittorrent 将使用 AB 作为代理来访问 Mikan Project。 - Note: If you haven't set up a reverse proxy for AB with Nginx or similar, include `http://` to ensure proper operation. + 注意:如果您没有使用 Nginx 或类似工具为 AB 设置反向代理,请包含 `http://` 以确保正常运行。 -**Important Notes** +**重要说明** -If AB and QB are in the same container, don't use `127.0.0.1` or `localhost` as they can't communicate this way. -If on the same network, use container name addressing, e.g., `http://autobangumi:7892`. +如果 AB 和 QB 在同一个容器中,不要使用 `127.0.0.1` 或 `localhost`,它们无法通过这种方式通信。 +如果在同一网络中,使用容器名称寻址,例如 `http://autobangumi:7892`。 -You can also use the Docker gateway address, e.g., `http://172.17.0.1:7892`. +您也可以使用 Docker 网关地址,例如 `http://172.17.0.1:7892`。 -If on different hosts, use the host machine's IP address. +如果在不同主机上,使用主机的 IP 地址。 -### Collection and Folder Renaming +### 合集和文件夹重命名 -AB can now rename files within collections and folders, moving media files back to the root directory. -Note that AB still relies on the save path to determine season and episode information, so place collection files according to AB's standard. +AB 现在可以重命名合集和文件夹中的文件,将媒体文件移回根目录。 +请注意,AB 仍然依赖保存路径来确定季度和集数信息,因此请按照 AB 的标准放置合集文件。 -After version **2.6.4**, AB can rename subtitles within folders (feature still being refined). Collections and subtitles default to `pn` format renaming; adjustment options are not yet available. +**2.6.4** 版本之后,AB 可以重命名文件夹中的字幕(功能仍在完善中)。合集和字幕默认使用 `pn` 格式重命名;调整选项尚未提供。 -**Standard Path** +**标准路径** ``` /downloads/Bangumi/Title/Season 1/xxx ``` -### Push Notifications +### 推送通知 -AB can now send rename completion notifications via `Telegram` and `ServerChan`. +AB 现在可以通过 `Telegram` 和 `ServerChan` 发送重命名完成通知。 -In the WebUI, enable push notifications and fill in the required parameters. +在 WebUI 中启用推送通知并填写所需参数。 -- Telegram requires Bot Token and Chat ID. Refer to various tutorials for obtaining these. -- ServerChan requires a Token. Refer to various tutorials for obtaining this. +- Telegram 需要 Bot Token 和 Chat ID。获取方法请参考各种教程。 +- ServerChan 需要 Token。获取方法请参考各种教程。 diff --git a/docs/changelog/3.0.md b/docs/changelog/3.0.md index 5a2a0ff9..7fc253dc 100644 --- a/docs/changelog/3.0.md +++ b/docs/changelog/3.0.md @@ -1,46 +1,46 @@ -# [3.0] Release Notes +# [3.0] 发布说明 -### New WebUI +### 新版 WebUI -- Login functionality — AB now supports username/password authentication. Some operations require login. -- New poster wall -- Bangumi management features - - Edit anime season info and names. Changes automatically update **download rules** / **downloaded file paths** and trigger renaming. - - New link parser — after parsing a link, you can manually adjust download info, select download season, or add automatic download rules. - - Delete anime — one-click deletion of anime and its torrent files. - - Custom download rules per anime, independent of global rules. -- New configuration interface for easier application rule configuration -- Added initialization page for first-time startup guidance -- Downloader connection checker for qBittorrent connectivity -- RSS URL validator to check if RSS feeds are valid -- Added program management buttons for starting/stopping the program and restarting the container from the WebUI +- 登录功能 — AB 现在支持用户名/密码认证。部分操作需要登录。 +- 新海报墙 +- 番剧管理功能 + - 编辑动画季度信息和名称。更改会自动更新**下载规则** / **已下载文件路径**并触发重命名。 + - 新链接解析器 — 解析链接后,您可以手动调整下载信息、选择下载季度或添加自动下载规则。 + - 删除动画 — 一键删除动画及其种子文件。 + - 每个动画的自定义下载规则,独立于全局规则。 +- 新配置界面,更易于配置应用程序规则 +- 添加首次启动引导的初始化页面 +- 下载器连接检查器,检查 qBittorrent 连接性 +- RSS URL 验证器,检查 RSS 订阅源是否有效 +- 添加程序管理按钮,可在 WebUI 中启动/停止程序和重启容器 -### Parser +### 解析器 -- New parser with support for different source types to obtain official titles and poster URLs -- Supports changing RSS subscription sources without regenerating the database +- 新解析器,支持不同源类型以获取官方标题和海报 URL +- 支持更换 RSS 订阅源而无需重新生成数据库 -### Notification Module +### 通知模块 -- Added `Bark` notification module -- New notification format — can now push posters, anime names, and updated episode numbers to Telegram +- 添加 `Bark` 通知模块 +- 新通知格式 — 现在可以向 Telegram 推送海报、动画名称和更新的集数编号 -### Data Migration +### 数据迁移 -- Automatic data migration when upgrading from older versions -- Migrated data also automatically matches posters +- 从旧版本升级时自动进行数据迁移 +- 迁移的数据也会自动匹配海报 -## Fixes +## 修复 -- Fixed renaming bugs that could occur with Windows paths +- 修复 Windows 路径可能导致的重命名 bug -## Changes +## 变更 -- Migrated from `json` to `sqlite` for data storage -- Migrated from multiprocessing to multithreading - - Refactored main program - - Improved startup/shutdown time -- Refactored parser module -- Refactored renaming module - - Temporarily removed `normal` mode -- Added `ghcr.io` image registry +- 数据存储从 `json` 迁移到 `sqlite` +- 从多进程迁移到多线程 + - 重构主程序 + - 改进启动/关闭时间 +- 重构解析器模块 +- 重构重命名模块 + - 暂时移除 `normal` 模式 +- 添加 `ghcr.io` 镜像仓库 diff --git a/docs/changelog/3.1.md b/docs/changelog/3.1.md index 87457c14..51cb0b69 100644 --- a/docs/changelog/3.1.md +++ b/docs/changelog/3.1.md @@ -1,47 +1,47 @@ # [3.1] - 2023-08 -- Merged backend and frontend repositories, optimized project directory structure -- Optimized version release workflow -- Wiki migrated to VitePress at: https://autobangumi.org +- 合并后端和前端仓库,优化项目目录结构 +- 优化版本发布工作流程 +- Wiki 迁移到 VitePress:https://autobangumi.org -## Backend +## 后端 -### Features +### 功能 -- Added `RSS Engine` module — AB can now independently update and manage RSS subscriptions and send torrents to the downloader - - Supports multiple aggregated RSS subscription sources, managed via the RSS Engine module - - Download deduplication — duplicate subscribed torrents won't be re-downloaded - - Added manual refresh API for RSS subscriptions - - Added RSS subscription management API -- Added `Search Engine` module — search torrents by keyword and parse results into collection or subscription tasks - - Plugin-based search engine with support for `mikan`, `dmhy`, and `nyaa` -- Added subtitle group-specific rules for individual group configurations -- Added IPv6 listening support (set `IPV6=1` in environment variables) -- Added batch operations API for bulk rule and RSS subscription management +- 添加 `RSS Engine` 模块 — AB 现在可以独立更新和管理 RSS 订阅,并将种子发送到下载器 + - 支持多个聚合 RSS 订阅源,通过 RSS Engine 模块管理 + - 下载去重 — 重复订阅的种子不会重复下载 + - 添加 RSS 订阅手动刷新 API + - 添加 RSS 订阅管理 API +- 添加 `Search Engine` 模块 — 按关键词搜索种子并将结果解析为收集或订阅任务 + - 插件式搜索引擎,支持 `mikan`、`dmhy` 和 `nyaa` +- 添加字幕组特定规则,用于单独配置各字幕组 +- 添加 IPv6 监听支持(在环境变量中设置 `IPV6=1`) +- 添加批量操作 API,用于批量管理规则和 RSS 订阅 -### Changes +### 变更 -- Database structure changed to `sqlmodel` for database management -- Added version management for seamless software data updates -- Unified API format -- Added API response language options -- Added database mock tests -- Code optimizations +- 数据库结构改为使用 `sqlmodel` 进行数据库管理 +- 添加版本管理,实现软件数据无缝更新 +- 统一 API 格式 +- 添加 API 响应语言选项 +- 添加数据库 mock 测试 +- 代码优化 -### Bugfixes +### Bug 修复 -- Fixed various minor issues -- Introduced some major issues +- 修复各种小问题 +- 引入了一些重大问题 -## Frontend +## 前端 -### Features +### 功能 -- Added `i18n` support — currently supports `zh-CN` and `en-US` -- Added PWA support -- Added RSS management page -- Added search top bar +- 添加 `i18n` 支持 — 目前支持 `zh-CN` 和 `en-US` +- 添加 PWA 支持 +- 添加 RSS 管理页面 +- 添加搜索顶栏 -### Changes +### 变更 -- Adjusted various UI details +- 调整各种 UI 细节 diff --git a/docs/changelog/3.2.md b/docs/changelog/3.2.md index d13fd599..6cae6e23 100644 --- a/docs/changelog/3.2.md +++ b/docs/changelog/3.2.md @@ -1,192 +1,192 @@ # [3.2] - 2025-01 -## Backend +## 后端 -### Features +### 功能 -- Added WebAuthn Passkey passwordless login support - - Register, authenticate, and manage Passkey credentials - - Multi-device credential backup detection (iCloud Keychain, etc.) - - Clone attack protection (sign_count verification) - - Authentication strategy pattern unifying password and Passkey login interfaces - - Usernameless login support via discoverable credentials (resident keys) -- Added season/episode offset auto-detection - - Analyzes TMDB episode air dates to detect "virtual seasons" (e.g., Frieren S1 split into two parts) - - Auto-identifies different parts when broadcast gap exceeds 6 months - - Calculates episode offset (e.g., RSS shows S2E1 → TMDB S1E29) - - Background scan thread automatically detects offset issues in existing subscriptions - - New API endpoints: `POST /bangumi/detect-offset`, `PATCH /bangumi/dismiss-review/{id}` -- Added bangumi archive functionality - - Manual archive/unarchive support - - Auto-archive completed series - - New API endpoints: `PATCH /bangumi/archive/{id}`, `PATCH /bangumi/unarchive/{id}`, `GET /bangumi/refresh/metadata` -- Added search provider configuration API - - `GET /search/provider/config` - Get search provider config - - `PUT /search/provider/config` - Update search provider config -- Added RSS connection status tracking - - Records `connection_status` (healthy/error), `last_checked_at`, and `last_error` after each refresh -- Added first-run setup wizard - - 7-step guided configuration: account, downloader, RSS source, media path, notifications - - Downloader connection test, RSS source validation - - Optional steps can be skipped and configured later in settings - - Sentinel file mechanism (`config/.setup_complete`) prevents re-triggering - - Unauthenticated setup API (only available on first run, returns 403 after completion) -- Added calendar view with Bangumi.tv broadcast schedule integration -- Added downloader API and management interface -- Full async migration - - Database layer async support (aiosqlite) for non-blocking I/O in Passkey operations - - `UserDatabase` supports both sync/async modes for backward compatibility - - `Database` context manager supports both `with` (sync) and `async with` (async) - - RSS engine, downloader, checker, and parser fully converted to async - - Network requests migrated from `requests` to `httpx` (AsyncClient) -- Backend migrated to `uv` package manager (pyproject.toml + uv.lock) -- Server startup uses background tasks to avoid blocking (fixes #891, #929) -- Database migration auto-fills NULL values with model defaults -- Database adds `needs_review` and `needs_review_reason` fields for offset detection +- 添加 WebAuthn Passkey 无密码登录支持 + - 注册、认证和管理 Passkey 凭据 + - 多设备凭据备份检测(iCloud 钥匙串等) + - 克隆攻击保护(sign_count 验证) + - 认证策略模式统一密码和 Passkey 登录接口 + - 通过可发现凭据(resident keys)支持无用户名登录 +- 添加季度/集数偏移自动检测 + - 分析 TMDB 剧集播出日期以检测"虚拟季度"(如《葬送的芙莉莲》S1 分成两部分) + - 当播出间隔超过 6 个月时自动识别不同部分 + - 计算集数偏移(如 RSS 显示 S2E1 → TMDB S1E29) + - 后台扫描线程自动检测现有订阅中的偏移问题 + - 新增 API 端点:`POST /bangumi/detect-offset`、`PATCH /bangumi/dismiss-review/{id}` +- 添加番剧归档功能 + - 支持手动归档/取消归档 + - 自动归档已完结系列 + - 新增 API 端点:`PATCH /bangumi/archive/{id}`、`PATCH /bangumi/unarchive/{id}`、`GET /bangumi/refresh/metadata` +- 添加搜索提供者配置 API + - `GET /search/provider/config` - 获取搜索提供者配置 + - `PUT /search/provider/config` - 更新搜索提供者配置 +- 添加 RSS 连接状态跟踪 + - 每次刷新后记录 `connection_status`(healthy/error)、`last_checked_at` 和 `last_error` +- 添加首次运行设置向导 + - 7 步引导配置:账户、下载器、RSS 源、媒体路径、通知 + - 下载器连接测试、RSS 源验证 + - 可选步骤可跳过,稍后在设置中配置 + - 标记文件机制(`config/.setup_complete`)防止重复触发 + - 未认证的设置 API(仅在首次运行时可用,完成后返回 403) +- 添加日历视图,集成 Bangumi.tv 放送时间表 +- 添加下载器 API 和管理界面 +- 全面异步迁移 + - 数据库层异步支持(aiosqlite)用于 Passkey 操作的非阻塞 I/O + - `UserDatabase` 支持同步/异步两种模式以保持向后兼容 + - `Database` 上下文管理器支持 `with`(同步)和 `async with`(异步) + - RSS 引擎、下载器、检查器和解析器全面转换为异步 + - 网络请求从 `requests` 迁移到 `httpx`(AsyncClient) +- 后端迁移到 `uv` 包管理器(pyproject.toml + uv.lock) +- 服务器启动使用后台任务避免阻塞(修复 #891、#929) +- 数据库迁移自动用模型默认值填充 NULL 值 +- 数据库添加 `needs_review` 和 `needs_review_reason` 字段用于偏移检测 -### Performance +### 性能 -- Shared HTTP client connection pool, reuses TCP/SSL connections -- RSS refresh now concurrent (`asyncio.gather`), ~10x faster with multiple sources -- Torrent file download now concurrent, ~5x faster for multiple torrents -- Rename module concurrent file list fetching, ~20x faster -- Notification sending now concurrent, removed 2-second hardcoded delay -- Added TMDB and Mikan parser result caching to avoid duplicate API calls -- Database indexes added for `Torrent.url`, `Torrent.rss_id`, `Bangumi.title_raw`, `Bangumi.deleted`, `RSSItem.url` -- RSS batch enable/disable uses single transaction instead of per-item commits -- Pre-compiled regex patterns for torrent name parsing and filter matching -- `SeasonCollector` created outside loops, reuses single authentication -- RSS parsing deduplication changed from O(n²) list lookup to O(1) set lookup -- `Episode`/`SeasonInfo` dataclasses use `__slots__` for reduced memory footprint +- 共享 HTTP 客户端连接池,复用 TCP/SSL 连接 +- RSS 刷新现在并发执行(`asyncio.gather`),多源时快约 10 倍 +- 种子文件下载现在并发执行,多种子时快约 5 倍 +- 重命名模块并发获取文件列表,快约 20 倍 +- 通知发送现在并发执行,移除 2 秒硬编码延迟 +- 添加 TMDB 和 Mikan 解析器结果缓存,避免重复 API 调用 +- 为 `Torrent.url`、`Torrent.rss_id`、`Bangumi.title_raw`、`Bangumi.deleted`、`RSSItem.url` 添加数据库索引 +- RSS 批量启用/禁用使用单个事务而不是逐项提交 +- 预编译种子名称解析和过滤匹配的正则表达式模式 +- `SeasonCollector` 在循环外创建,复用单次认证 +- RSS 解析去重从 O(n²) 列表查找改为 O(1) 集合查找 +- `Episode`/`SeasonInfo` 数据类使用 `__slots__` 减少内存占用 -### Changes +### 变更 -- Upgraded WebAuthn dependency to py_webauthn 2.7.0 -- `_get_webauthn_from_request` prioritizes browser Origin header, fixing verification issues in cross-port development environments -- `auth_user` and `update_user_info` converted to async functions -- `TitleParser.tmdb_parser` converted to async function -- `RSSEngine` methods fully async (`pull_rss`, `refresh_rss`, `download_bangumi`, `add_rss`) -- `Checker.check_downloader` converted to async function -- `ProgramStatus` migrated from threading to asyncio (Event, Lock) +- 升级 WebAuthn 依赖到 py_webauthn 2.7.0 +- `_get_webauthn_from_request` 优先使用浏览器 Origin 头,修复跨端口开发环境中的验证问题 +- `auth_user` 和 `update_user_info` 转换为异步函数 +- `TitleParser.tmdb_parser` 转换为异步函数 +- `RSSEngine` 方法全面异步化(`pull_rss`、`refresh_rss`、`download_bangumi`、`add_rss`) +- `Checker.check_downloader` 转换为异步函数 +- `ProgramStatus` 从 threading 迁移到 asyncio(Event、Lock) -### Bugfixes +### Bug 修复 -- Fixed downloader connection check with max retry limit -- Fixed transient network errors when adding torrents with retry logic -- Fixed multiple issues in search and subscription flow -- Improved torrent fetch reliability and error handling -- Fixed `aaguid` type error (now `str` in py_webauthn 2.7.0, no longer `bytes`) -- Fixed missing `credential_backup_eligible` field (replaced with `credential_device_type`) -- Fixed `verify_authentication_response` receiving invalid `credential_id` parameter causing TypeError -- Fixed program startup blocking the server (fixes #891, #929, #886, #917, #946) -- Fixed search interface export not matching component expectations -- Fixed poster endpoint path check incorrectly intercepting all requests (fixes #933, #934) -- Fixed OpenAI parser security issue -- Fixed database tests using async sessions with sync code mismatch -- Fixed config field conflicts when upgrading from 3.1.x to 3.2 causing settings loss (fixes #956) - - `program.sleep_time` / `program.times` auto-migrated to `rss_time` / `rename_time` - - Removed deprecated `rss_parser` fields (`type`, `custom_url`, `token`, `enable_tmdb`) - - Fixed `ENV_TO_ATTR` environment variable mapping pointing to non-existent model fields - - Fixed `DEFAULT_SETTINGS` inconsistency with current config model -- Fixed version upgrade migration logic errors (all upgrades calling 3.0→3.1 migration) - - Added version-aware migration dispatch based on source version - - Added `from_31_to_32()` migration function for database schema changes +- 修复下载器连接检查添加最大重试限制 +- 修复添加种子时的瞬时网络错误添加重试逻辑 +- 修复搜索和订阅流程中的多个问题 +- 改进种子获取可靠性和错误处理 +- 修复 `aaguid` 类型错误(py_webauthn 2.7.0 中现在是 `str`,不再是 `bytes`) +- 修复缺失的 `credential_backup_eligible` 字段(替换为 `credential_device_type`) +- 修复 `verify_authentication_response` 接收无效 `credential_id` 参数导致 TypeError +- 修复程序启动阻塞服务器(修复 #891、#929、#886、#917、#946) +- 修复搜索界面导出与组件预期不匹配 +- 修复海报端点路径检查错误拦截所有请求(修复 #933、#934) +- 修复 OpenAI 解析器安全问题 +- 修复数据库测试使用异步会话与同步代码不匹配 +- 修复从 3.1.x 升级到 3.2 时配置字段冲突导致设置丢失(修复 #956) + - `program.sleep_time` / `program.times` 自动迁移到 `rss_time` / `rename_time` + - 移除已弃用的 `rss_parser` 字段(`type`、`custom_url`、`token`、`enable_tmdb`) + - 修复 `ENV_TO_ATTR` 环境变量映射指向不存在的模型字段 + - 修复 `DEFAULT_SETTINGS` 与当前配置模型不一致 +- 修复版本升级迁移逻辑错误(所有升级都调用 3.0→3.1 迁移) + - 添加基于源版本的版本感知迁移调度 + - 添加 `from_31_to_32()` 迁移函数用于数据库 schema 变更 -## Frontend +## 前端 -### Features +### 功能 -- Complete UI design system redesign - - Unified design tokens (colors, fonts, spacing, shadows, animations) - - Light/dark theme toggle support - - Comprehensive accessibility support (ARIA, keyboard navigation, focus management) - - Responsive layout for mobile devices -- Added first-run setup wizard page - - Multi-step wizard component (progress bar + step navigation) - - Route guard auto-detection and redirect to setup page - - Downloader/RSS/notification connection test feedback - - Chinese and English i18n support -- Added Passkey management panel (settings page) - - WebAuthn browser support detection - - Automatic device name identification - - Passkey list display and deletion -- Added Passkey fingerprint login button on login page (supports usernameless login) -- Added calendar view page -- Added downloader management page -- Added Bangumi card hover overlay (showing title and tags) -- Added `resolvePosterUrl` utility function for unified external URL and local path handling (fixes #934) -- Redesigned search panel with modal and filter system -- Redesigned login panel with modern glassmorphism style -- Added log level filter in log view -- Redesigned LLM settings panel (fixes #938) -- Redesigned settings, downloader, player, and log page styles -- Added search provider settings panel - - View, add, edit, delete search sources in UI - - Default sources (mikan, nyaa, dmhy) cannot be deleted - - URL template validation ensures `%s` placeholder -- Added iOS-style notification badge system - - Yellow badge + purple border for subscriptions needing review - - Combined display support (e.g., `! | 2` for warning + multiple rules) - - Yellow glow animation on cards needing attention -- Edit modal warning banner with one-click auto-detect and dismiss -- Rule selection modal highlights rules with warnings -- Calendar page bangumi grouping: same anime with multiple rules merged, click to select specific rule -- Bangumi list page collapsible "Archived" section -- Bangumi list page skeleton loading animation -- Rule editor episode offset field with "Auto Detect" button -- RSS management page connection status labels: green "Connected" when healthy, red "Error" with tooltip for details -- New mobile-first responsive design - - Three-tier breakpoint system: mobile (<640px), tablet (640-1023px), desktop (≥1024px) - - Mobile bottom navigation bar (with icons and text labels) - - Tablet mini sidebar (56px icon navigation) - - Mobile popups automatically switch to bottom sheets - - Pull-to-refresh support - - Horizontal swipe container support - - Mobile card list replacing data tables (RSS page) - - CSS Grid responsive layout (Bangumi card grid) - - Form labels stack vertically on mobile, full-width inputs - - Touch targets minimum 44px, meeting accessibility standards - - Safe area support (notched devices) - - `100dvh` dynamic viewport height (fixes mobile browser address bar issue) - - `viewport-fit=cover` for full-screen devices +- 完整的 UI 设计系统重新设计 + - 统一设计令牌(颜色、字体、间距、阴影、动画) + - 明/暗主题切换支持 + - 全面的无障碍支持(ARIA、键盘导航、焦点管理) + - 移动设备响应式布局 +- 添加首次运行设置向导页面 + - 多步骤向导组件(进度条 + 步骤导航) + - 路由守卫自动检测并重定向到设置页面 + - 下载器/RSS/通知连接测试反馈 + - 中英文 i18n 支持 +- 添加 Passkey 管理面板(设置页面) + - WebAuthn 浏览器支持检测 + - 自动设备名称识别 + - Passkey 列表显示和删除 +- 在登录页面添加 Passkey 指纹登录按钮(支持无用户名登录) +- 添加日历视图页面 +- 添加下载器管理页面 +- 添加番剧卡片悬停覆盖层(显示标题和标签) +- 添加 `resolvePosterUrl` 工具函数统一处理外部 URL 和本地路径(修复 #934) +- 重新设计搜索面板,使用模态框和过滤系统 +- 重新设计登录面板,使用现代毛玻璃风格 +- 在日志视图中添加日志级别过滤 +- 重新设计 LLM 设置面板(修复 #938) +- 重新设计设置、下载器、播放器和日志页面样式 +- 添加搜索提供者设置面板 + - 在 UI 中查看、添加、编辑、删除搜索源 + - 默认源(mikan、nyaa、dmhy)不可删除 + - URL 模板验证确保有 `%s` 占位符 +- 添加 iOS 风格通知徽章系统 + - 黄色徽章 + 紫色边框表示需要审核的订阅 + - 组合显示支持(如 `! | 2` 表示警告 + 多个规则) + - 需要关注的卡片有黄色发光动画 +- 编辑模态框警告横幅,支持一键自动检测和忽略 +- 规则选择模态框高亮显示有警告的规则 +- 日历页面番剧分组:同一动画多个规则合并,点击选择特定规则 +- 番剧列表页面可折叠"已归档"部分 +- 番剧列表页面骨架加载动画 +- 规则编辑器集数偏移字段添加"自动检测"按钮 +- RSS 管理页面连接状态标签:健康时显示绿色"已连接",错误时显示红色"错误"并带工具提示显示详情 +- 全新移动优先响应式设计 + - 三层断点系统:移动端(<640px)、平板(640-1023px)、桌面端(≥1024px) + - 移动端底部导航栏(带图标和文字标签) + - 平板迷你侧边栏(56px 图标导航) + - 移动端弹窗自动切换为底部抽屉 + - 支持下拉刷新 + - 支持水平滑动容器 + - 移动端卡片列表替代数据表格(RSS 页面) + - CSS Grid 响应式布局(番剧卡片网格) + - 移动端表单标签垂直堆叠,输入框全宽 + - 触摸目标最小 44px,符合无障碍标准 + - Safe Area 支持(刘海设备) + - `100dvh` 动态视口高度(修复移动浏览器地址栏问题) + - `viewport-fit=cover` 支持全屏设备 -### New Components +### 新增组件 -- `ab-bottom-sheet` — Touch-driven bottom sheet component (drag to close, max height limit) -- `ab-adaptive-modal` — Adaptive modal (bottom sheet on mobile / centered dialog on desktop) -- `ab-pull-refresh` — Pull-to-refresh wrapper component -- `ab-swipe-container` — Horizontal swipe container (CSS scroll-snap) -- `ab-data-list` — Mobile-friendly card list (replacing NDataTable) -- `ab-mobile-nav` — Enhanced bottom navigation bar (icon + label + active indicator) -- `useSafeArea` — Safe area composable +- `ab-bottom-sheet` — 触摸驱动底部抽屉组件(拖拽关闭、最大高度限制) +- `ab-adaptive-modal` — 自适应模态框(移动端底部抽屉/桌面端居中对话框) +- `ab-pull-refresh` — 下拉刷新包装组件 +- `ab-swipe-container` — 水平滑动容器(CSS scroll-snap) +- `ab-data-list` — 移动端友好卡片列表(替代 NDataTable) +- `ab-mobile-nav` — 增强底部导航栏(图标 + 标签 + 激活指示器) +- `useSafeArea` — Safe Area 组合式函数 -### Performance +### 性能 -- Downloader store uses `shallowRef` instead of `ref` to avoid deep reactive proxy on large arrays -- Table column definitions moved to `computed` to avoid rebuilding on each render -- RSS table columns separated from data, column config not rebuilt on data changes -- Calendar page removed duplicate `getAll()` calls -- `ab-select` `watchEffect` changed to `watch`, eliminates invalid emit on mount -- `useClipboard` hoisted to store top level, avoids creating new instance on each `copy()` -- `setInterval` replaced with `useIntervalFn` for automatic lifecycle management +- 下载器 store 使用 `shallowRef` 代替 `ref`,避免大数组的深度响应式代理 +- 表格列定义移到 `computed`,避免每次渲染时重建 +- RSS 表格列与数据分离,数据变化时不重建列配置 +- 日历页面移除重复的 `getAll()` 调用 +- `ab-select` `watchEffect` 改为 `watch`,消除挂载时的无效 emit +- `useClipboard` 提升到 store 顶层,避免每次 `copy()` 创建新实例 +- `setInterval` 替换为 `useIntervalFn`,自动生命周期管理 -### Changes +### 变更 -- Refactored search logic, removed rxjs dependency -- Search store export refactored to match component expectations -- Upgraded frontend dependencies -- Breakpoint system expanded from single 1024px to 640px + 1024px two-tier -- `useBreakpointQuery` added `isTablet`, `isMobileOrTablet`, `isTabletOrPC` -- `media-query.vue` added `#tablet` slot (falls back to `#mobile`) -- UnoCSS added `sm: 640px` breakpoint -- `ab-input` mobile full-width + increased touch target styling -- Layout uses `dvh` units instead of `vh`, supports safe-area-inset -- Fixed calendar page unknown column width -- Unified action bar button sizes in downloader page +- 重构搜索逻辑,移除 rxjs 依赖 +- 搜索 store 导出重构以匹配组件预期 +- 升级前端依赖 +- 断点系统从单一 1024px 扩展到 640px + 1024px 两层 +- `useBreakpointQuery` 添加 `isTablet`、`isMobileOrTablet`、`isTabletOrPC` +- `media-query.vue` 添加 `#tablet` 插槽(回退到 `#mobile`) +- UnoCSS 添加 `sm: 640px` 断点 +- `ab-input` 移动端全宽 + 增大触摸目标样式 +- 布局使用 `dvh` 单位代替 `vh`,支持 safe-area-inset +- 修复日历页面未知列宽 +- 统一下载器页面操作栏按钮尺寸 -## CI/Infrastructure +## CI/基础设施 -- CI added build test on PR open (dev branch PRs to main auto-trigger build) -- CI upgraded `actions/upload-artifact` and `actions/download-artifact` to v4 -- Docker build removed `linux/arm/v7` platform (uv image doesn't support it) -- Added CLAUDE.md development guide +- CI 添加 PR 打开时的构建测试(dev 分支 PR 到 main 自动触发构建) +- CI 升级 `actions/upload-artifact` 和 `actions/download-artifact` 到 v4 +- Docker 构建移除 `linux/arm/v7` 平台(uv 镜像不支持) +- 添加 CLAUDE.md 开发指南 diff --git a/docs/config/downloader.md b/docs/config/downloader.md index adba5bcc..14a76f92 100644 --- a/docs/config/downloader.md +++ b/docs/config/downloader.md @@ -1,56 +1,56 @@ -# Downloader Settings +# 下载器设置 -## WebUI Configuration +## WebUI 配置 ![downloader](../image/config/downloader.png){width=500}{class=ab-shadow-card}
-- **Downloader Type** is the downloader type. Currently only qBittorrent is supported. -- **Host** is the downloader address. [See below](#downloader-address) -- **Download path** is the mapped download path for the downloader. [See below](#download-path-issues) -- **SSL** enables SSL for the downloader connection. +- **下载器类型** 为下载器类型。目前仅支持 qBittorrent。 +- **地址** 为下载器地址。[详见下方说明](#下载器地址) +- **下载路径** 为下载器的映射下载路径。[详见下方说明](#下载路径问题) +- **SSL** 启用下载器连接的 SSL。 -## Common Issues +## 常见问题 -### Downloader Address +### 下载器地址 -::: warning Note -Do not use 127.0.0.1 or localhost as the downloader address. +::: warning 注意 +请勿使用 127.0.0.1 或 localhost 作为下载器地址。 ::: -Since AB runs in Docker with **Bridge** mode in the official tutorial, using 127.0.0.1 or localhost will resolve to AB itself, not the downloader. -- If your qBittorrent also runs in Docker, we recommend using the Docker **gateway address: 172.17.0.1**. -- If your qBittorrent runs on the host machine, use the host machine's IP address. +由于官方教程中 AB 在 Docker 的 **Bridge** 模式下运行,使用 127.0.0.1 或 localhost 会解析到 AB 自身,而非下载器。 +- 如果 qBittorrent 也在 Docker 中运行,建议使用 Docker **网关地址:172.17.0.1**。 +- 如果 qBittorrent 运行在宿主机上,请使用宿主机的 IP 地址。 -If you run AB in **Host** mode, you can use 127.0.0.1 instead of the Docker gateway address. +如果 AB 以 **Host** 模式运行,则可以使用 127.0.0.1 代替 Docker 网关地址。 -::: warning Note -Macvlan isolates container networks. Without additional bridge configuration, containers cannot access other containers or the host itself. +::: warning 注意 +Macvlan 会隔离容器网络。如果没有额外的网桥配置,容器无法访问其他容器或宿主机本身。 ::: -### Download Path Issues +### 下载路径问题 -The path configured in AB is only used to generate the corresponding anime file path. AB itself does not directly manage files at that path. +AB 中配置的路径仅用于生成对应的番剧文件路径。AB 本身不会直接管理该路径下的文件。 -**What should I put for the download path?** +**下载路径应该填什么?** -This parameter just needs to match your **downloader's** configuration: -- Docker: If qB uses `/downloads`, then set `/downloads/Bangumi`. You can change `Bangumi` to anything. -- Linux/macOS: If it's `/home/usr/downloads` or `/User/UserName/Downloads`, just append `/Bangumi` at the end. -- Windows: Change `D:\Media\` to `D:\Media\Bangumi` +此参数只需与**下载器**的配置匹配: +- Docker:如果 qB 使用 `/downloads`,则设置为 `/downloads/Bangumi`。`Bangumi` 可以改为任意名称。 +- Linux/macOS:如果是 `/home/usr/downloads` 或 `/User/UserName/Downloads`,只需在末尾添加 `/Bangumi`。 +- Windows:将 `D:\Media\` 改为 `D:\Media\Bangumi` -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `downloader` +配置节:`downloader` -| Parameter | Description | Type | WebUI Option | Default | -|-----------|---------------------|---------|----------------------|---------------------| -| type | Downloader type | String | Downloader type | qbittorrent | -| host | Downloader address | String | Downloader address | 172.17.0.1:8080 | -| username | Downloader username | String | Downloader username | admin | -| password | Downloader password | String | Downloader password | adminadmin | -| path | Download path | String | Download path | /downloads/Bangumi | -| ssl | Enable SSL | Boolean | Enable SSL | false | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|----------|--------------|---------|-----------------|---------------------| +| type | 下载器类型 | 字符串 | 下载器类型 | qbittorrent | +| host | 下载器地址 | 字符串 | 下载器地址 | 172.17.0.1:8080 | +| username | 下载器用户名 | 字符串 | 下载器用户名 | admin | +| password | 下载器密码 | 字符串 | 下载器密码 | adminadmin | +| path | 下载路径 | 字符串 | 下载路径 | /downloads/Bangumi | +| ssl | 启用 SSL | 布尔值 | 启用 SSL | false | diff --git a/docs/config/experimental.md b/docs/config/experimental.md index 0d31dda5..91a905f5 100644 --- a/docs/config/experimental.md +++ b/docs/config/experimental.md @@ -1,12 +1,12 @@ -# Experimental Features +# 实验性功能 ::: warning -Experimental features are still in testing. Enabling them may cause unexpected issues and they may be removed in future versions. Use with caution! +实验性功能仍在测试中。启用后可能会导致意外问题,且可能在未来版本中被移除。请谨慎使用! ::: ## OpenAI ChatGPT -Use OpenAI ChatGPT for better structured title parsing. For example: +使用 OpenAI ChatGPT 进行更好的结构化标题解析。例如: ``` input: "【喵萌奶茶屋】★04月新番★[夏日重现/Summer Time Rendering][11][1080p][繁日双语][招募翻译]" @@ -15,43 +15,43 @@ output: '{"group": "喵萌奶茶屋", "title_en": "Summer Time Rendering", "reso ![experimental OpenAI](../image/config/experimental-openai.png){width=500}{class=ab-shadow-card} -- **Enable OpenAI** enables OpenAI and uses ChatGPT for title parsing. -- **OpenAI API Type** defaults to OpenAI. -- **OpenAI API Key** is your OpenAI account API key. -- **OpenAI API Base URL** is the OpenAI endpoint. Defaults to the official OpenAI URL; you can change it to a compatible third-party endpoint. -- **OpenAI Model** is the ChatGPT model parameter. Currently provides `gpt-3.5-turbo`, which is affordable and produces excellent results with the right prompts. +- **启用 OpenAI** 启用 OpenAI 并使用 ChatGPT 进行标题解析。 +- **OpenAI API 类型** 默认为 OpenAI。 +- **OpenAI API Key** 为您的 OpenAI 账户 API 密钥。 +- **OpenAI API Base URL** 为 OpenAI 端点。默认为官方 OpenAI URL;您可以将其更改为兼容的第三方端点。 +- **OpenAI Model** 为 ChatGPT 模型参数。目前提供 `gpt-3.5-turbo`,价格实惠且在正确的提示下效果出色。 ## Microsoft Azure OpenAI ![experimental Microsoft Azure OpenAI](../image/config/experimental-azure-openai.png){width=500}{class=ab-shadow-card} -In addition to standard OpenAI, [version 3.1.8](https://github.com/EstrellaXD/Auto_Bangumi/releases/tag/3.1.8) added Microsoft Azure OpenAI support. Usage is similar to standard OpenAI with some shared parameters, but note the following: +除了标准 OpenAI 外,[版本 3.1.8](https://github.com/EstrellaXD/Auto_Bangumi/releases/tag/3.1.8) 添加了 Microsoft Azure OpenAI 支持。使用方式与标准 OpenAI 类似,共享部分参数,但请注意以下几点: -- **Enable OpenAI** enables OpenAI and uses ChatGPT for title parsing. -- **OpenAI API Type** — Select `azure` to show Azure-specific options. -- **OpenAI API Key** is your Microsoft Azure OpenAI API key. -- **OpenAI API Base URL** corresponds to the Microsoft Azure OpenAI Entrypoint. **Must be filled in manually**. -- **Azure OpenAI Version** is the API version. Defaults to `2023-05-15`. See [supported versions](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions). -- **Azure OpenAI Deployment ID** is your deployment ID, usually the same as the model name. Note that Azure OpenAI doesn't support symbols other than `_-`, so `gpt-3.5-turbo` becomes `gpt-35-turbo` in Azure. **Must be filled in manually**. +- **启用 OpenAI** 启用 OpenAI 并使用 ChatGPT 进行标题解析。 +- **OpenAI API 类型** — 选择 `azure` 以显示 Azure 专用选项。 +- **OpenAI API Key** 为您的 Microsoft Azure OpenAI API 密钥。 +- **OpenAI API Base URL** 对应 Microsoft Azure OpenAI 入口点。**需要手动填写**。 +- **Azure OpenAI 版本** 为 API 版本。默认为 `2023-05-15`。查看[支持的版本](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions)。 +- **Azure OpenAI Deployment ID** 为您的部署 ID,通常与模型名称相同。注意 Azure OpenAI 不支持 `_-` 以外的符号,因此 `gpt-3.5-turbo` 在 Azure 中变为 `gpt-35-turbo`。**需要手动填写**。 -Reference documentation: +参考文档: -- [Quickstart: Get started using GPT-35-Turbo and GPT-4 with Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line&pivots=programming-language-python) -- [Learn how to work with the GPT-35-Turbo and GPT-4 models](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt?pivots=programming-language-chat-completions) +- [快速入门:开始使用 Azure OpenAI 服务的 GPT-35-Turbo 和 GPT-4](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line&pivots=programming-language-python) +- [了解如何使用 GPT-35-Turbo 和 GPT-4 模型](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt?pivots=programming-language-chat-completions) -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `experimental_openai` +配置节:`experimental_openai` -| Parameter | Description | Type | WebUI Option | Default | -|---------------|--------------------------|---------|---------------------------|---------------------------| -| enable | Enable OpenAI parser | Boolean | Enable OpenAI | false | -| api_type | OpenAI API type | String | API type (`openai`/`azure`) | openai | -| api_key | OpenAI API key | String | OpenAI API Key | | -| api_base | API Base URL (Azure entrypoint) | String | OpenAI API Base URL | https://api.openai.com/v1 | -| model | OpenAI model | String | OpenAI Model | gpt-3.5-turbo | -| api_version | Azure OpenAI API version | String | Azure API Version | 2023-05-15 | -| deployment_id | Azure Deployment ID | String | Azure Deployment ID | | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|---------------|----------------------------|---------|----------------------------|---------------------------| +| enable | 启用 OpenAI 解析器 | 布尔值 | 启用 OpenAI | false | +| api_type | OpenAI API 类型 | 字符串 | API 类型 (`openai`/`azure`) | openai | +| api_key | OpenAI API 密钥 | 字符串 | OpenAI API Key | | +| api_base | API Base URL (Azure 入口点) | 字符串 | OpenAI API Base URL | https://api.openai.com/v1 | +| model | OpenAI 模型 | 字符串 | OpenAI Model | gpt-3.5-turbo | +| api_version | Azure OpenAI API 版本 | 字符串 | Azure API 版本 | 2023-05-15 | +| deployment_id | Azure Deployment ID | 字符串 | Azure Deployment ID | | diff --git a/docs/config/manager.md b/docs/config/manager.md index e34ef855..b4cef5ca 100644 --- a/docs/config/manager.md +++ b/docs/config/manager.md @@ -1,35 +1,35 @@ -# Bangumi Manager Settings +# 番剧管理器设置 -## WebUI Configuration +## WebUI 配置 ![proxy](../image/config/manager.png){width=500}{class=ab-shadow-card}
-- **Enable** enables the bangumi manager. If disabled, the settings below will not take effect. -- **Rename method** is the renaming method. Currently supported: - - `pn` — `Torrent Title S0XE0X.mp4` format - - `advance` — `Official Title S0XE0X.mp4` format - - `none` — No renaming -- **Eps complete** enables episode completion for the current season. If enabled, missing episodes will be downloaded. -- **Add group tag** adds subtitle group tags to download rules. -- **Delete bad torrent** deletes errored torrents. -- [About file paths][1] -- [About renaming][2] +- **启用** 启用番剧管理器。如果禁用,下方设置将不会生效。 +- **重命名方式** 为重命名方法。目前支持: + - `pn` — `种子标题 S0XE0X.mp4` 格式 + - `advance` — `官方标题 S0XE0X.mp4` 格式 + - `none` — 不重命名 +- **剧集补全** 启用当季剧集补全。如果启用,将下载缺失的剧集。 +- **添加字幕组标签** 为下载规则添加字幕组标签。 +- **删除错误种子** 删除出错的种子。 +- [关于文件路径][1] +- [关于重命名][2] -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `bangumi_manager` +配置节:`bangumi_manager` -| Parameter | Description | Type | WebUI Option | Default | -|--------------------|------------------------------ |---------|-------------------|---------| -| enable | Enable bangumi manager | Boolean | Enable manager | true | -| eps_complete | Enable episode completion | Boolean | Episode completion | false | -| rename_method | Rename method | String | Rename method | pn | -| group_tag | Add subtitle group tag | Boolean | Group tag | false | -| remove_bad_torrent | Delete bad torrents | Boolean | Remove bad torrent | false | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|--------------------|------------------|---------|-----------------|--------| +| enable | 启用番剧管理器 | 布尔值 | 启用管理器 | true | +| eps_complete | 启用剧集补全 | 布尔值 | 剧集补全 | false | +| rename_method | 重命名方式 | 字符串 | 重命名方式 | pn | +| group_tag | 添加字幕组标签 | 布尔值 | 字幕组标签 | false | +| remove_bad_torrent | 删除错误种子 | 布尔值 | 删除错误种子 | false | [1]: https://www.autobangumi.org/faq/#download-path diff --git a/docs/config/notifier.md b/docs/config/notifier.md index bb4260e0..feb5e138 100644 --- a/docs/config/notifier.md +++ b/docs/config/notifier.md @@ -1,32 +1,32 @@ -# Notification Settings +# 通知设置 -## WebUI Configuration +## WebUI 配置 ![notification](../image/config/notifier.png){width=500}{class=ab-shadow-card}
-- **Enable** enables notifications. If disabled, the settings below will not take effect. -- **Type** is the notification type. Currently supported: +- **启用** 启用通知功能。如果禁用,下方设置将不会生效。 +- **类型** 为通知类型。目前支持: - Telegram - Wecom - Bark - ServerChan -- **Chat ID** only needs to be filled in when using `telegram` notifications. [How to get Telegram Bot Chat ID][1] -- **Wecom**: Fill in the custom push URL in the Chat ID field, and add [Rich Text Message][2] type on the server side. [Wecom Configuration Guide][3] +- **Chat ID** 仅在使用 `telegram` 通知时需要填写。[如何获取 Telegram Bot Chat ID][1] +- **Wecom**:在 Chat ID 字段填写自定义推送 URL,并在服务端添加[富文本消息][2]类型。[Wecom 配置指南][3] -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `notification` +配置节:`notification` -| Parameter | Description | Type | WebUI Option | Default | -|-----------|------------------|---------|-----------------|----------| -| enable | Enable notifications | Boolean | Notifications | false | -| type | Notification type | String | Notification type | telegram | -| token | Notification token | String | Notification token | | -| chat_id | Notification Chat ID | String | Notification Chat ID | | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|---------|---------------|---------|-----------------|----------| +| enable | 启用通知 | 布尔值 | 通知 | false | +| type | 通知类型 | 字符串 | 通知类型 | telegram | +| token | 通知 Token | 字符串 | 通知 Token | | +| chat_id | 通知 Chat ID | 字符串 | 通知 Chat ID | | [1]: https://core.telegram.org/bots#6-botfather diff --git a/docs/config/parser.md b/docs/config/parser.md index 138094be..ca312d32 100644 --- a/docs/config/parser.md +++ b/docs/config/parser.md @@ -1,32 +1,32 @@ -# Parser Settings +# 解析器设置 -AB's parser is used to parse aggregated RSS links. When new entries appear in the RSS feed, AB will parse the titles and generate automatic download rules. +AB 的解析器用于解析聚合 RSS 链接。当 RSS 订阅中出现新条目时,AB 会解析标题并生成自动下载规则。 ::: tip -Since v3.1, parser settings have moved to individual RSS settings. To configure the **parser type**, see [Setting up parser for RSS][add_rss]. +从 v3.1 开始,解析器设置已移至各个 RSS 的单独设置中。要配置**解析器类型**,请参阅 [RSS 解析器设置][add_rss]。 ::: -## Parser Settings in WebUI +## WebUI 中的解析器设置 ![parser](../image/config/parser.png){width=500}{class=ab-shadow-card}
-- **Enable**: Whether to enable the RSS parser. -- **Language** is the RSS parser language. Currently supports `zh`, `jp`, and `en`. -- **Exclude** is the global RSS parser filter. You can enter strings or regular expressions, and AB will filter out matching entries during RSS parsing. +- **启用**:是否启用 RSS 解析器。 +- **语言** 为 RSS 解析器语言。目前支持 `zh`、`jp` 和 `en`。 +- **过滤** 为全局 RSS 解析器过滤规则。可以输入字符串或正则表达式,AB 会在 RSS 解析时过滤掉匹配的条目。 -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `rss_parser` +配置节:`rss_parser` -| Parameter | Description | Type | WebUI Option | Default | -|-----------|-----------------------|---------|---------------------|----------------| -| enable | Enable RSS parser | Boolean | Enable RSS parser | true | -| filter | RSS parser filter | Array | Filter | [720,\d+-\d+] | -| language | RSS parser language | String | RSS parser language | zh | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|----------|------------------|---------|-------------------|----------------| +| enable | 启用 RSS 解析器 | 布尔值 | 启用 RSS 解析器 | true | +| filter | RSS 解析器过滤 | 数组 | 过滤 | [720,\d+-\d+] | +| language | RSS 解析器语言 | 字符串 | RSS 解析器语言 | zh | [rss_token]: rss diff --git a/docs/config/program.md b/docs/config/program.md index 75b30b6a..c4542d9c 100644 --- a/docs/config/program.md +++ b/docs/config/program.md @@ -1,25 +1,25 @@ -# Program Settings +# 程序设置 -## WebUI Configuration +## WebUI 配置 ![program](../image/config/program.png){width=500}{class=ab-shadow-card}
-- Interval Time parameters are in seconds. Convert to seconds if you need to set minutes. -- RSS is the RSS check interval, which affects how often automatic download rules are generated. -- Rename is the rename check interval. Modify this if you need to change how often renaming is checked. -- WebUI Port is the port number. Note that if you're using Docker, you need to remap the port in Docker after changing it. +- 时间间隔参数的单位为秒。如需设置分钟,请换算为秒。 +- RSS 为 RSS 检查间隔,影响自动下载规则的生成频率。 +- 重命名为重命名检查间隔,如需调整重命名检查频率可修改此项。 +- WebUI 端口为端口号。注意:如果使用 Docker,更改端口后需要在 Docker 中重新映射端口。 -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `program` +配置节:`program` -| Parameter | Description | Type | WebUI Option | Default | -|-------------|---------------------|-----------------|---------------------|---------| -| rss_time | RSS check interval | Integer (seconds) | RSS check interval | 7200 | -| rename_time | Rename check interval | Integer (seconds) | Rename check interval | 60 | -| webui_port | WebUI port | Integer | WebUI port | 7892 | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|-------------|----------------|---------------|-------------------|--------| +| rss_time | RSS 检查间隔 | 整数(秒) | RSS 检查间隔 | 7200 | +| rename_time | 重命名检查间隔 | 整数(秒) | 重命名检查间隔 | 60 | +| webui_port | WebUI 端口 | 整数 | WebUI 端口 | 7892 | diff --git a/docs/config/proxy.md b/docs/config/proxy.md index da96aeb8..0793c06d 100644 --- a/docs/config/proxy.md +++ b/docs/config/proxy.md @@ -1,45 +1,45 @@ -# Proxy and Reverse Proxy +# 代理与反向代理 -## Proxy +## 代理 ![proxy](../image/config/proxy.png){width=500}{class=ab-shadow-card}
-AB supports HTTP and SOCKS5 proxies to help resolve network issues. +AB 支持 HTTP 和 SOCKS5 代理,以帮助解决网络问题。 -- **Enable**: Whether to enable the proxy. -- **Type** is the proxy type. -- **Host** is the proxy address. -- **Port** is the proxy port. +- **启用**:是否启用代理。 +- **类型** 为代理类型。 +- **地址** 为代理地址。 +- **端口** 为代理端口。 ::: tip -In **SOCKS5** mode, username and password are required. +在 **SOCKS5** 模式下,需要填写用户名和密码。 ::: -## `config.json` Configuration Options +## `config.json` 配置选项 -The corresponding options in the configuration file are: +配置文件中的对应选项如下: -Configuration section: `proxy` +配置节:`proxy` -| Parameter | Description | Type | WebUI Option | Default | -|-----------|---------------|---------|---------------|---------| -| enable | Enable proxy | Boolean | Proxy | false | -| type | Proxy type | String | Proxy type | http | -| host | Proxy address | String | Proxy address | | -| port | Proxy port | Integer | Proxy port | | -| username | Proxy username | String | Proxy username | | -| password | Proxy password | String | Proxy password | | +| 参数 | 说明 | 类型 | WebUI 选项 | 默认值 | +|----------|------------|---------|--------------|--------| +| enable | 启用代理 | 布尔值 | 代理 | false | +| type | 代理类型 | 字符串 | 代理类型 | http | +| host | 代理地址 | 字符串 | 代理地址 | | +| port | 代理端口 | 整数 | 代理端口 | | +| username | 代理用户名 | 字符串 | 代理用户名 | | +| password | 代理密码 | 字符串 | 代理密码 | | -## Reverse Proxy +## 反向代理 -- Use the Mikan Project alternative domain `mikanime.tv` to replace `mikanani.me` in your RSS subscription URL. -- Use a Cloudflare Worker as a reverse proxy and replace all `mikanani.me` domains in the RSS feed. +- 使用 Mikan Project 备用域名 `mikanime.tv` 替换 RSS 订阅链接中的 `mikanani.me`。 +- 使用 Cloudflare Worker 作为反向代理,替换 RSS 订阅中所有的 `mikanani.me` 域名。 ## Cloudflare Workers -Based on the approach used to bypass blocks on other services, you can set up a reverse proxy using Cloudflare Workers. How to register a domain and bind it to Cloudflare is beyond the scope of this guide. Add the following code in Workers to use your own domain to access Mikan Project and download torrents from RSS links: +参考绕过其他服务封锁的方法,您可以使用 Cloudflare Workers 搭建反向代理。如何注册域名并绑定到 Cloudflare 不在本指南范围内。在 Workers 中添加以下代码,即可使用自己的域名访问 Mikan Project 并从 RSS 链接下载种子: ```js const TELEGRAPH_URL = 'https://mikanani.me'; diff --git a/docs/config/rss.md b/docs/config/rss.md index 9e7c3ff2..d446b490 100644 --- a/docs/config/rss.md +++ b/docs/config/rss.md @@ -1,37 +1,37 @@ -# RSS Feed Setup +# RSS 订阅设置 -AutoBangumi can automatically parse aggregated anime RSS feeds and generate download rules based on subtitle groups and anime names, enabling fully automatic anime tracking. -The following uses [Mikan Project][mikan-site] as an example to explain how to get an RSS subscription URL. +AutoBangumi 可以自动解析聚合 RSS 订阅源,并根据字幕组和番剧名称生成下载规则,实现全自动追番。 +以下以 [Mikan Project][mikan-site] 为例,说明如何获取 RSS 订阅链接。 -Note that the main Mikan Project site may be blocked in some regions. If you cannot access it without a proxy, use the following alternative domain: +请注意,Mikan Project 主站在部分地区可能被屏蔽。如果无法直接访问,请使用以下备用域名: -[Mikan Project (Alternative)][mikan-cn-site] +[Mikan Project (备用)][mikan-cn-site] -## Get Subscription URL +## 获取订阅链接 -This project is based on parsing RSS URLs provided by Mikan Project. To enable automatic anime tracking, you need to register and obtain a Mikan Project RSS URL: +本项目基于 Mikan Project 提供的 RSS 链接进行解析。要启用自动追番功能,您需要注册并获取 Mikan Project 的 RSS 链接: ![image](../image/rss/rss-token.png){data-zoomable} -The RSS URL will look like: +RSS 链接格式如下: ```txt https://mikanani.me/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -# or +# 或 https://mikanime.tv/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` -## Mikan Project Subscription Tips +## Mikan Project 订阅注意事项 -Since AutoBangumi parses all RSS entries it receives, keep the following in mind when subscribing: +由于 AutoBangumi 会解析接收到的所有 RSS 条目,订阅时请注意以下几点: ![image](../image/rss/advanced-subscription.png){data-zoomable} -- Enable advanced settings in your profile settings. -- Subscribe to only one subtitle group per anime. Click the anime poster on Mikan Project to open the submenu and select a single subtitle group. -- If a subtitle group offers both Simplified and Traditional Chinese subtitles, Mikan Project usually provides a way to choose. Select one subtitle type. -- If no subtitle type selection is available, you can set up a `filter` in AutoBangumi to filter them, or manually filter in qBittorrent after the rule is generated. -- OVA and movie subscriptions are currently not supported for parsing. +- 在个人设置中启用高级选项。 +- 每部番剧只订阅一个字幕组。点击 Mikan Project 上的番剧海报打开子菜单,选择单个字幕组。 +- 如果字幕组同时提供简体和繁体中文字幕,Mikan Project 通常会提供选择方式,请选择其中一种。 +- 如果没有字幕类型选择选项,可以在 AutoBangumi 中设置 `filter` 进行过滤,或在规则生成后在 qBittorrent 中手动过滤。 +- 目前不支持解析 OVA 和剧场版订阅。 [mikan-site]: https://mikanani.me/ diff --git a/docs/deploy/docker-cli.md b/docs/deploy/docker-cli.md index 1f8af6d8..a14d283a 100644 --- a/docs/deploy/docker-cli.md +++ b/docs/deploy/docker-cli.md @@ -1,31 +1,31 @@ -# Deploy with Docker CLI +# 使用 Docker CLI 部署 -## Note on New Versions +## 新版本说明 -Since AutoBangumi 2.6, you can configure everything directly in the WebUI. You can start the container first and then configure it in the WebUI. Environment variable configuration from older versions will be automatically migrated. Environment variables still work but only take effect on the first startup. +从 AutoBangumi 2.6 开始,您可以直接在 WebUI 中配置所有设置。您可以先启动容器,然后在 WebUI 中进行配置。旧版本的环境变量配置将自动迁移。环境变量仍然有效,但仅在首次启动时生效。 -## Create Data and Configuration Directories +## 创建数据和配置目录 -To ensure AB's data and configuration persist across updates, we recommend using Docker volumes or bind mounts. +为确保 AB 的数据和配置在更新时持久化,我们建议使用 Docker 卷或绑定挂载。 ```shell -# Using bind mount +# 使用绑定挂载 mkdir -p ${HOME}/AutoBangumi/{config,data} cd ${HOME}/AutoBangumi ``` -Choose either bind mount or Docker volume: +选择绑定挂载或 Docker 卷: ```shell -# Using Docker volume +# 使用 Docker 卷 docker volume create AutoBangumi_config docker volume create AutoBangumi_data ``` -## Deploy AutoBangumi with Docker CLI +## 使用 Docker CLI 部署 AutoBangumi -Copy and run the following command. +复制并运行以下命令。 -Make sure your working directory is AutoBangumi. +请确保您的工作目录为 AutoBangumi。 ```shell docker run -d \ @@ -43,14 +43,14 @@ docker run -d \ ghcr.io/estrellaxd/auto_bangumi:latest ``` -If using Docker volumes, replace the bind paths accordingly: +如果使用 Docker 卷,请相应替换绑定路径: ```shell -v AutoBangumi_config:/app/config \ -v AutoBangumi_data:/app/data \ ``` -The AB WebUI will start automatically, but the main program will be paused. Access `http://abhost:7892` to configure it. +AB WebUI 将自动启动,但主程序处于暂停状态。访问 `http://abhost:7892` 进行配置。 -AB will automatically write environment variables to `config.json` and start running. +AB 会自动将环境变量写入 `config.json` 并开始运行。 -We recommend using _[Portainer](https://www.portainer.io)_ or similar Docker management UIs for advanced deployment. +我们建议使用 _[Portainer](https://www.portainer.io)_ 或类似的 Docker 管理界面进行高级部署。 diff --git a/docs/deploy/docker-compose.md b/docs/deploy/docker-compose.md index bf441e98..9371ca1a 100644 --- a/docs/deploy/docker-compose.md +++ b/docs/deploy/docker-compose.md @@ -1,32 +1,32 @@ -# Deploy with Docker Compose +# 使用 Docker Compose 部署 -A one-click deployment method for **AutoBangumi** using a `docker-compose.yml` file. +使用 `docker-compose.yml` 文件一键部署 **AutoBangumi**。 -## Install Docker Compose +## 安装 Docker Compose -Docker Compose usually comes bundled with Docker. Check with: +Docker Compose 通常与 Docker 捆绑安装。使用以下命令检查: ```bash docker compose -v ``` -If not installed, install it with: +如果未安装,请使用以下命令安装: ```bash $ sudo apt-get update $ sudo apt-get install docker-compose-plugin ``` -## Deploy **AutoBangumi** +## 部署 **AutoBangumi** -### Create AutoBangumi and Data Directories +### 创建 AutoBangumi 和数据目录 ```bash mkdir -p ${HOME}/AutoBangumi/{config,data} cd ${HOME}/AutoBangumi ``` -### Option 1: Custom Docker Compose Configuration +### 方式一:自定义 Docker Compose 配置 ```yaml version: "3.8" @@ -51,35 +51,35 @@ services: - UMASK=022 ``` -Copy the above content into a `docker-compose.yml` file. +将以上内容复制到 `docker-compose.yml` 文件中。 -### Option 2: Download Docker Compose Configuration File +### 方式二:下载 Docker Compose 配置文件 -If you don't want to create the `docker-compose.yml` file manually, the project provides pre-made configurations: +如果您不想手动创建 `docker-compose.yml` 文件,项目提供了预制的配置: -- Install **AutoBangumi** only: +- 仅安装 **AutoBangumi**: ```bash wget https://raw.githubusercontent.com/EstrellaXD/Auto_Bangumi/main/docs/resource/docker-compose/AutoBangumi/docker-compose.yml ``` -- Install **qBittorrent** and **AutoBangumi**: +- 安装 **qBittorrent** 和 **AutoBangumi**: ```bash wget https://raw.githubusercontent.com/EstrellaXD/Auto_Bangumi/main/docs/resource/docker-compose/qBittorrent+AutoBangumi/docker-compose.yml ``` -Choose your installation method and run the command to download the `docker-compose.yml` file. You can customize parameters with a text editor if needed. +选择您的安装方式并运行命令下载 `docker-compose.yml` 文件。如有需要,可以使用文本编辑器自定义参数。 -### Define Environment Variables +### 定义环境变量 -If you're using the downloaded AB+QB Docker Compose file, you need to define the following environment variables: +如果您使用的是下载的 AB+QB Docker Compose 文件,需要定义以下环境变量: ```shell export \ QB_PORT= ``` -- `QB_PORT`: Enter your existing qBittorrent port or your desired custom port, e.g., `8080` +- `QB_PORT`:输入您现有的 qBittorrent 端口或您想要的自定义端口,例如 `8080` -### Start Docker Compose +### 启动 Docker Compose ```bash docker compose up -d diff --git a/docs/deploy/dsm.md b/docs/deploy/dsm.md index 09c58b21..af906257 100644 --- a/docs/deploy/dsm.md +++ b/docs/deploy/dsm.md @@ -1,24 +1,24 @@ -# Synology NAS (DSM 7.2) Deployment (QNAP Similar) +# 群晖 NAS(DSM 7.2)部署(威联通类似) -DSM 7.2 supports Docker Compose, so we recommend using Docker Compose for one-click deployment. +DSM 7.2 支持 Docker Compose,因此我们建议使用 Docker Compose 进行一键部署。 -## Create Configuration and Data Directories +## 创建配置和数据目录 -Create an `AutoBangumi` folder under `/volume1/docker/`, then create `config` and `data` subfolders inside it. +在 `/volume1/docker/` 下创建 `AutoBangumi` 文件夹,然后在其中创建 `config` 和 `data` 子文件夹。 -## Install Container Manager (Docker) Package +## 安装 Container Manager(Docker)套件 -Open Package Center and install the Container Manager (Docker) package. +打开套件中心,安装 Container Manager(Docker)套件。 ![install-docker](../image/dsm/install-docker.png){data-zoomable} -## Install AB via Docker Compose +## 通过 Docker Compose 安装 AB -Click **Project**, then click **Create**, and select **Docker Compose**. +点击**项目**,然后点击**新增**,选择 **Docker Compose**。 ![new-compose](../image/dsm/new-compose.png){data-zoomable} -Copy and paste the following content into **Docker Compose**: +将以下内容复制粘贴到 **Docker Compose** 中: ```yaml version: "3.4" @@ -41,19 +41,19 @@ services: - UMASK=022 ``` -Click **Next**, then click **Done**. +点击**下一步**,然后点击**完成**。 ![create](../image/dsm/create.png){data-zoomable} -After creation, access `http://:7892` to enter AB and configure it. +创建完成后,访问 `http://:7892` 进入 AB 并进行配置。 -## Install AB and qBittorrent via Docker Compose +## 通过 Docker Compose 安装 AB 和 qBittorrent -When you have both a proxy and IPv6, configuring IPv6 in Docker on Synology NAS can be complex. We recommend installing both AB and qBittorrent on the host network to reduce complexity. +当您同时拥有代理和 IPv6 时,在群晖 NAS 的 Docker 中配置 IPv6 可能比较复杂。我们建议将 AB 和 qBittorrent 都安装在主机网络上以降低复杂性。 -The following configuration assumes you have a Clash proxy deployed in Docker that is accessible via a local IP at a specified port. +以下配置假设您已在 Docker 中部署了 Clash 代理,可通过本地 IP 的指定端口访问。 -Following the previous section, adjust and paste the following content into **Docker Compose**: +按照上一节的方法,调整并将以下内容粘贴到 **Docker Compose** 中: ```yaml qbittorrent: @@ -61,13 +61,13 @@ Following the previous section, adjust and paste the following content into **Do image: linuxserver/qbittorrent hostname: qbittorrent environment: - - PGID=1000 # Modify as needed - - PUID=1000 # Modify as needed + - PGID=1000 # 根据需要修改 + - PUID=1000 # 根据需要修改 - WEBUI_PORT=8989 - TZ=Asia/Shanghai volumes: - ./qb_config:/config - - your_anime_path:/downloads # Change this to your anime storage directory. Set download path in AB as /downloads + - your_anime_path:/downloads # 修改为您的番剧存储目录。在 AB 中将下载路径设置为 /downloads networks: - host restart: unless-stopped @@ -76,10 +76,10 @@ Following the previous section, adjust and paste the following content into **Do container_name: AutoBangumi environment: - TZ=Asia/Shanghai - - PGID=1000 # Modify as needed - - PUID=1000 # Modify as needed + - PGID=1000 # 根据需要修改 + - PUID=1000 # 根据需要修改 - UMASK=022 - - AB_DOWNLOADER_HOST=127.0.0.1:8989 # Modify port as needed + - AB_DOWNLOADER_HOST=127.0.0.1:8989 # 根据需要修改端口 volumes: - /volume1/docker/ab/config:/app/config - /volume1/docker/ab/data:/app/data @@ -95,27 +95,27 @@ Following the previous section, adjust and paste the following content into **Do ``` -## Additional Notes +## 附加说明 -The PGID and PUID values need to be determined for your system. For newer Synology NAS devices, they are typically: `PUID=1026, PGID=100`. When modifying the qBittorrent port, make sure to update it in all locations. +PGID 和 PUID 的值需要根据您的系统确定。对于较新的群晖 NAS 设备,通常为:`PUID=1026, PGID=100`。修改 qBittorrent 端口时,请确保在所有位置都进行更新。 -For proxy setup, refer to: [Proxy Settings](../config/proxy) +代理设置请参阅:[代理设置](../config/proxy) -On lower-performance machines, the default configuration may heavily use the CPU, causing AB to fail connecting to qB and the qB WebUI to become inaccessible. +在性能较低的设备上,默认配置可能会大量占用 CPU,导致 AB 无法连接到 qB,qB WebUI 也无法访问。 -For devices like the 220+, recommended qBittorrent settings to reduce CPU usage: +对于 220+ 等设备,建议使用以下 qBittorrent 设置以降低 CPU 使用率: -- Settings -> Connections -> Connection Limits - - Global maximum number of connections: 300 - - Maximum number of connections per torrent: 60 - - Global upload slots limit: 15 - - Upload slots per torrent: 4 +- 设置 -> 连接 -> 连接限制 + - 全局最大连接数:300 + - 每个种子最大连接数:60 + - 全局上传槽位限制:15 + - 每个种子上传槽位:4 - BitTorrent - - Maximum active checking torrents: 1 - - Torrent Queueing - - Maximum active downloads: 3 - - Maximum active uploads: 5 - - Maximum active torrents: 10 + - 最大活动检查种子数:1 + - 种子队列 + - 最大活动下载数:3 + - 最大活动上传数:5 + - 最大活动种子数:10 - RSS - - RSS Reader - - Maximum number of articles per feed: 50 + - RSS 阅读器 + - 每个订阅源最大文章数:50 diff --git a/docs/deploy/local.md b/docs/deploy/local.md index 36ed4371..aa05bef7 100644 --- a/docs/deploy/local.md +++ b/docs/deploy/local.md @@ -1,21 +1,21 @@ -# Local Deployment +# 本地部署 ::: warning -Local deployment may cause unexpected issues. We strongly recommend using Docker instead. +本地部署可能会导致意外问题。我们强烈建议使用 Docker 代替。 -This documentation may have update delays. If you have questions, please raise them in [Issues](https://github.com/EstrellaXD/Auto_Bangumi/issues). +此文档可能存在更新延迟。如有问题,请在 [Issues](https://github.com/EstrellaXD/Auto_Bangumi/issues) 中提出。 ::: -## Download the Latest Release +## 下载最新版本 ```bash VERSION=$(curl -s "https://api.github.com/repos/EstrellaXD/Auto_Bangumi/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') curl -L -O "https://github.com/EstrellaXD/Auto_Bangumi/releases/download/$VERSION/app-v$VERSION.zip" ``` -## Extract the Archive +## 解压压缩包 -On Unix/WSL systems, use the following command. On Windows, extract manually. +在 Unix/WSL 系统上,使用以下命令。在 Windows 上,请手动解压。 ```bash unzip app-v$VERSION.zip -d AutoBangumi @@ -23,9 +23,9 @@ cd AutoBangumi ``` -## Create Virtual Environment and Install Dependencies +## 创建虚拟环境并安装依赖 -Ensure you have Python 3.10+ and pip installed locally. +确保本地已安装 Python 3.10+ 和 pip。 ```bash cd src @@ -33,23 +33,23 @@ python3 -m venv env python3 pip install -r requirements.txt ``` -## Create Configuration and Data Directories +## 创建配置和数据目录 ```bash mkdir config mkdir data ``` -## Run AutoBangumi +## 运行 AutoBangumi ```bash python3 main.py ``` -## Windows Auto-Start on Boot +## Windows 开机自启 -You can use `nssm` for auto-start on boot. Example with `nssm`: +可以使用 `nssm` 实现开机自启。使用 `nssm` 的示例: ```powershell nssm install AutoBangumi (Get-Command python).Source diff --git a/docs/deploy/quick-start.md b/docs/deploy/quick-start.md index 7fc67d1c..7aa1aaf8 100644 --- a/docs/deploy/quick-start.md +++ b/docs/deploy/quick-start.md @@ -1,33 +1,33 @@ -# Quick Start +# 快速开始 -We recommend deploying AutoBangumi in Docker. -Before deployment, make sure you have [Docker Engine][docker-engine] or [Docker Desktop][docker-desktop] installed. +我们推荐使用 Docker 部署 AutoBangumi。 +部署前,请确保已安装 [Docker Engine][docker-engine] 或 [Docker Desktop][docker-desktop]。 -## Create Data and Configuration Directories +## 创建数据和配置目录 -To ensure AB's data and configuration persist across updates, we recommend using bind mounts or Docker volumes. +为确保 AB 的数据和配置在更新时持久化,我们建议使用绑定挂载或 Docker 卷。 ```shell -# Using bind mount +# 使用绑定挂载 mkdir -p ${HOME}/AutoBangumi/{config,data} cd ${HOME}/AutoBangumi ``` -Choose either bind mount or Docker volume: +选择绑定挂载或 Docker 卷: ```shell -# Using Docker volume +# 使用 Docker 卷 docker volume create AutoBangumi_config docker volume create AutoBangumi_data ``` -## Deploy AutoBangumi with Docker +## 使用 Docker 部署 AutoBangumi -Make sure you are in the AutoBangumi directory when running these commands. +运行这些命令时,请确保您在 AutoBangumi 目录中。 -### Option 1: Deploy with Docker CLI +### 方式一:使用 Docker CLI 部署 -Copy and run the following command: +复制并运行以下命令: ```shell docker run -d \ @@ -45,9 +45,9 @@ docker run -d \ ghcr.io/estrellaxd/auto_bangumi:latest ``` -### Option 2: Deploy with Docker Compose +### 方式二:使用 Docker Compose 部署 -Copy the following content into a `docker-compose.yml` file: +将以下内容复制到 `docker-compose.yml` 文件中: ```yaml version: "3.8" @@ -72,53 +72,53 @@ services: - UMASK=022 ``` -Run the following command to start the container: +运行以下命令启动容器: ```shell docker compose up -d ``` -## Install qBittorrent +## 安装 qBittorrent -If you haven't installed qBittorrent, please install it first: +如果您尚未安装 qBittorrent,请先安装: -- [Install qBittorrent in Docker][qbittorrent-docker] -- [Install qBittorrent on Windows/macOS][qbittorrent-desktop] -- [Install qBittorrent-nox on Linux][qbittorrent-nox] +- [在 Docker 中安装 qBittorrent][qbittorrent-docker] +- [在 Windows/macOS 上安装 qBittorrent][qbittorrent-desktop] +- [在 Linux 上安装 qBittorrent-nox][qbittorrent-nox] -## Get an Aggregated RSS Link (Using Mikan Project as an Example) +## 获取聚合 RSS 链接(以 Mikan Project 为例) -Visit [Mikan Project][mikan-project], register an account and log in, then click the **RSS** button in the bottom right corner and copy the link. +访问 [Mikan Project][mikan-project],注册账号并登录,然后点击右下角的 **RSS** 按钮并复制链接。 ![mikan-rss](../image/rss/rss-token.png){data-zoomable} -The RSS URL will look like: +RSS 链接格式如下: ```txt https://mikanani.me/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -# or +# 或 https://mikanime.tv/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` -For detailed steps, see [Mikan RSS Setup][config-rss]. +详细步骤请参阅 [Mikan RSS 设置][config-rss]。 -## Configure AutoBangumi +## 配置 AutoBangumi -After installing AB, the WebUI will start automatically, but the main program will be paused. You can access `http://abhost:7892` to configure it. +安装 AB 后,WebUI 将自动启动,但主程序处于暂停状态。您可以访问 `http://abhost:7892` 进行配置。 -1. Open the webpage. The default username is `admin` and the default password is `adminadmin`. Change these immediately after first login. -2. Enter your downloader's address, port, username, and password. +1. 打开网页。默认用户名为 `admin`,默认密码为 `adminadmin`。首次登录后请立即修改。 +2. 输入下载器的地址、端口、用户名和密码。 ![ab-webui](../image/config/downloader.png){width=500}{class=ab-shadow-card} -3. Click **Apply** to save the configuration. AB will restart, and when the dot in the upper right corner turns green, it indicates AB is running normally. +3. 点击**应用**保存配置。AB 将重启,当右上角的圆点变为绿色时,表示 AB 正常运行。 -4. Click the **+** button in the upper right corner, check **Aggregated RSS**, select the parser type, and enter your Mikan RSS URL. +4. 点击右上角的 **+** 按钮,勾选**聚合 RSS**,选择解析器类型,然后输入您的 Mikan RSS 链接。 ![ab-rss](../image/config/add-rss.png){width=500}{class=ab-shadow-card} -Wait for AB to parse the aggregated RSS. Once parsing is complete, it will automatically add anime and manage downloads. +等待 AB 解析聚合 RSS。解析完成后,将自动添加番剧并管理下载。 diff --git a/docs/dev/database.md b/docs/dev/database.md index 5720218f..359879f0 100644 --- a/docs/dev/database.md +++ b/docs/dev/database.md @@ -1,219 +1,219 @@ -# Database Developer Guide +# 数据库开发指南 -This guide covers the database architecture, models, and operations in AutoBangumi. +本指南介绍 AutoBangumi 中的数据库架构、模型和操作。 -## Overview +## 概述 -AutoBangumi uses **SQLite** as its database with **SQLModel** (Pydantic + SQLAlchemy hybrid) for ORM. The database file is located at `data/data.db`. +AutoBangumi 使用 **SQLite** 作为数据库,使用 **SQLModel**(Pydantic + SQLAlchemy 混合)作为 ORM。数据库文件位于 `data/data.db`。 -### Architecture +### 架构 ``` module/database/ -├── engine.py # SQLAlchemy engine configuration -├── combine.py # Database class, migrations, session management -├── bangumi.py # Bangumi (anime subscription) operations -├── rss.py # RSS feed operations -├── torrent.py # Torrent tracking operations -└── user.py # User authentication operations +├── engine.py # SQLAlchemy 引擎配置 +├── combine.py # Database 类、迁移、会话管理 +├── bangumi.py # 番剧(动画订阅)操作 +├── rss.py # RSS 订阅源操作 +├── torrent.py # 种子跟踪操作 +└── user.py # 用户认证操作 ``` -## Core Components +## 核心组件 -### Database Class +### Database 类 -The `Database` class in `combine.py` is the main entry point. It inherits from SQLModel's `Session` and provides access to all sub-databases: +`combine.py` 中的 `Database` 类是主入口点。它继承自 SQLModel 的 `Session`,并提供对所有子数据库的访问: ```python from module.database import Database with Database() as db: - # Access sub-databases + # 访问子数据库 bangumis = db.bangumi.search_all() rss_items = db.rss.search_active() torrents = db.torrent.search_all() ``` -### Sub-Database Classes +### 子数据库类 -| Class | Model | Purpose | +| 类 | 模型 | 用途 | |-------|-------|---------| -| `BangumiDatabase` | `Bangumi` | Anime subscription rules | -| `RSSDatabase` | `RSSItem` | RSS feed sources | -| `TorrentDatabase` | `Torrent` | Downloaded torrent tracking | -| `UserDatabase` | `User` | Authentication | +| `BangumiDatabase` | `Bangumi` | 动画订阅规则 | +| `RSSDatabase` | `RSSItem` | RSS 订阅源 | +| `TorrentDatabase` | `Torrent` | 已下载种子跟踪 | +| `UserDatabase` | `User` | 认证 | -## Models +## 模型 -### Bangumi Model +### Bangumi 模型 -Core model for anime subscriptions: +动画订阅的核心模型: ```python class Bangumi(SQLModel, table=True): - id: int # Primary key - official_title: str # Display name (e.g., "Mushoku Tensei") - title_raw: str # Raw title for torrent matching (indexed) - season: int = 1 # Season number - episode_offset: int = 0 # Episode numbering adjustment - season_offset: int = 0 # Season numbering adjustment - rss_link: str # Comma-separated RSS feed URLs - filter: str # Exclusion filter (e.g., "720,\\d+-\\d+") - poster_link: str # TMDB poster URL - save_path: str # Download destination path - rule_name: str # qBittorrent RSS rule name - added: bool = False # Whether rule is added to downloader - deleted: bool = False # Soft delete flag (indexed) - archived: bool = False # For completed series (indexed) - needs_review: bool = False # Offset mismatch detected - needs_review_reason: str # Reason for review - suggested_season_offset: int # Suggested season offset - suggested_episode_offset: int # Suggested episode offset - air_weekday: int # Airing day (0=Sunday, 6=Saturday) + id: int # 主键 + official_title: str # 显示名称(如"无职转生") + title_raw: str # 用于种子匹配的原始标题(有索引) + season: int = 1 # 季度编号 + episode_offset: int = 0 # 集数编号调整 + season_offset: int = 0 # 季度编号调整 + rss_link: str # 逗号分隔的 RSS 订阅源 URL + filter: str # 排除过滤器(如 "720,\\d+-\\d+") + poster_link: str # TMDB 海报 URL + save_path: str # 下载目标路径 + rule_name: str # qBittorrent RSS 规则名称 + added: bool = False # 规则是否已添加到下载器 + deleted: bool = False # 软删除标志(有索引) + archived: bool = False # 用于已完结系列(有索引) + needs_review: bool = False # 检测到偏移不匹配 + needs_review_reason: str # 需要审核的原因 + suggested_season_offset: int # 建议的季度偏移 + suggested_episode_offset: int # 建议的集数偏移 + air_weekday: int # 放送日(0=周日,6=周六) ``` -### RSSItem Model +### RSSItem 模型 -RSS feed subscriptions: +RSS 订阅源: ```python class RSSItem(SQLModel, table=True): - id: int # Primary key - name: str # Display name - url: str # Feed URL (unique, indexed) - aggregate: bool = True # Whether to parse torrents - parser: str = "mikan" # Parser type: mikan, dmhy, nyaa - enabled: bool = True # Active flag - connection_status: str # "healthy" or "error" - last_checked_at: str # ISO timestamp - last_error: str # Last error message + id: int # 主键 + name: str # 显示名称 + url: str # 订阅源 URL(唯一,有索引) + aggregate: bool = True # 是否解析种子 + parser: str = "mikan" # 解析器类型:mikan、dmhy、nyaa + enabled: bool = True # 启用标志 + connection_status: str # "healthy" 或 "error" + last_checked_at: str # ISO 时间戳 + last_error: str # 最后一次错误消息 ``` -### Torrent Model +### Torrent 模型 -Tracks downloaded torrents: +跟踪已下载的种子: ```python class Torrent(SQLModel, table=True): - id: int # Primary key - name: str # Torrent name (indexed) - url: str # Torrent/magnet URL (unique, indexed) - rss_id: int # Source RSS feed ID - bangumi_id: int # Linked Bangumi ID (nullable) - qb_hash: str # qBittorrent info hash (indexed) - downloaded: bool = False # Download completed + id: int # 主键 + name: str # 种子名称(有索引) + url: str # 种子/磁力链接 URL(唯一,有索引) + rss_id: int # 来源 RSS 订阅源 ID + bangumi_id: int # 关联的番剧 ID(可为空) + qb_hash: str # qBittorrent 信息哈希(有索引) + downloaded: bool = False # 下载完成 ``` -## Common Operations +## 常用操作 ### BangumiDatabase ```python with Database() as db: - # Create - db.bangumi.add(bangumi) # Single insert - db.bangumi.add_all(bangumi_list) # Batch insert (deduplicates) + # 创建 + db.bangumi.add(bangumi) # 单条插入 + db.bangumi.add_all(bangumi_list) # 批量插入(去重) - # Read - db.bangumi.search_all() # All records (cached, 5min TTL) - db.bangumi.search_id(123) # By ID - db.bangumi.match_torrent("torrent name") # Find by title_raw match - db.bangumi.not_complete() # Incomplete series - db.bangumi.get_needs_review() # Flagged for review + # 读取 + db.bangumi.search_all() # 所有记录(缓存,5分钟 TTL) + db.bangumi.search_id(123) # 按 ID 查询 + db.bangumi.match_torrent("torrent name") # 按 title_raw 匹配查找 + db.bangumi.not_complete() # 未完结系列 + db.bangumi.get_needs_review() # 标记需要审核的 - # Update - db.bangumi.update(bangumi) # Update single record - db.bangumi.update_all(bangumi_list) # Batch update + # 更新 + db.bangumi.update(bangumi) # 更新单条记录 + db.bangumi.update_all(bangumi_list) # 批量更新 - # Delete - db.bangumi.delete_one(123) # Hard delete - db.bangumi.disable_rule(123) # Soft delete (deleted=True) + # 删除 + db.bangumi.delete_one(123) # 硬删除 + db.bangumi.disable_rule(123) # 软删除(deleted=True) ``` ### RSSDatabase ```python with Database() as db: - # Create - db.rss.add(rss_item) # Single insert - db.rss.add_all(rss_items) # Batch insert (deduplicates) + # 创建 + db.rss.add(rss_item) # 单条插入 + db.rss.add_all(rss_items) # 批量插入(去重) - # Read - db.rss.search_all() # All feeds - db.rss.search_active() # Enabled feeds only - db.rss.search_aggregate() # Enabled + aggregate=True + # 读取 + db.rss.search_all() # 所有订阅源 + db.rss.search_active() # 仅启用的订阅源 + db.rss.search_aggregate() # 启用且 aggregate=True - # Update - db.rss.update(id, rss_update) # Partial update - db.rss.enable(id) # Enable feed - db.rss.disable(id) # Disable feed - db.rss.enable_batch([1, 2, 3]) # Batch enable - db.rss.disable_batch([1, 2, 3]) # Batch disable + # 更新 + db.rss.update(id, rss_update) # 部分更新 + db.rss.enable(id) # 启用订阅源 + db.rss.disable(id) # 禁用订阅源 + db.rss.enable_batch([1, 2, 3]) # 批量启用 + db.rss.disable_batch([1, 2, 3]) # 批量禁用 ``` ### TorrentDatabase ```python with Database() as db: - # Create - db.torrent.add(torrent) # Single insert - db.torrent.add_all(torrents) # Batch insert + # 创建 + db.torrent.add(torrent) # 单条插入 + db.torrent.add_all(torrents) # 批量插入 - # Read - db.torrent.search_all() # All torrents - db.torrent.search_by_qb_hash(hash) # By qBittorrent hash - db.torrent.search_by_url(url) # By URL - db.torrent.check_new(torrents) # Filter out existing + # 读取 + db.torrent.search_all() # 所有种子 + db.torrent.search_by_qb_hash(hash) # 按 qBittorrent 哈希查询 + db.torrent.search_by_url(url) # 按 URL 查询 + db.torrent.check_new(torrents) # 过滤掉已存在的 - # Update - db.torrent.update_qb_hash(id, hash) # Set qb_hash + # 更新 + db.torrent.update_qb_hash(id, hash) # 设置 qb_hash ``` -## Caching +## 缓存 -### Bangumi Cache +### 番剧缓存 -`search_all()` results are cached at the module level with a 5-minute TTL: +`search_all()` 的结果在模块级别缓存,TTL 为 5 分钟: ```python -# Module-level cache in bangumi.py +# bangumi.py 中的模块级缓存 _bangumi_cache: list[Bangumi] | None = None _bangumi_cache_time: float = 0 -_BANGUMI_CACHE_TTL: float = 300.0 # 5 minutes +_BANGUMI_CACHE_TTL: float = 300.0 # 5 分钟 -# Cache invalidation +# 缓存失效 def _invalidate_bangumi_cache(): global _bangumi_cache, _bangumi_cache_time _bangumi_cache = None _bangumi_cache_time = 0 ``` -**Important:** The cache is automatically invalidated on: -- `add()`, `add_all()` -- `update()`, `update_all()` -- `delete_one()`, `delete_all()` -- `archive_one()`, `unarchive_one()` -- Any RSS link update operations +**重要:** 缓存在以下操作时自动失效: +- `add()`、`add_all()` +- `update()`、`update_all()` +- `delete_one()`、`delete_all()` +- `archive_one()`、`unarchive_one()` +- 任何 RSS 链接更新操作 -### Session Expunge +### 会话分离 -Cached objects are **expunged** from the session to prevent `DetachedInstanceError`: +缓存的对象会从会话中**分离**,以防止 `DetachedInstanceError`: ```python for b in bangumis: - self.session.expunge(b) # Detach from session + self.session.expunge(b) # 从会话中分离 ``` -## Migration System +## 迁移系统 -### Schema Versioning +### Schema 版本控制 -Migrations are tracked via a `schema_version` table: +迁移通过 `schema_version` 表跟踪: ```python CURRENT_SCHEMA_VERSION = 7 -# Each migration: (version, description, [SQL statements]) +# 每个迁移:(版本号, 描述, [SQL 语句]) MIGRATIONS = [ (1, "add air_weekday column", [...]), (2, "add connection status columns", [...]), @@ -225,14 +225,14 @@ MIGRATIONS = [ ] ``` -### Adding a New Migration +### 添加新迁移 -1. Increment `CURRENT_SCHEMA_VERSION` in `combine.py` -2. Add migration tuple to `MIGRATIONS` list: +1. 在 `combine.py` 中增加 `CURRENT_SCHEMA_VERSION` +2. 在 `MIGRATIONS` 列表中添加迁移元组: ```python MIGRATIONS = [ - # ... existing migrations ... + # ... 现有迁移 ... ( 8, "add my_new_column to bangumi", @@ -243,7 +243,7 @@ MIGRATIONS = [ ] ``` -3. Add idempotency check in `run_migrations()`: +3. 在 `run_migrations()` 中添加幂等性检查: ```python if "bangumi" in tables and version == 8: @@ -252,28 +252,28 @@ if "bangumi" in tables and version == 8: needs_run = False ``` -4. Update the corresponding Pydantic model in `module/models/` +4. 更新 `module/models/` 中对应的 Pydantic 模型 -### Default Value Backfill +### 默认值回填 -After migrations, `_fill_null_with_defaults()` automatically fills NULL values based on model defaults: +迁移后,`_fill_null_with_defaults()` 会根据模型默认值自动填充 NULL 值: ```python -# If model defines: +# 如果模型定义为: class Bangumi(SQLModel, table=True): my_field: bool = False -# Then existing rows with NULL will be updated to False +# 那么现有记录中的 NULL 值将被更新为 False ``` -## Performance Patterns +## 性能模式 -### Batch Queries +### 批量查询 -`add_all()` uses a single query to check for duplicates instead of N queries: +`add_all()` 使用单个查询检查重复项,而不是 N 个查询: ```python -# Efficient: single SELECT +# 高效:单个 SELECT keys_to_check = [(d.title_raw, d.group_name) for d in datas] conditions = [ and_(Bangumi.title_raw == tr, Bangumi.group_name == gn) @@ -282,40 +282,40 @@ conditions = [ statement = select(Bangumi.title_raw, Bangumi.group_name).where(or_(*conditions)) ``` -### Regex Matching +### 正则表达式匹配 -`match_list()` compiles a single regex pattern for all title matches: +`match_list()` 为所有标题匹配编译单个正则表达式模式: ```python -# Compile once, match many +# 编译一次,匹配多次 sorted_titles = sorted(title_index.keys(), key=len, reverse=True) pattern = "|".join(re.escape(title) for title in sorted_titles) title_regex = re.compile(pattern) -# O(1) lookup per torrent instead of O(n) +# 每个种子 O(1) 查找而不是 O(n) for torrent in torrent_list: match = title_regex.search(torrent.name) ``` -### Indexed Columns +### 索引列 -The following columns have indexes for fast lookups: +以下列具有索引以实现快速查找: -| Table | Column | Index Type | +| 表 | 列 | 索引类型 | |-------|--------|------------| -| `bangumi` | `title_raw` | Regular | -| `bangumi` | `deleted` | Regular | -| `bangumi` | `archived` | Regular | -| `rssitem` | `url` | Unique | -| `torrent` | `name` | Regular | -| `torrent` | `url` | Unique | -| `torrent` | `qb_hash` | Regular | +| `bangumi` | `title_raw` | 普通 | +| `bangumi` | `deleted` | 普通 | +| `bangumi` | `archived` | 普通 | +| `rssitem` | `url` | 唯一 | +| `torrent` | `name` | 普通 | +| `torrent` | `url` | 唯一 | +| `torrent` | `qb_hash` | 普通 | -## Testing +## 测试 -### Test Database Setup +### 测试数据库设置 -Tests use an in-memory SQLite database: +测试使用内存中的 SQLite 数据库: ```python # conftest.py @@ -332,56 +332,56 @@ def db_session(db_engine): yield session ``` -### Factory Functions +### 工厂函数 -Use factory functions for creating test data: +使用工厂函数创建测试数据: ```python from test.factories import make_bangumi, make_torrent, make_rss_item def test_bangumi_search(): bangumi = make_bangumi(title_raw="Test Title", season=2) - # ... test logic + # ... 测试逻辑 ``` -## Design Notes +## 设计说明 -### No Foreign Keys +### 无外键 -SQLite foreign key enforcement is disabled by default. Relationships (like `Torrent.bangumi_id`) are managed in application logic rather than database constraints. +SQLite 外键强制默认是禁用的。关系(如 `Torrent.bangumi_id`)在应用程序逻辑中管理,而不是通过数据库约束。 -### Soft Deletes +### 软删除 -The `Bangumi.deleted` flag enables soft deletes. Queries should filter by `deleted=False` for user-facing data: +`Bangumi.deleted` 标志启用软删除。面向用户的数据查询应按 `deleted=False` 过滤: ```python statement = select(Bangumi).where(Bangumi.deleted == false()) ``` -### Torrent Tagging +### 种子标记 -Torrents are tagged in qBittorrent with `ab:{bangumi_id}` for offset lookup during rename operations. This enables fast bangumi identification without database queries. +种子在 qBittorrent 中使用 `ab:{bangumi_id}` 标记,用于重命名操作时的偏移查找。这使得无需数据库查询即可快速识别番剧。 -## Common Issues +## 常见问题 ### DetachedInstanceError -If you access cached objects from a different session: +如果您从不同的会话访问缓存的对象: ```python -# Wrong: accessing cached object in new session -bangumis = db.bangumi.search_all() # Cached +# 错误:在新会话中访问缓存的对象 +bangumis = db.bangumi.search_all() # 已缓存 with Database() as new_db: - new_db.session.add(bangumis[0]) # Error! + new_db.session.add(bangumis[0]) # 错误! -# Right: objects are expunged, work independently +# 正确:对象已分离,可独立工作 bangumis = db.bangumi.search_all() -bangumis[0].title_raw = "New Title" # OK, but won't persist +bangumis[0].title_raw = "New Title" # 可以,但不会持久化 ``` -### Cache Staleness +### 缓存过期 -If manual SQL updates bypass the ORM, invalidate the cache: +如果手动 SQL 更新绕过了 ORM,请使缓存失效: ```python from module.database.bangumi import _invalidate_bangumi_cache @@ -390,5 +390,5 @@ with engine.connect() as conn: conn.execute(text("UPDATE bangumi SET ...")) conn.commit() -_invalidate_bangumi_cache() # Important! +_invalidate_bangumi_cache() # 重要! ``` diff --git a/docs/dev/index.md b/docs/dev/index.md index 30c01adb..e743e668 100644 --- a/docs/dev/index.md +++ b/docs/dev/index.md @@ -1,135 +1,135 @@ -# Contributing Guide +# 贡献指南 -We welcome contributors to help make AutoBangumi better at solving issues encountered by users. +我们欢迎贡献者帮助改进 AutoBangumi,更好地解决用户遇到的问题。 -This guide will walk you through how to contribute code to AutoBangumi. Please take a few minutes to read through before submitting a Pull Request. +本指南将引导您了解如何向 AutoBangumi 贡献代码。请在提交 Pull Request 之前花几分钟阅读。 -This article covers: +本文涵盖: -- [Project Roadmap](#project-roadmap) - - [Request for Comments (RFC)](#request-for-comments-rfc) -- [Git Branch Management](#git-branch-management) - - [Version Numbering](#version-numbering) - - [Branch Development, Trunk Release](#branch-development-trunk-release) - - [Branch Lifecycle](#branch-lifecycle) - - [Git Workflow Overview](#git-workflow-overview) +- [项目路线图](#项目路线图) + - [征求意见稿 (RFC)](#征求意见稿-rfc) +- [Git 分支管理](#git-分支管理) + - [版本号规则](#版本号规则) + - [分支开发,主干发布](#分支开发主干发布) + - [分支生命周期](#分支生命周期) + - [Git 工作流程概述](#git-工作流程概述) - [Pull Request](#pull-request) -- [Release Process](#release-process) +- [发布流程](#发布流程) -## Project Roadmap +## 项目路线图 -The AutoBangumi development team uses [GitHub Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) boards to manage planned development, ongoing fixes, and their progress. +AutoBangumi 开发团队使用 [GitHub Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) 看板来管理计划中的开发、正在进行的修复及其进度。 -This helps you understand: -- What the development team is working on -- What aligns with your intended contribution, so you can participate directly -- What's already in progress, to avoid duplicate work +这可以帮助您了解: +- 开发团队正在做什么 +- 哪些内容与您想要的贡献一致,以便您直接参与 +- 哪些工作已经在进行中,避免重复工作 -In [Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen), beyond the usual `[Feature Request]`, `[BUG]`, and small improvements, you'll find **`[RFC]`** items. +在 [Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) 中,除了常见的 `[Feature Request]`、`[BUG]` 和小改进外,您还会看到 **`[RFC]`** 条目。 -### Request for Comments (RFC) +### 征求意见稿 (RFC) -> Find existing [AutoBangumi RFCs](https://github.com/EstrellaXD/Auto_Bangumi/issues?q=is%3Aissue+label%3ARFC) via the `RFC` label in issues. +> 通过 issues 中的 `RFC` 标签查找现有的 [AutoBangumi RFC](https://github.com/EstrellaXD/Auto_Bangumi/issues?q=is%3Aissue+label%3ARFC)。 -For small improvements or bug fixes, feel free to adjust the code and submit a Pull Request. Just read the [Branch Management](#git-branch-management) section to base your work on the correct branch, and the [Pull Request](#pull-request) section to understand how PRs are merged. +对于小改进或 bug 修复,可以直接调整代码并提交 Pull Request。只需阅读[分支管理](#git-分支管理)部分以确保基于正确的分支进行工作,以及 [Pull Request](#pull-request) 部分了解 PR 如何被合并。
-For **larger** feature refactors with broad scope, please first write an RFC proposal via [Issue: Feature Proposal](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?assignees=&labels=RFC&projects=&template=rfc.yml&title=%5BRFC%5D%3A+) to briefly describe your approach and seek developer discussion and consensus. +对于涉及范围较广的**较大**功能重构,请首先通过 [Issue: Feature Proposal](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?assignees=&labels=RFC&projects=&template=rfc.yml&title=%5BRFC%5D%3A+) 编写 RFC 提案,简要描述您的方法并寻求开发者讨论和共识。 -Some proposals may conflict with decisions the development team has already made, and this step helps avoid wasted effort. +某些提案可能与开发团队已经做出的决定冲突,此步骤有助于避免浪费精力。 -> If you only want to discuss whether to add or improve a feature (not "how to implement it"), use -> [Issue: Feature Request](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?labels=feature+request&template=feature_request.yml&title=%5BFeature+Request%5D+) +> 如果您只是想讨论是否添加或改进某个功能(而不是"如何实现"),请使用 -> [Issue: Feature Request](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?labels=feature+request&template=feature_request.yml&title=%5BFeature+Request%5D+)
-An [RFC Proposal](https://github.com/EstrellaXD/Auto_Bangumi/issues?q=is%3Aissue+is%3Aopen+label%3ARFC) is **"a document for developers to review technical design/approach before concrete development of a feature/refactor"**. +[RFC 提案](https://github.com/EstrellaXD/Auto_Bangumi/issues?q=is%3Aissue+is%3Aopen+label%3ARFC)是**"在功能/重构的具体开发之前,供开发者审查技术设计/方法的文档"**。 -The purpose is to ensure collaborating developers clearly know "what to do" and "how it will be done", with all developers able to participate in open discussion. +其目的是确保协作的开发者清楚地知道"要做什么"和"如何完成",所有开发者都可以参与公开讨论。 -This helps evaluate impacts (overlooked considerations, backward compatibility, conflicts with existing features). +这有助于评估影响(被忽略的考虑因素、向后兼容性、与现有功能的冲突)。 -Therefore, proposals focus on describing the **approach, design, and steps** for solving the problem. +因此,提案重点描述解决问题的**方法、设计和步骤**。 -## Git Branch Management +## Git 分支管理 -### Version Numbering +### 版本号规则 -Git branches in the AutoBangumi project are closely related to release version rules. +AutoBangumi 项目中的 Git 分支与发布版本规则密切相关。 -AutoBangumi follows [Semantic Versioning (SemVer)](https://semver.org/) with a `..` format: +AutoBangumi 遵循[语义化版本控制 (SemVer)](https://semver.org/),使用 `..` 格式: -- **Major**: Major version update, likely with incompatible configuration/API changes -- **Minor**: Backward-compatible new functionality -- **Patch**: Backward-compatible bug fixes / minor improvements +- **Major**:主版本更新,可能包含不兼容的配置/API 变更 +- **Minor**:向后兼容的新功能 +- **Patch**:向后兼容的 bug 修复/小改进 -### Branch Development, Trunk Release +### 分支开发,主干发布 -AutoBangumi uses a "branch development, trunk release" model. +AutoBangumi 使用"分支开发,主干发布"模式。 -[**`main`**](https://github.com/EstrellaXD/Auto_Bangumi/commits/main) is the stable **trunk branch**, used only for releases, not for direct development. +[**`main`**](https://github.com/EstrellaXD/Auto_Bangumi/commits/main) 是稳定的**主干分支**,仅用于发布,不直接用于开发。 -Each Minor version has a corresponding **development branch** for new features and post-release maintenance. +每个 Minor 版本都有对应的**开发分支**,用于新功能和发布后的维护。 -Development branches are named `.-dev`, e.g., `3.1-dev`, `3.0-dev`, `2.6-dev`. Find them in [All Branches](https://github.com/EstrellaXD/Auto_Bangumi/branches/all?query=-dev). +开发分支命名为 `.-dev`,例如 `3.1-dev`、`3.0-dev`、`2.6-dev`。在[所有分支](https://github.com/EstrellaXD/Auto_Bangumi/branches/all?query=-dev)中查找它们。 -### Branch Lifecycle +### 分支生命周期 -When a Minor development branch (e.g., `3.1-dev`) completes feature development and **first** merges into main: -- Release the Minor version (e.g., `3.1.0`) -- Create the **next** Minor development branch (`3.2-dev`) for next version features - - The **previous** version's branch (`3.0-dev`) is archived -- This Minor branch (`3.1-dev`) enters maintenance — no new features/refactors, only bug fixes - - Bug fixes are merged to the maintenance branch, then to main for `Patch` releases +当一个 Minor 开发分支(如 `3.1-dev`)完成功能开发并**首次**合并到 main 时: +- 发布 Minor 版本(如 `3.1.0`) +- 创建**下一个** Minor 开发分支(`3.2-dev`)用于下个版本的功能 + - **上一个**版本的分支(`3.0-dev`)将被归档 +- 当前 Minor 分支(`3.1-dev`)进入维护期——不再添加新功能/重构,只修复 bug + - Bug 修复先合并到维护分支,然后合并到 main 进行 `Patch` 发布 -For contributors choosing Git branches: -- **Bug fixes** — base on the **current released version's** Minor branch, PR to that branch -- **New features/refactors** — base on the **next unreleased version's** Minor branch, PR to that branch +对于选择 Git 分支的贡献者: +- **Bug 修复** — 基于**当前已发布版本**的 Minor 分支,向该分支提交 PR +- **新功能/重构** — 基于**下一个未发布版本**的 Minor 分支,向该分支提交 PR -> "Current released version" is the latest version on the [[Releases page]](https://github.com/EstrellaXD/Auto_Bangumi/releases) +> "当前已发布版本"是 [[Releases 页面]](https://github.com/EstrellaXD/Auto_Bangumi/releases) 上的最新版本 -### Git Workflow Overview +### Git 工作流程概述 -> Commit timeline goes from left to right ---> +> 提交时间线从左到右 ---> ![dev-branch](../image/dev/branch.png) ## Pull Request -Ensure you've selected the correct PR target branch per the Git Branch Management section above: -> - **Bug fixes** → PR to the **current released version's** Minor maintenance branch -> - **New features/refactors** → PR to the **next version's** Minor development branch +请确保按照上述 Git 分支管理部分选择正确的 PR 目标分支: +> - **Bug 修复** → 向**当前已发布版本**的 Minor 维护分支提交 PR +> - **新功能/重构** → 向**下一版本**的 Minor 开发分支提交 PR
-- A PR should correspond to a single concern and not introduce unrelated changes. +- 一个 PR 应该对应单一关注点,不要引入无关的更改。 - Split different concerns into multiple PRs to help the team focus on one issue per review. + 将不同的关注点拆分为多个 PR,以帮助团队在每次审查中专注于一个问题。 -- In the PR title and description, briefly explain the changes including reasons and intent. +- 在 PR 标题和描述中,简要说明更改内容,包括原因和意图。 - Link related issues or RFCs in the PR description. + 在 PR 描述中链接相关的 issues 或 RFC。 - This helps the team understand context quickly during code review. + 这有助于团队在代码审查时快速了解上下文。 -- Ensure "Allow edits from maintainers" is checked. This allows direct minor edits/refactors and saves time. +- 确保勾选"允许维护者编辑"。这允许直接进行小的编辑/重构,节省时间。 -- Ensure local tests and linting pass. These are also checked in PR CI. - - For bug fixes and new features, the team may request corresponding unit test coverage. +- 确保本地测试和代码检查通过。这些也会在 PR CI 中检查。 + - 对于 bug 修复和新功能,团队可能会要求相应的单元测试覆盖。 -The development team will review contributor PRs and discuss or approve merging as soon as possible. +开发团队将尽快审查贡献者的 PR,进行讨论或批准合并。 -## Release Process +## 发布流程 -Releases are currently triggered automatically after the development team manually merges a specific "release PR". +目前,发布是在开发团队手动合并特定的"发布 PR"后自动触发的。 -Bug fix PRs are typically released quickly, usually within a week. +Bug 修复 PR 通常会快速发布,一般在一周内。 -New feature releases take longer and are less predictable. Check the [GitHub Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) board for development progress — a version is released when all planned features are complete. +新功能发布需要更长时间,时间不太可预测。查看 [GitHub Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) 看板了解开发进度——当所有计划功能完成时发布版本。 diff --git a/docs/en/api/index.md b/docs/en/api/index.md new file mode 100644 index 00000000..3fd718c6 --- /dev/null +++ b/docs/en/api/index.md @@ -0,0 +1,619 @@ +# REST API Reference + +AutoBangumi exposes a REST API at `/api/v1`. All endpoints (except login and setup) require JWT authentication. + +**Base URL:** `http://your-host:7892/api/v1` + +**Authentication:** Include the JWT token as a cookie or `Authorization: Bearer ` header. + +**Interactive Docs:** When running in development mode, Swagger UI is available at `http://your-host:7892/docs`. + +--- + +## Authentication + +### Login + +``` +POST /auth/login +``` + +Authenticate with username and password. + +**Request Body:** +```json +{ + "username": "string", + "password": "string" +} +``` + +**Response:** Sets authentication cookie with JWT token. + +### Refresh Token + +``` +GET /auth/refresh_token +``` + +Refresh the current authentication token. + +### Logout + +``` +GET /auth/logout +``` + +Clear authentication cookies and log out. + +### Update Credentials + +``` +POST /auth/update +``` + +Update username and/or password. + +**Request Body:** +```json +{ + "username": "string", + "password": "string" +} +``` + +--- + +## Passkey / WebAuthn + +Passwordless authentication using WebAuthn/FIDO2 Passkeys. + +### Register Passkey + +``` +POST /passkey/register/options +``` + +Get WebAuthn registration options (challenge, relying party info). + +``` +POST /passkey/register/verify +``` + +Verify and save the Passkey registration response from the browser. + +### Authenticate with Passkey + +``` +POST /passkey/auth/options +``` + +Get WebAuthn authentication challenge options. + +``` +POST /passkey/auth/verify +``` + +Verify the Passkey authentication response and issue a JWT token. + +### Manage Passkeys + +``` +GET /passkey/list +``` + +List all registered Passkeys for the current user. + +``` +POST /passkey/delete +``` + +Delete a registered Passkey by credential ID. + +--- + +## Configuration + +### Get Configuration + +``` +GET /config/get +``` + +Retrieve the current application configuration. + +**Response:** Full configuration object including `program`, `downloader`, `rss_parser`, `bangumi_manager`, `notification`, `proxy`, and `experimental_openai` sections. + +### Update Configuration + +``` +PATCH /config/update +``` + +Partially update the application configuration. Only include fields you want to change. + +**Request Body:** Partial configuration object. + +--- + +## Bangumi (Anime Rules) + +### List All Bangumi + +``` +GET /bangumi/get/all +``` + +Get all anime download rules. + +### Get Bangumi by ID + +``` +GET /bangumi/get/{bangumi_id} +``` + +Get a specific anime rule by ID. + +### Update Bangumi + +``` +PATCH /bangumi/update/{bangumi_id} +``` + +Update an anime rule's metadata (title, season, episode offset, etc.). + +### Delete Bangumi + +``` +DELETE /bangumi/delete/{bangumi_id} +``` + +Delete a single anime rule and its associated torrents. + +``` +DELETE /bangumi/delete/many/ +``` + +Batch delete multiple anime rules. + +**Request Body:** +```json +{ + "bangumi_ids": [1, 2, 3] +} +``` + +### Disable / Enable Bangumi + +``` +DELETE /bangumi/disable/{bangumi_id} +``` + +Disable an anime rule (keeps files, stops downloading). + +``` +DELETE /bangumi/disable/many/ +``` + +Batch disable multiple anime rules. + +``` +GET /bangumi/enable/{bangumi_id} +``` + +Re-enable a previously disabled anime rule. + +### Poster Refresh + +``` +GET /bangumi/refresh/poster/all +``` + +Refresh poster images for all anime from TMDB. + +``` +GET /bangumi/refresh/poster/{bangumi_id} +``` + +Refresh the poster image for a specific anime. + +### Calendar + +``` +GET /bangumi/refresh/calendar +``` + +Refresh the anime broadcast calendar data from Bangumi.tv. + +### Reset All + +``` +GET /bangumi/reset/all +``` + +Delete all anime rules. Use with caution. + +--- + +## RSS Feeds + +### List All Feeds + +``` +GET /rss +``` + +Get all configured RSS feeds. + +### Add Feed + +``` +POST /rss/add +``` + +Add a new RSS feed subscription. + +**Request Body:** +```json +{ + "url": "string", + "aggregate": true, + "parser": "mikan" +} +``` + +### Enable / Disable Feeds + +``` +POST /rss/enable/many +``` + +Enable multiple RSS feeds. + +``` +PATCH /rss/disable/{rss_id} +``` + +Disable a single RSS feed. + +``` +POST /rss/disable/many +``` + +Batch disable multiple RSS feeds. + +### Delete Feeds + +``` +DELETE /rss/delete/{rss_id} +``` + +Delete a single RSS feed. + +``` +POST /rss/delete/many +``` + +Batch delete multiple RSS feeds. + +### Update Feed + +``` +PATCH /rss/update/{rss_id} +``` + +Update an RSS feed's configuration. + +### Refresh Feeds + +``` +GET /rss/refresh/all +``` + +Manually trigger a refresh of all RSS feeds. + +``` +GET /rss/refresh/{rss_id} +``` + +Refresh a specific RSS feed. + +### Get Torrents from Feed + +``` +GET /rss/torrent/{rss_id} +``` + +Get the list of torrents parsed from a specific RSS feed. + +### Analysis & Subscription + +``` +POST /rss/analysis +``` + +Analyze an RSS URL and extract anime metadata without subscribing. + +**Request Body:** +```json +{ + "url": "string" +} +``` + +``` +POST /rss/collect +``` + +Download all episodes from an RSS feed (for completed anime). + +``` +POST /rss/subscribe +``` + +Subscribe to an RSS feed for automatic ongoing downloads. + +--- + +## Search + +### Search Bangumi (Server-Sent Events) + +``` +GET /search/bangumi?keyword={keyword}&provider={provider} +``` + +Search for anime torrents. Returns results as a Server-Sent Events (SSE) stream for real-time updates. + +**Query Parameters:** +- `keyword` — Search keyword +- `provider` — Search provider (e.g., `mikan`, `nyaa`, `dmhy`) + +**Response:** SSE stream with parsed search results. + +### List Search Providers + +``` +GET /search/provider +``` + +Get the list of available search providers. + +--- + +## Program Control + +### Get Status + +``` +GET /status +``` + +Get program status including version, running state, and first_run flag. + +**Response:** +```json +{ + "status": "running", + "version": "3.2.0", + "first_run": false +} +``` + +### Start Program + +``` +GET /start +``` + +Start the main program (RSS checking, downloading, renaming). + +### Restart Program + +``` +GET /restart +``` + +Restart the main program. + +### Stop Program + +``` +GET /stop +``` + +Stop the main program (WebUI remains accessible). + +### Shutdown + +``` +GET /shutdown +``` + +Shutdown the entire application (restarts the Docker container). + +### Check Downloader + +``` +GET /check/downloader +``` + +Test connectivity to the configured downloader (qBittorrent). + +--- + +## Downloader Management + +Manage torrents in the downloader directly from AutoBangumi. + +### List Torrents + +``` +GET /downloader/torrents +``` + +Get all torrents in the Bangumi category. + +### Pause Torrents + +``` +POST /downloader/torrents/pause +``` + +Pause torrents by hash. + +**Request Body:** +```json +{ + "hashes": ["hash1", "hash2"] +} +``` + +### Resume Torrents + +``` +POST /downloader/torrents/resume +``` + +Resume paused torrents by hash. + +**Request Body:** +```json +{ + "hashes": ["hash1", "hash2"] +} +``` + +### Delete Torrents + +``` +POST /downloader/torrents/delete +``` + +Delete torrents with optional file deletion. + +**Request Body:** +```json +{ + "hashes": ["hash1", "hash2"], + "delete_files": false +} +``` + +--- + +## Setup Wizard + +These endpoints are only available during first-run setup (before setup is complete). They do **not** require authentication. After setup completes, all endpoints return `403 Forbidden`. + +### Check Setup Status + +``` +GET /setup/status +``` + +Check if setup wizard is needed (first run). + +**Response:** +```json +{ + "need_setup": true +} +``` + +### Test Downloader Connection + +``` +POST /setup/test-downloader +``` + +Test connection to a downloader with provided credentials. + +**Request Body:** +```json +{ + "type": "qbittorrent", + "host": "172.17.0.1:8080", + "username": "admin", + "password": "adminadmin", + "ssl": false +} +``` + +### Test RSS Feed + +``` +POST /setup/test-rss +``` + +Validate an RSS feed URL is accessible and parseable. + +**Request Body:** +```json +{ + "url": "https://mikanime.tv/RSS/MyBangumi?token=xxx" +} +``` + +### Test Notification + +``` +POST /setup/test-notification +``` + +Send a test notification with provided settings. + +**Request Body:** +```json +{ + "type": "telegram", + "token": "bot_token", + "chat_id": "chat_id" +} +``` + +### Complete Setup + +``` +POST /setup/complete +``` + +Save all configuration and mark setup as complete. Creates the sentinel file `config/.setup_complete`. + +**Request Body:** Full configuration object. + +--- + +## Logs + +### Get Logs + +``` +GET /log +``` + +Retrieve the full application log file. + +### Clear Logs + +``` +GET /log/clear +``` + +Clear the log file. + +--- + +## Response Format + +All API responses follow a consistent format: + +```json +{ + "msg_en": "Success message in English", + "msg_zh": "Success message in Chinese", + "status": true +} +``` + +Error responses include appropriate HTTP status codes (400, 401, 403, 404, 500) with error messages in both languages. diff --git a/docs/en/changelog/2.6.md b/docs/en/changelog/2.6.md new file mode 100644 index 00000000..3b546ed2 --- /dev/null +++ b/docs/en/changelog/2.6.md @@ -0,0 +1,137 @@ +# [2.6] Release Notes + +## Upgrade Notes from Older Versions + +Starting from version 2.6, AutoBangumi (AB) configuration has moved from environment variables to `config.json`. Note the following before upgrading. + +### Environment Variable Migration + +Old environment variables are automatically converted to `config.json` on the first startup after upgrading to 2.6. The generated `config.json` is placed in the `/app/config` folder. +Once you've mapped the `/app/config` folder, old environment variables no longer affect AB's operation. You can delete `config.json` to regenerate from environment variables. + +### Container Volume Mapping + +After version 2.6, the following folders need to be mapped: + +- `/app/config`: Configuration folder containing `config.json` +- `/app/data`: Data folder containing `bangumi.json`, etc. + +### Data Files + +Due to major updates, we don't recommend using old data files. AB will automatically generate a new `bangumi.json` in `/app/data`. + +Don't worry — QB won't re-download previously downloaded anime. + +### Subsequent Configuration Changes + +AB can now edit configuration directly in the WebUI. After editing, restart the container for changes to take effect. + +## How to Upgrade + +### Docker Compose + +You can use your existing docker-compose.yml file to upgrade: + +```bash +docker compose stop autobangumi +docker compose pull autobangumi +``` + +Then modify docker-compose.yml to add volume mappings: + +```yaml +version: "3.8" + +services: + autobangumi: + image: estrellaxd/auto_bangumi:latest + container_name: autobangumi + restart: unless-stopped + environment: + - PUID=1000 + - PGID=1000 + - TZ=Asia/Shanghai + volumes: + - /path/to/config:/app/config + - /path/to/data:/app/data + networks: + - bridge + dns: + - 8.8.8.8 +``` + +Then start AB: + +```bash +docker compose up -d autobangumi +``` + +### Portainer + +In Portainer, modify the volume mappings and click `Recreate` to complete the upgrade. + +### What to do if the upgrade causes issues + +Since configurations may vary, upgrades might cause the program to fail. Delete all previous data and generated configuration files, then restart the container and reconfigure in the WebUI. + + +## New Features + +### Configuration Method Change + +After v2.6, program configuration has moved from Docker environment variables to `config.json`. +The new WebUI also provides a web-based configuration editor. Access the AB URL and find `Settings` in the sidebar to modify configuration. Restart the container after editing. + +### Custom Reverse Proxy URL and AB as Proxy Relay + +To handle situations where [Mikan Project](https://mikanani.me) is inaccessible, AB provides three approaches: + +1. HTTP and SOCKS Proxy + + This feature existed in older versions. After upgrading to 2.6, just check the proxy configuration in the WebUI to access Mikan Project normally. + + However, qBittorrent still can't access Mikan's RSS and torrent URLs directly, so you need to add a proxy in qBittorrent as well. See #198 for details. + +2. Custom Reverse Proxy URL + + Version 2.6 added a `custom_url` option for custom reverse proxy URLs. + Set it to your properly configured reverse proxy URL. AB will use this custom URL to access Mikan Project, and QB can download normally. + +3. AB as Proxy Relay + + After configuring a proxy in AB, AB can serve as a local proxy relay (currently only for RSS-related functions). + Set `custom_url` to `http://abhost:abport` where `abhost` is AB's IP and `abport` is AB's port. + AB will push its own address to qBittorrent, which will use AB as a proxy to access Mikan Project. + + Note: If you haven't set up a reverse proxy for AB with Nginx or similar, include `http://` to ensure proper operation. + +**Important Notes** + +If AB and QB are in the same container, don't use `127.0.0.1` or `localhost` as they can't communicate this way. +If on the same network, use container name addressing, e.g., `http://autobangumi:7892`. + +You can also use the Docker gateway address, e.g., `http://172.17.0.1:7892`. + +If on different hosts, use the host machine's IP address. + +### Collection and Folder Renaming + +AB can now rename files within collections and folders, moving media files back to the root directory. +Note that AB still relies on the save path to determine season and episode information, so place collection files according to AB's standard. + +After version **2.6.4**, AB can rename subtitles within folders (feature still being refined). Collections and subtitles default to `pn` format renaming; adjustment options are not yet available. + +**Standard Path** + +``` +/downloads/Bangumi/Title/Season 1/xxx +``` + +### Push Notifications + +AB can now send rename completion notifications via `Telegram` and `ServerChan`. + +In the WebUI, enable push notifications and fill in the required parameters. + +- Telegram requires Bot Token and Chat ID. Refer to various tutorials for obtaining these. +- ServerChan requires a Token. Refer to various tutorials for obtaining this. diff --git a/docs/en/changelog/3.0.md b/docs/en/changelog/3.0.md new file mode 100644 index 00000000..5a2a0ff9 --- /dev/null +++ b/docs/en/changelog/3.0.md @@ -0,0 +1,46 @@ +# [3.0] Release Notes + +### New WebUI + +- Login functionality — AB now supports username/password authentication. Some operations require login. +- New poster wall +- Bangumi management features + - Edit anime season info and names. Changes automatically update **download rules** / **downloaded file paths** and trigger renaming. + - New link parser — after parsing a link, you can manually adjust download info, select download season, or add automatic download rules. + - Delete anime — one-click deletion of anime and its torrent files. + - Custom download rules per anime, independent of global rules. +- New configuration interface for easier application rule configuration +- Added initialization page for first-time startup guidance +- Downloader connection checker for qBittorrent connectivity +- RSS URL validator to check if RSS feeds are valid +- Added program management buttons for starting/stopping the program and restarting the container from the WebUI + +### Parser + +- New parser with support for different source types to obtain official titles and poster URLs +- Supports changing RSS subscription sources without regenerating the database + +### Notification Module + +- Added `Bark` notification module +- New notification format — can now push posters, anime names, and updated episode numbers to Telegram + +### Data Migration + +- Automatic data migration when upgrading from older versions +- Migrated data also automatically matches posters + +## Fixes + +- Fixed renaming bugs that could occur with Windows paths + +## Changes + +- Migrated from `json` to `sqlite` for data storage +- Migrated from multiprocessing to multithreading + - Refactored main program + - Improved startup/shutdown time +- Refactored parser module +- Refactored renaming module + - Temporarily removed `normal` mode +- Added `ghcr.io` image registry diff --git a/docs/en/changelog/3.1.md b/docs/en/changelog/3.1.md new file mode 100644 index 00000000..87457c14 --- /dev/null +++ b/docs/en/changelog/3.1.md @@ -0,0 +1,47 @@ +# [3.1] - 2023-08 + +- Merged backend and frontend repositories, optimized project directory structure +- Optimized version release workflow +- Wiki migrated to VitePress at: https://autobangumi.org + +## Backend + +### Features + +- Added `RSS Engine` module — AB can now independently update and manage RSS subscriptions and send torrents to the downloader + - Supports multiple aggregated RSS subscription sources, managed via the RSS Engine module + - Download deduplication — duplicate subscribed torrents won't be re-downloaded + - Added manual refresh API for RSS subscriptions + - Added RSS subscription management API +- Added `Search Engine` module — search torrents by keyword and parse results into collection or subscription tasks + - Plugin-based search engine with support for `mikan`, `dmhy`, and `nyaa` +- Added subtitle group-specific rules for individual group configurations +- Added IPv6 listening support (set `IPV6=1` in environment variables) +- Added batch operations API for bulk rule and RSS subscription management + +### Changes + +- Database structure changed to `sqlmodel` for database management +- Added version management for seamless software data updates +- Unified API format +- Added API response language options +- Added database mock tests +- Code optimizations + +### Bugfixes + +- Fixed various minor issues +- Introduced some major issues + +## Frontend + +### Features + +- Added `i18n` support — currently supports `zh-CN` and `en-US` +- Added PWA support +- Added RSS management page +- Added search top bar + +### Changes + +- Adjusted various UI details diff --git a/docs/en/changelog/3.2.md b/docs/en/changelog/3.2.md new file mode 100644 index 00000000..d13fd599 --- /dev/null +++ b/docs/en/changelog/3.2.md @@ -0,0 +1,192 @@ +# [3.2] - 2025-01 + +## Backend + +### Features + +- Added WebAuthn Passkey passwordless login support + - Register, authenticate, and manage Passkey credentials + - Multi-device credential backup detection (iCloud Keychain, etc.) + - Clone attack protection (sign_count verification) + - Authentication strategy pattern unifying password and Passkey login interfaces + - Usernameless login support via discoverable credentials (resident keys) +- Added season/episode offset auto-detection + - Analyzes TMDB episode air dates to detect "virtual seasons" (e.g., Frieren S1 split into two parts) + - Auto-identifies different parts when broadcast gap exceeds 6 months + - Calculates episode offset (e.g., RSS shows S2E1 → TMDB S1E29) + - Background scan thread automatically detects offset issues in existing subscriptions + - New API endpoints: `POST /bangumi/detect-offset`, `PATCH /bangumi/dismiss-review/{id}` +- Added bangumi archive functionality + - Manual archive/unarchive support + - Auto-archive completed series + - New API endpoints: `PATCH /bangumi/archive/{id}`, `PATCH /bangumi/unarchive/{id}`, `GET /bangumi/refresh/metadata` +- Added search provider configuration API + - `GET /search/provider/config` - Get search provider config + - `PUT /search/provider/config` - Update search provider config +- Added RSS connection status tracking + - Records `connection_status` (healthy/error), `last_checked_at`, and `last_error` after each refresh +- Added first-run setup wizard + - 7-step guided configuration: account, downloader, RSS source, media path, notifications + - Downloader connection test, RSS source validation + - Optional steps can be skipped and configured later in settings + - Sentinel file mechanism (`config/.setup_complete`) prevents re-triggering + - Unauthenticated setup API (only available on first run, returns 403 after completion) +- Added calendar view with Bangumi.tv broadcast schedule integration +- Added downloader API and management interface +- Full async migration + - Database layer async support (aiosqlite) for non-blocking I/O in Passkey operations + - `UserDatabase` supports both sync/async modes for backward compatibility + - `Database` context manager supports both `with` (sync) and `async with` (async) + - RSS engine, downloader, checker, and parser fully converted to async + - Network requests migrated from `requests` to `httpx` (AsyncClient) +- Backend migrated to `uv` package manager (pyproject.toml + uv.lock) +- Server startup uses background tasks to avoid blocking (fixes #891, #929) +- Database migration auto-fills NULL values with model defaults +- Database adds `needs_review` and `needs_review_reason` fields for offset detection + +### Performance + +- Shared HTTP client connection pool, reuses TCP/SSL connections +- RSS refresh now concurrent (`asyncio.gather`), ~10x faster with multiple sources +- Torrent file download now concurrent, ~5x faster for multiple torrents +- Rename module concurrent file list fetching, ~20x faster +- Notification sending now concurrent, removed 2-second hardcoded delay +- Added TMDB and Mikan parser result caching to avoid duplicate API calls +- Database indexes added for `Torrent.url`, `Torrent.rss_id`, `Bangumi.title_raw`, `Bangumi.deleted`, `RSSItem.url` +- RSS batch enable/disable uses single transaction instead of per-item commits +- Pre-compiled regex patterns for torrent name parsing and filter matching +- `SeasonCollector` created outside loops, reuses single authentication +- RSS parsing deduplication changed from O(n²) list lookup to O(1) set lookup +- `Episode`/`SeasonInfo` dataclasses use `__slots__` for reduced memory footprint + +### Changes + +- Upgraded WebAuthn dependency to py_webauthn 2.7.0 +- `_get_webauthn_from_request` prioritizes browser Origin header, fixing verification issues in cross-port development environments +- `auth_user` and `update_user_info` converted to async functions +- `TitleParser.tmdb_parser` converted to async function +- `RSSEngine` methods fully async (`pull_rss`, `refresh_rss`, `download_bangumi`, `add_rss`) +- `Checker.check_downloader` converted to async function +- `ProgramStatus` migrated from threading to asyncio (Event, Lock) + +### Bugfixes + +- Fixed downloader connection check with max retry limit +- Fixed transient network errors when adding torrents with retry logic +- Fixed multiple issues in search and subscription flow +- Improved torrent fetch reliability and error handling +- Fixed `aaguid` type error (now `str` in py_webauthn 2.7.0, no longer `bytes`) +- Fixed missing `credential_backup_eligible` field (replaced with `credential_device_type`) +- Fixed `verify_authentication_response` receiving invalid `credential_id` parameter causing TypeError +- Fixed program startup blocking the server (fixes #891, #929, #886, #917, #946) +- Fixed search interface export not matching component expectations +- Fixed poster endpoint path check incorrectly intercepting all requests (fixes #933, #934) +- Fixed OpenAI parser security issue +- Fixed database tests using async sessions with sync code mismatch +- Fixed config field conflicts when upgrading from 3.1.x to 3.2 causing settings loss (fixes #956) + - `program.sleep_time` / `program.times` auto-migrated to `rss_time` / `rename_time` + - Removed deprecated `rss_parser` fields (`type`, `custom_url`, `token`, `enable_tmdb`) + - Fixed `ENV_TO_ATTR` environment variable mapping pointing to non-existent model fields + - Fixed `DEFAULT_SETTINGS` inconsistency with current config model +- Fixed version upgrade migration logic errors (all upgrades calling 3.0→3.1 migration) + - Added version-aware migration dispatch based on source version + - Added `from_31_to_32()` migration function for database schema changes + +## Frontend + +### Features + +- Complete UI design system redesign + - Unified design tokens (colors, fonts, spacing, shadows, animations) + - Light/dark theme toggle support + - Comprehensive accessibility support (ARIA, keyboard navigation, focus management) + - Responsive layout for mobile devices +- Added first-run setup wizard page + - Multi-step wizard component (progress bar + step navigation) + - Route guard auto-detection and redirect to setup page + - Downloader/RSS/notification connection test feedback + - Chinese and English i18n support +- Added Passkey management panel (settings page) + - WebAuthn browser support detection + - Automatic device name identification + - Passkey list display and deletion +- Added Passkey fingerprint login button on login page (supports usernameless login) +- Added calendar view page +- Added downloader management page +- Added Bangumi card hover overlay (showing title and tags) +- Added `resolvePosterUrl` utility function for unified external URL and local path handling (fixes #934) +- Redesigned search panel with modal and filter system +- Redesigned login panel with modern glassmorphism style +- Added log level filter in log view +- Redesigned LLM settings panel (fixes #938) +- Redesigned settings, downloader, player, and log page styles +- Added search provider settings panel + - View, add, edit, delete search sources in UI + - Default sources (mikan, nyaa, dmhy) cannot be deleted + - URL template validation ensures `%s` placeholder +- Added iOS-style notification badge system + - Yellow badge + purple border for subscriptions needing review + - Combined display support (e.g., `! | 2` for warning + multiple rules) + - Yellow glow animation on cards needing attention +- Edit modal warning banner with one-click auto-detect and dismiss +- Rule selection modal highlights rules with warnings +- Calendar page bangumi grouping: same anime with multiple rules merged, click to select specific rule +- Bangumi list page collapsible "Archived" section +- Bangumi list page skeleton loading animation +- Rule editor episode offset field with "Auto Detect" button +- RSS management page connection status labels: green "Connected" when healthy, red "Error" with tooltip for details +- New mobile-first responsive design + - Three-tier breakpoint system: mobile (<640px), tablet (640-1023px), desktop (≥1024px) + - Mobile bottom navigation bar (with icons and text labels) + - Tablet mini sidebar (56px icon navigation) + - Mobile popups automatically switch to bottom sheets + - Pull-to-refresh support + - Horizontal swipe container support + - Mobile card list replacing data tables (RSS page) + - CSS Grid responsive layout (Bangumi card grid) + - Form labels stack vertically on mobile, full-width inputs + - Touch targets minimum 44px, meeting accessibility standards + - Safe area support (notched devices) + - `100dvh` dynamic viewport height (fixes mobile browser address bar issue) + - `viewport-fit=cover` for full-screen devices + +### New Components + +- `ab-bottom-sheet` — Touch-driven bottom sheet component (drag to close, max height limit) +- `ab-adaptive-modal` — Adaptive modal (bottom sheet on mobile / centered dialog on desktop) +- `ab-pull-refresh` — Pull-to-refresh wrapper component +- `ab-swipe-container` — Horizontal swipe container (CSS scroll-snap) +- `ab-data-list` — Mobile-friendly card list (replacing NDataTable) +- `ab-mobile-nav` — Enhanced bottom navigation bar (icon + label + active indicator) +- `useSafeArea` — Safe area composable + +### Performance + +- Downloader store uses `shallowRef` instead of `ref` to avoid deep reactive proxy on large arrays +- Table column definitions moved to `computed` to avoid rebuilding on each render +- RSS table columns separated from data, column config not rebuilt on data changes +- Calendar page removed duplicate `getAll()` calls +- `ab-select` `watchEffect` changed to `watch`, eliminates invalid emit on mount +- `useClipboard` hoisted to store top level, avoids creating new instance on each `copy()` +- `setInterval` replaced with `useIntervalFn` for automatic lifecycle management + +### Changes + +- Refactored search logic, removed rxjs dependency +- Search store export refactored to match component expectations +- Upgraded frontend dependencies +- Breakpoint system expanded from single 1024px to 640px + 1024px two-tier +- `useBreakpointQuery` added `isTablet`, `isMobileOrTablet`, `isTabletOrPC` +- `media-query.vue` added `#tablet` slot (falls back to `#mobile`) +- UnoCSS added `sm: 640px` breakpoint +- `ab-input` mobile full-width + increased touch target styling +- Layout uses `dvh` units instead of `vh`, supports safe-area-inset +- Fixed calendar page unknown column width +- Unified action bar button sizes in downloader page + +## CI/Infrastructure + +- CI added build test on PR open (dev branch PRs to main auto-trigger build) +- CI upgraded `actions/upload-artifact` and `actions/download-artifact` to v4 +- Docker build removed `linux/arm/v7` platform (uv image doesn't support it) +- Added CLAUDE.md development guide diff --git a/docs/en/config/downloader.md b/docs/en/config/downloader.md new file mode 100644 index 00000000..49948a99 --- /dev/null +++ b/docs/en/config/downloader.md @@ -0,0 +1,56 @@ +# Downloader Settings + +## WebUI Configuration + +![downloader](/image/config/downloader.png){width=500}{class=ab-shadow-card} + +
+ +- **Downloader Type** is the downloader type. Currently only qBittorrent is supported. +- **Host** is the downloader address. [See below](#downloader-address) +- **Download path** is the mapped download path for the downloader. [See below](#download-path-issues) +- **SSL** enables SSL for the downloader connection. + +## Common Issues + +### Downloader Address + +::: warning Note +Do not use 127.0.0.1 or localhost as the downloader address. +::: + +Since AB runs in Docker with **Bridge** mode in the official tutorial, using 127.0.0.1 or localhost will resolve to AB itself, not the downloader. +- If your qBittorrent also runs in Docker, we recommend using the Docker **gateway address: 172.17.0.1**. +- If your qBittorrent runs on the host machine, use the host machine's IP address. + +If you run AB in **Host** mode, you can use 127.0.0.1 instead of the Docker gateway address. + +::: warning Note +Macvlan isolates container networks. Without additional bridge configuration, containers cannot access other containers or the host itself. +::: + +### Download Path Issues + +The path configured in AB is only used to generate the corresponding anime file path. AB itself does not directly manage files at that path. + +**What should I put for the download path?** + +This parameter just needs to match your **downloader's** configuration: +- Docker: If qB uses `/downloads`, then set `/downloads/Bangumi`. You can change `Bangumi` to anything. +- Linux/macOS: If it's `/home/usr/downloads` or `/User/UserName/Downloads`, just append `/Bangumi` at the end. +- Windows: Change `D:\Media\` to `D:\Media\Bangumi` + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `downloader` + +| Parameter | Description | Type | WebUI Option | Default | +|-----------|---------------------|---------|----------------------|---------------------| +| type | Downloader type | String | Downloader type | qbittorrent | +| host | Downloader address | String | Downloader address | 172.17.0.1:8080 | +| username | Downloader username | String | Downloader username | admin | +| password | Downloader password | String | Downloader password | adminadmin | +| path | Download path | String | Download path | /downloads/Bangumi | +| ssl | Enable SSL | Boolean | Enable SSL | false | diff --git a/docs/en/config/experimental.md b/docs/en/config/experimental.md new file mode 100644 index 00000000..78c2ed29 --- /dev/null +++ b/docs/en/config/experimental.md @@ -0,0 +1,57 @@ +# Experimental Features + +::: warning +Experimental features are still in testing. Enabling them may cause unexpected issues and they may be removed in future versions. Use with caution! +::: + +## OpenAI ChatGPT + +Use OpenAI ChatGPT for better structured title parsing. For example: + +``` +input: "【喵萌奶茶屋】★04月新番★[夏日重现/Summer Time Rendering][11][1080p][繁日双语][招募翻译]" +output: '{"group": "喵萌奶茶屋", "title_en": "Summer Time Rendering", "resolution": "1080p", "episode": 11, "season": 1, "title_zh": "夏日重现", "sub": "", "title_jp": "", "season_raw": "", "source": ""}' +``` + +![experimental OpenAI](/image/config/experimental-openai.png){width=500}{class=ab-shadow-card} + +- **Enable OpenAI** enables OpenAI and uses ChatGPT for title parsing. +- **OpenAI API Type** defaults to OpenAI. +- **OpenAI API Key** is your OpenAI account API key. +- **OpenAI API Base URL** is the OpenAI endpoint. Defaults to the official OpenAI URL; you can change it to a compatible third-party endpoint. +- **OpenAI Model** is the ChatGPT model parameter. Currently provides `gpt-3.5-turbo`, which is affordable and produces excellent results with the right prompts. + +## Microsoft Azure OpenAI + + +![experimental Microsoft Azure OpenAI](/image/config/experimental-azure-openai.png){width=500}{class=ab-shadow-card} + +In addition to standard OpenAI, [version 3.1.8](https://github.com/EstrellaXD/Auto_Bangumi/releases/tag/3.1.8) added Microsoft Azure OpenAI support. Usage is similar to standard OpenAI with some shared parameters, but note the following: + +- **Enable OpenAI** enables OpenAI and uses ChatGPT for title parsing. +- **OpenAI API Type** — Select `azure` to show Azure-specific options. +- **OpenAI API Key** is your Microsoft Azure OpenAI API key. +- **OpenAI API Base URL** corresponds to the Microsoft Azure OpenAI Entrypoint. **Must be filled in manually**. +- **Azure OpenAI Version** is the API version. Defaults to `2023-05-15`. See [supported versions](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions). +- **Azure OpenAI Deployment ID** is your deployment ID, usually the same as the model name. Note that Azure OpenAI doesn't support symbols other than `_-`, so `gpt-3.5-turbo` becomes `gpt-35-turbo` in Azure. **Must be filled in manually**. + +Reference documentation: + +- [Quickstart: Get started using GPT-35-Turbo and GPT-4 with Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line&pivots=programming-language-python) +- [Learn how to work with the GPT-35-Turbo and GPT-4 models](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt?pivots=programming-language-chat-completions) + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `experimental_openai` + +| Parameter | Description | Type | WebUI Option | Default | +|---------------|--------------------------|---------|---------------------------|---------------------------| +| enable | Enable OpenAI parser | Boolean | Enable OpenAI | false | +| api_type | OpenAI API type | String | API type (`openai`/`azure`) | openai | +| api_key | OpenAI API key | String | OpenAI API Key | | +| api_base | API Base URL (Azure entrypoint) | String | OpenAI API Base URL | https://api.openai.com/v1 | +| model | OpenAI model | String | OpenAI Model | gpt-3.5-turbo | +| api_version | Azure OpenAI API version | String | Azure API Version | 2023-05-15 | +| deployment_id | Azure Deployment ID | String | Azure Deployment ID | | diff --git a/docs/en/config/manager.md b/docs/en/config/manager.md new file mode 100644 index 00000000..af3ca713 --- /dev/null +++ b/docs/en/config/manager.md @@ -0,0 +1,36 @@ +# Bangumi Manager Settings + +## WebUI Configuration + +![proxy](/image/config/manager.png){width=500}{class=ab-shadow-card} + +
+ +- **Enable** enables the bangumi manager. If disabled, the settings below will not take effect. +- **Rename method** is the renaming method. Currently supported: + - `pn` — `Torrent Title S0XE0X.mp4` format + - `advance` — `Official Title S0XE0X.mp4` format + - `none` — No renaming +- **Eps complete** enables episode completion for the current season. If enabled, missing episodes will be downloaded. +- **Add group tag** adds subtitle group tags to download rules. +- **Delete bad torrent** deletes errored torrents. +- [About file paths][1] +- [About renaming][2] + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `bangumi_manager` + +| Parameter | Description | Type | WebUI Option | Default | +|--------------------|------------------------------ |---------|-------------------|---------| +| enable | Enable bangumi manager | Boolean | Enable manager | true | +| eps_complete | Enable episode completion | Boolean | Episode completion | false | +| rename_method | Rename method | String | Rename method | pn | +| group_tag | Add subtitle group tag | Boolean | Group tag | false | +| remove_bad_torrent | Delete bad torrents | Boolean | Remove bad torrent | false | + + +[1]: https://www.autobangumi.org/faq/#download-path +[2]: https://www.autobangumi.org/faq/#file-renaming diff --git a/docs/en/config/notifier.md b/docs/en/config/notifier.md new file mode 100644 index 00000000..376c3c49 --- /dev/null +++ b/docs/en/config/notifier.md @@ -0,0 +1,34 @@ +# Notification Settings + +## WebUI Configuration + +![notification](/image/config/notifier.png){width=500}{class=ab-shadow-card} + +
+ +- **Enable** enables notifications. If disabled, the settings below will not take effect. +- **Type** is the notification type. Currently supported: + - Telegram + - Wecom + - Bark + - ServerChan +- **Chat ID** only needs to be filled in when using `telegram` notifications. [How to get Telegram Bot Chat ID][1] +- **Wecom**: Fill in the custom push URL in the Chat ID field, and add [Rich Text Message][2] type on the server side. [Wecom Configuration Guide][3] + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `notification` + +| Parameter | Description | Type | WebUI Option | Default | +|-----------|------------------|---------|-----------------|----------| +| enable | Enable notifications | Boolean | Notifications | false | +| type | Notification type | String | Notification type | telegram | +| token | Notification token | String | Notification token | | +| chat_id | Notification Chat ID | String | Notification Chat ID | | + + +[1]: https://core.telegram.org/bots#6-botfather +[2]: https://github.com/umbors/wecomchan-alifun +[3]: https://github.com/easychen/wecomchan diff --git a/docs/en/config/parser.md b/docs/en/config/parser.md new file mode 100644 index 00000000..1542421f --- /dev/null +++ b/docs/en/config/parser.md @@ -0,0 +1,34 @@ +# Parser Settings + +AB's parser is used to parse aggregated RSS links. When new entries appear in the RSS feed, AB will parse the titles and generate automatic download rules. + +::: tip +Since v3.1, parser settings have moved to individual RSS settings. To configure the **parser type**, see [Setting up parser for RSS][add_rss]. +::: + +## Parser Settings in WebUI + +![parser](/image/config/parser.png){width=500}{class=ab-shadow-card} + +
+ +- **Enable**: Whether to enable the RSS parser. +- **Language** is the RSS parser language. Currently supports `zh`, `jp`, and `en`. +- **Exclude** is the global RSS parser filter. You can enter strings or regular expressions, and AB will filter out matching entries during RSS parsing. + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `rss_parser` + +| Parameter | Description | Type | WebUI Option | Default | +|-----------|-----------------------|---------|---------------------|----------------| +| enable | Enable RSS parser | Boolean | Enable RSS parser | true | +| filter | RSS parser filter | Array | Filter | [720,\d+-\d+] | +| language | RSS parser language | String | RSS parser language | zh | + + +[rss_token]: rss +[add_rss]: /feature/rss#parser-settings +[reproxy]: proxy#reverse-proxy diff --git a/docs/en/config/program.md b/docs/en/config/program.md new file mode 100644 index 00000000..a1737b78 --- /dev/null +++ b/docs/en/config/program.md @@ -0,0 +1,25 @@ +# Program Settings + +## WebUI Configuration + +![program](/image/config/program.png){width=500}{class=ab-shadow-card} + +
+ +- Interval Time parameters are in seconds. Convert to seconds if you need to set minutes. +- RSS is the RSS check interval, which affects how often automatic download rules are generated. +- Rename is the rename check interval. Modify this if you need to change how often renaming is checked. +- WebUI Port is the port number. Note that if you're using Docker, you need to remap the port in Docker after changing it. + + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `program` + +| Parameter | Description | Type | WebUI Option | Default | +|-------------|---------------------|-----------------|---------------------|---------| +| rss_time | RSS check interval | Integer (seconds) | RSS check interval | 7200 | +| rename_time | Rename check interval | Integer (seconds) | Rename check interval | 60 | +| webui_port | WebUI port | Integer | WebUI port | 7892 | diff --git a/docs/en/config/proxy.md b/docs/en/config/proxy.md new file mode 100644 index 00000000..b865a36c --- /dev/null +++ b/docs/en/config/proxy.md @@ -0,0 +1,85 @@ +# Proxy and Reverse Proxy + +## Proxy + +![proxy](/image/config/proxy.png){width=500}{class=ab-shadow-card} + +
+ +AB supports HTTP and SOCKS5 proxies to help resolve network issues. + +- **Enable**: Whether to enable the proxy. +- **Type** is the proxy type. +- **Host** is the proxy address. +- **Port** is the proxy port. + +::: tip +In **SOCKS5** mode, username and password are required. +::: + +## `config.json` Configuration Options + +The corresponding options in the configuration file are: + +Configuration section: `proxy` + +| Parameter | Description | Type | WebUI Option | Default | +|-----------|---------------|---------|---------------|---------| +| enable | Enable proxy | Boolean | Proxy | false | +| type | Proxy type | String | Proxy type | http | +| host | Proxy address | String | Proxy address | | +| port | Proxy port | Integer | Proxy port | | +| username | Proxy username | String | Proxy username | | +| password | Proxy password | String | Proxy password | | + +## Reverse Proxy + +- Use the Mikan Project alternative domain `mikanime.tv` to replace `mikanani.me` in your RSS subscription URL. +- Use a Cloudflare Worker as a reverse proxy and replace all `mikanani.me` domains in the RSS feed. + +## Cloudflare Workers + +Based on the approach used to bypass blocks on other services, you can set up a reverse proxy using Cloudflare Workers. How to register a domain and bind it to Cloudflare is beyond the scope of this guide. Add the following code in Workers to use your own domain to access Mikan Project and download torrents from RSS links: + +```js +const TELEGRAPH_URL = 'https://mikanani.me'; +const MY_DOMAIN = 'https://yourdomain.com' + +addEventListener('fetch', event => { + event.respondWith(handleRequest(event.request)) +}) + +async function handleRequest(request) { + const url = new URL(request.url); + url.host = TELEGRAPH_URL.replace(/^https?:\/\//, ''); + + const modifiedRequest = new Request(url.toString(), { + headers: request.headers, + method: request.method, + body: request.body, + redirect: 'manual' + }); + + const response = await fetch(modifiedRequest); + const contentType = response.headers.get('Content-Type') || ''; + + // Only perform replacement if content type is RSS + if (contentType.includes('application/xml')) { + const text = await response.text(); + const replacedText = text.replace(/https?:\/\/mikanani\.me/g, MY_DOMAIN); + const modifiedResponse = new Response(replacedText, response); + + // Add CORS headers + modifiedResponse.headers.set('Access-Control-Allow-Origin', '*'); + + return modifiedResponse; + } else { + const modifiedResponse = new Response(response.body, response); + + // Add CORS headers + modifiedResponse.headers.set('Access-Control-Allow-Origin', '*'); + + return modifiedResponse; + } +} +``` diff --git a/docs/en/config/rss.md b/docs/en/config/rss.md new file mode 100644 index 00000000..e5fafa0c --- /dev/null +++ b/docs/en/config/rss.md @@ -0,0 +1,38 @@ +# RSS Feed Setup + +AutoBangumi can automatically parse aggregated anime RSS feeds and generate download rules based on subtitle groups and anime names, enabling fully automatic anime tracking. +The following uses [Mikan Project][mikan-site] as an example to explain how to get an RSS subscription URL. + +Note that the main Mikan Project site may be blocked in some regions. If you cannot access it without a proxy, use the following alternative domain: + +[Mikan Project (Alternative)][mikan-cn-site] + +## Get Subscription URL + +This project is based on parsing RSS URLs provided by Mikan Project. To enable automatic anime tracking, you need to register and obtain a Mikan Project RSS URL: + +![image](/image/rss/rss-token.png){data-zoomable} + +The RSS URL will look like: + +```txt +https://mikanani.me/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +# or +https://mikanime.tv/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +``` + +## Mikan Project Subscription Tips + +Since AutoBangumi parses all RSS entries it receives, keep the following in mind when subscribing: + +![image](/image/rss/advanced-subscription.png){data-zoomable} + +- Enable advanced settings in your profile settings. +- Subscribe to only one subtitle group per anime. Click the anime poster on Mikan Project to open the submenu and select a single subtitle group. +- If a subtitle group offers both Simplified and Traditional Chinese subtitles, Mikan Project usually provides a way to choose. Select one subtitle type. +- If no subtitle type selection is available, you can set up a `filter` in AutoBangumi to filter them, or manually filter in qBittorrent after the rule is generated. +- OVA and movie subscriptions are currently not supported for parsing. + + +[mikan-site]: https://mikanani.me/ +[mikan-cn-site]: https://mikanime.tv/ diff --git a/docs/en/deploy/docker-cli.md b/docs/en/deploy/docker-cli.md new file mode 100644 index 00000000..1f8af6d8 --- /dev/null +++ b/docs/en/deploy/docker-cli.md @@ -0,0 +1,56 @@ +# Deploy with Docker CLI + +## Note on New Versions + +Since AutoBangumi 2.6, you can configure everything directly in the WebUI. You can start the container first and then configure it in the WebUI. Environment variable configuration from older versions will be automatically migrated. Environment variables still work but only take effect on the first startup. + +## Create Data and Configuration Directories + +To ensure AB's data and configuration persist across updates, we recommend using Docker volumes or bind mounts. + +```shell +# Using bind mount +mkdir -p ${HOME}/AutoBangumi/{config,data} +cd ${HOME}/AutoBangumi +``` + +Choose either bind mount or Docker volume: +```shell +# Using Docker volume +docker volume create AutoBangumi_config +docker volume create AutoBangumi_data +``` + +## Deploy AutoBangumi with Docker CLI + +Copy and run the following command. + +Make sure your working directory is AutoBangumi. + +```shell +docker run -d \ + --name=AutoBangumi \ + -v ${HOME}/AutoBangumi/config:/app/config \ + -v ${HOME}/AutoBangumi/data:/app/data \ + -p 7892:7892 \ + -e TZ=Asia/Shanghai \ + -e PUID=$(id -u) \ + -e PGID=$(id -g) \ + -e UMASK=022 \ + --network=bridge \ + --dns=8.8.8.8 \ + --restart unless-stopped \ + ghcr.io/estrellaxd/auto_bangumi:latest +``` + +If using Docker volumes, replace the bind paths accordingly: +```shell + -v AutoBangumi_config:/app/config \ + -v AutoBangumi_data:/app/data \ +``` + +The AB WebUI will start automatically, but the main program will be paused. Access `http://abhost:7892` to configure it. + +AB will automatically write environment variables to `config.json` and start running. + +We recommend using _[Portainer](https://www.portainer.io)_ or similar Docker management UIs for advanced deployment. diff --git a/docs/en/deploy/docker-compose.md b/docs/en/deploy/docker-compose.md new file mode 100644 index 00000000..bf441e98 --- /dev/null +++ b/docs/en/deploy/docker-compose.md @@ -0,0 +1,86 @@ +# Deploy with Docker Compose + +A one-click deployment method for **AutoBangumi** using a `docker-compose.yml` file. + +## Install Docker Compose + +Docker Compose usually comes bundled with Docker. Check with: + +```bash +docker compose -v +``` + +If not installed, install it with: + +```bash +$ sudo apt-get update +$ sudo apt-get install docker-compose-plugin +``` + +## Deploy **AutoBangumi** + +### Create AutoBangumi and Data Directories + +```bash +mkdir -p ${HOME}/AutoBangumi/{config,data} +cd ${HOME}/AutoBangumi +``` + +### Option 1: Custom Docker Compose Configuration + +```yaml +version: "3.8" + +services: + AutoBangumi: + image: "ghcr.io/estrellaxd/auto_bangumi:latest" + container_name: AutoBangumi + volumes: + - ./config:/app/config + - ./data:/app/data + ports: + - "7892:7892" + restart: unless-stopped + dns: + - 8.8.8.8 + network_mode: bridge + environment: + - TZ=Asia/Shanghai + - PGID=$(id -g) + - PUID=$(id -u) + - UMASK=022 +``` + +Copy the above content into a `docker-compose.yml` file. + +### Option 2: Download Docker Compose Configuration File + +If you don't want to create the `docker-compose.yml` file manually, the project provides pre-made configurations: + +- Install **AutoBangumi** only: + ```bash + wget https://raw.githubusercontent.com/EstrellaXD/Auto_Bangumi/main/docs/resource/docker-compose/AutoBangumi/docker-compose.yml + ``` +- Install **qBittorrent** and **AutoBangumi**: + ```bash + wget https://raw.githubusercontent.com/EstrellaXD/Auto_Bangumi/main/docs/resource/docker-compose/qBittorrent+AutoBangumi/docker-compose.yml + ``` + +Choose your installation method and run the command to download the `docker-compose.yml` file. You can customize parameters with a text editor if needed. + +### Define Environment Variables + +If you're using the downloaded AB+QB Docker Compose file, you need to define the following environment variables: + +```shell +export \ +QB_PORT= +``` + +- `QB_PORT`: Enter your existing qBittorrent port or your desired custom port, e.g., `8080` + +### Start Docker Compose + +```bash +docker compose up -d +``` diff --git a/docs/en/deploy/dsm.md b/docs/en/deploy/dsm.md new file mode 100644 index 00000000..38196cc3 --- /dev/null +++ b/docs/en/deploy/dsm.md @@ -0,0 +1,121 @@ +# Synology NAS (DSM 7.2) Deployment (QNAP Similar) + +DSM 7.2 supports Docker Compose, so we recommend using Docker Compose for one-click deployment. + +## Create Configuration and Data Directories + +Create an `AutoBangumi` folder under `/volume1/docker/`, then create `config` and `data` subfolders inside it. + +## Install Container Manager (Docker) Package + +Open Package Center and install the Container Manager (Docker) package. + +![install-docker](/image/dsm/install-docker.png){data-zoomable} + +## Install AB via Docker Compose + +Click **Project**, then click **Create**, and select **Docker Compose**. + +![new-compose](/image/dsm/new-compose.png){data-zoomable} + +Copy and paste the following content into **Docker Compose**: +```yaml +version: "3.4" + +services: + ab: + image: "ghcr.io/estrellaxd/auto_bangumi:latest" + container_name: "auto_bangumi" + restart: unless-stopped + ports: + - "7892:7892" + volumes: + - "./config:/app/config" + - "./data:/app/data" + network_mode: bridge + environment: + - TZ=Asia/Shanghai + - AB_METHOD=Advance + - PGID=1000 + - PUID=1000 + - UMASK=022 +``` + +Click **Next**, then click **Done**. + +![create](/image/dsm/create.png){data-zoomable} + +After creation, access `http://:7892` to enter AB and configure it. + +## Install AB and qBittorrent via Docker Compose + +When you have both a proxy and IPv6, configuring IPv6 in Docker on Synology NAS can be complex. We recommend installing both AB and qBittorrent on the host network to reduce complexity. + +The following configuration assumes you have a Clash proxy deployed in Docker that is accessible via a local IP at a specified port. + +Following the previous section, adjust and paste the following content into **Docker Compose**: + +```yaml + qbittorrent: + container_name: qbittorrent + image: linuxserver/qbittorrent + hostname: qbittorrent + environment: + - PGID=1000 # Modify as needed + - PUID=1000 # Modify as needed + - WEBUI_PORT=8989 + - TZ=Asia/Shanghai + volumes: + - ./qb_config:/config + - your_anime_path:/downloads # Change this to your anime storage directory. Set download path in AB as /downloads + networks: + - host + restart: unless-stopped + + auto_bangumi: + container_name: AutoBangumi + environment: + - TZ=Asia/Shanghai + - PGID=1000 # Modify as needed + - PUID=1000 # Modify as needed + - UMASK=022 + - AB_DOWNLOADER_HOST=127.0.0.1:8989 # Modify port as needed + volumes: + - /volume1/docker/ab/config:/app/config + - /volume1/docker/ab/data:/app/data + network_mode: host + environment: + - AB_METHOD=Advance + dns: + - 8.8.8.8 + restart: unless-stopped + image: "ghcr.io/estrellaxd/auto_bangumi:latest" + depends_on: + - qbittorrent + +``` + +## Additional Notes + +The PGID and PUID values need to be determined for your system. For newer Synology NAS devices, they are typically: `PUID=1026, PGID=100`. When modifying the qBittorrent port, make sure to update it in all locations. + +For proxy setup, refer to: [Proxy Settings](../config/proxy) + +On lower-performance machines, the default configuration may heavily use the CPU, causing AB to fail connecting to qB and the qB WebUI to become inaccessible. + +For devices like the 220+, recommended qBittorrent settings to reduce CPU usage: + +- Settings -> Connections -> Connection Limits + - Global maximum number of connections: 300 + - Maximum number of connections per torrent: 60 + - Global upload slots limit: 15 + - Upload slots per torrent: 4 +- BitTorrent + - Maximum active checking torrents: 1 + - Torrent Queueing + - Maximum active downloads: 3 + - Maximum active uploads: 5 + - Maximum active torrents: 10 +- RSS + - RSS Reader + - Maximum number of articles per feed: 50 diff --git a/docs/en/deploy/local.md b/docs/en/deploy/local.md new file mode 100644 index 00000000..36ed4371 --- /dev/null +++ b/docs/en/deploy/local.md @@ -0,0 +1,59 @@ +# Local Deployment + +::: warning +Local deployment may cause unexpected issues. We strongly recommend using Docker instead. + +This documentation may have update delays. If you have questions, please raise them in [Issues](https://github.com/EstrellaXD/Auto_Bangumi/issues). +::: + +## Download the Latest Release + +```bash +VERSION=$(curl -s "https://api.github.com/repos/EstrellaXD/Auto_Bangumi/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +curl -L -O "https://github.com/EstrellaXD/Auto_Bangumi/releases/download/$VERSION/app-v$VERSION.zip" +``` + +## Extract the Archive + +On Unix/WSL systems, use the following command. On Windows, extract manually. + +```bash +unzip app-v$VERSION.zip -d AutoBangumi +cd AutoBangumi +``` + + +## Create Virtual Environment and Install Dependencies + +Ensure you have Python 3.10+ and pip installed locally. + +```bash +cd src +python3 -m venv env +python3 pip install -r requirements.txt +``` + +## Create Configuration and Data Directories + +```bash +mkdir config +mkdir data +``` + +## Run AutoBangumi + +```bash +python3 main.py +``` + + +## Windows Auto-Start on Boot + +You can use `nssm` for auto-start on boot. Example with `nssm`: + +```powershell +nssm install AutoBangumi (Get-Command python).Source +nssm set AutoBangumi AppParameters (Get-Item .\main.py).FullName +nssm set AutoBangumi AppDirectory (Get-Item ..).FullName +nssm set AutoBangumi Start SERVICE_DELAYED_AUTO_START +``` diff --git a/docs/en/deploy/quick-start.md b/docs/en/deploy/quick-start.md new file mode 100644 index 00000000..ce41026a --- /dev/null +++ b/docs/en/deploy/quick-start.md @@ -0,0 +1,131 @@ +# Quick Start + +We recommend deploying AutoBangumi in Docker. +Before deployment, make sure you have [Docker Engine][docker-engine] or [Docker Desktop][docker-desktop] installed. + +## Create Data and Configuration Directories + +To ensure AB's data and configuration persist across updates, we recommend using bind mounts or Docker volumes. + +```shell +# Using bind mount +mkdir -p ${HOME}/AutoBangumi/{config,data} +cd ${HOME}/AutoBangumi +``` + +Choose either bind mount or Docker volume: + +```shell +# Using Docker volume +docker volume create AutoBangumi_config +docker volume create AutoBangumi_data +``` + +## Deploy AutoBangumi with Docker + +Make sure you are in the AutoBangumi directory when running these commands. + +### Option 1: Deploy with Docker CLI + +Copy and run the following command: + +```shell +docker run -d \ + --name=AutoBangumi \ + -v ${HOME}/AutoBangumi/config:/app/config \ + -v ${HOME}/AutoBangumi/data:/app/data \ + -p 7892:7892 \ + -e TZ=Asia/Shanghai \ + -e PUID=$(id -u) \ + -e PGID=$(id -g) \ + -e UMASK=022 \ + --network=bridge \ + --dns=8.8.8.8 \ + --restart unless-stopped \ + ghcr.io/estrellaxd/auto_bangumi:latest +``` + +### Option 2: Deploy with Docker Compose + +Copy the following content into a `docker-compose.yml` file: + +```yaml +version: "3.8" + +services: + AutoBangumi: + image: "ghcr.io/estrellaxd/auto_bangumi:latest" + container_name: AutoBangumi + volumes: + - ./config:/app/config + - ./data:/app/data + ports: + - "7892:7892" + network_mode: bridge + restart: unless-stopped + dns: + - 8.8.8.8 + environment: + - TZ=Asia/Shanghai + - PGID=$(id -g) + - PUID=$(id -u) + - UMASK=022 +``` + +Run the following command to start the container: + +```shell +docker compose up -d +``` + +## Install qBittorrent + +If you haven't installed qBittorrent, please install it first: + +- [Install qBittorrent in Docker][qbittorrent-docker] +- [Install qBittorrent on Windows/macOS][qbittorrent-desktop] +- [Install qBittorrent-nox on Linux][qbittorrent-nox] + +## Get an Aggregated RSS Link (Using Mikan Project as an Example) + +Visit [Mikan Project][mikan-project], register an account and log in, then click the **RSS** button in the bottom right corner and copy the link. + +![mikan-rss](/image/rss/rss-token.png){data-zoomable} + +The RSS URL will look like: + +```txt +https://mikanani.me/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +# or +https://mikanime.tv/RSS/MyBangumi?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +``` + +For detailed steps, see [Mikan RSS Setup][config-rss]. + + +## Configure AutoBangumi + +After installing AB, the WebUI will start automatically, but the main program will be paused. You can access `http://abhost:7892` to configure it. + +1. Open the webpage. The default username is `admin` and the default password is `adminadmin`. Change these immediately after first login. +2. Enter your downloader's address, port, username, and password. + +![ab-webui](/image/config/downloader.png){width=500}{class=ab-shadow-card} + +3. Click **Apply** to save the configuration. AB will restart, and when the dot in the upper right corner turns green, it indicates AB is running normally. + +4. Click the **+** button in the upper right corner, check **Aggregated RSS**, select the parser type, and enter your Mikan RSS URL. + +![ab-rss](/image/config/add-rss.png){width=500}{class=ab-shadow-card} + +Wait for AB to parse the aggregated RSS. Once parsing is complete, it will automatically add anime and manage downloads. + + + +[docker-engine]: https://docs.docker.com/engine/install/ +[docker-desktop]: https://www.docker.com/products/docker-desktop +[config-rss]: ../config/rss +[mikan-project]: https://mikanani.me/ +[qbittorrent-docker]: https://hub.docker.com/r/superng6/qbittorrent +[qbittorrent-desktop]: https://www.qbittorrent.org/download +[qbittorrent-nox]: https://www.qbittorrent.org/download-nox diff --git a/docs/en/dev/database.md b/docs/en/dev/database.md new file mode 100644 index 00000000..5720218f --- /dev/null +++ b/docs/en/dev/database.md @@ -0,0 +1,394 @@ +# Database Developer Guide + +This guide covers the database architecture, models, and operations in AutoBangumi. + +## Overview + +AutoBangumi uses **SQLite** as its database with **SQLModel** (Pydantic + SQLAlchemy hybrid) for ORM. The database file is located at `data/data.db`. + +### Architecture + +``` +module/database/ +├── engine.py # SQLAlchemy engine configuration +├── combine.py # Database class, migrations, session management +├── bangumi.py # Bangumi (anime subscription) operations +├── rss.py # RSS feed operations +├── torrent.py # Torrent tracking operations +└── user.py # User authentication operations +``` + +## Core Components + +### Database Class + +The `Database` class in `combine.py` is the main entry point. It inherits from SQLModel's `Session` and provides access to all sub-databases: + +```python +from module.database import Database + +with Database() as db: + # Access sub-databases + bangumis = db.bangumi.search_all() + rss_items = db.rss.search_active() + torrents = db.torrent.search_all() +``` + +### Sub-Database Classes + +| Class | Model | Purpose | +|-------|-------|---------| +| `BangumiDatabase` | `Bangumi` | Anime subscription rules | +| `RSSDatabase` | `RSSItem` | RSS feed sources | +| `TorrentDatabase` | `Torrent` | Downloaded torrent tracking | +| `UserDatabase` | `User` | Authentication | + +## Models + +### Bangumi Model + +Core model for anime subscriptions: + +```python +class Bangumi(SQLModel, table=True): + id: int # Primary key + official_title: str # Display name (e.g., "Mushoku Tensei") + title_raw: str # Raw title for torrent matching (indexed) + season: int = 1 # Season number + episode_offset: int = 0 # Episode numbering adjustment + season_offset: int = 0 # Season numbering adjustment + rss_link: str # Comma-separated RSS feed URLs + filter: str # Exclusion filter (e.g., "720,\\d+-\\d+") + poster_link: str # TMDB poster URL + save_path: str # Download destination path + rule_name: str # qBittorrent RSS rule name + added: bool = False # Whether rule is added to downloader + deleted: bool = False # Soft delete flag (indexed) + archived: bool = False # For completed series (indexed) + needs_review: bool = False # Offset mismatch detected + needs_review_reason: str # Reason for review + suggested_season_offset: int # Suggested season offset + suggested_episode_offset: int # Suggested episode offset + air_weekday: int # Airing day (0=Sunday, 6=Saturday) +``` + +### RSSItem Model + +RSS feed subscriptions: + +```python +class RSSItem(SQLModel, table=True): + id: int # Primary key + name: str # Display name + url: str # Feed URL (unique, indexed) + aggregate: bool = True # Whether to parse torrents + parser: str = "mikan" # Parser type: mikan, dmhy, nyaa + enabled: bool = True # Active flag + connection_status: str # "healthy" or "error" + last_checked_at: str # ISO timestamp + last_error: str # Last error message +``` + +### Torrent Model + +Tracks downloaded torrents: + +```python +class Torrent(SQLModel, table=True): + id: int # Primary key + name: str # Torrent name (indexed) + url: str # Torrent/magnet URL (unique, indexed) + rss_id: int # Source RSS feed ID + bangumi_id: int # Linked Bangumi ID (nullable) + qb_hash: str # qBittorrent info hash (indexed) + downloaded: bool = False # Download completed +``` + +## Common Operations + +### BangumiDatabase + +```python +with Database() as db: + # Create + db.bangumi.add(bangumi) # Single insert + db.bangumi.add_all(bangumi_list) # Batch insert (deduplicates) + + # Read + db.bangumi.search_all() # All records (cached, 5min TTL) + db.bangumi.search_id(123) # By ID + db.bangumi.match_torrent("torrent name") # Find by title_raw match + db.bangumi.not_complete() # Incomplete series + db.bangumi.get_needs_review() # Flagged for review + + # Update + db.bangumi.update(bangumi) # Update single record + db.bangumi.update_all(bangumi_list) # Batch update + + # Delete + db.bangumi.delete_one(123) # Hard delete + db.bangumi.disable_rule(123) # Soft delete (deleted=True) +``` + +### RSSDatabase + +```python +with Database() as db: + # Create + db.rss.add(rss_item) # Single insert + db.rss.add_all(rss_items) # Batch insert (deduplicates) + + # Read + db.rss.search_all() # All feeds + db.rss.search_active() # Enabled feeds only + db.rss.search_aggregate() # Enabled + aggregate=True + + # Update + db.rss.update(id, rss_update) # Partial update + db.rss.enable(id) # Enable feed + db.rss.disable(id) # Disable feed + db.rss.enable_batch([1, 2, 3]) # Batch enable + db.rss.disable_batch([1, 2, 3]) # Batch disable +``` + +### TorrentDatabase + +```python +with Database() as db: + # Create + db.torrent.add(torrent) # Single insert + db.torrent.add_all(torrents) # Batch insert + + # Read + db.torrent.search_all() # All torrents + db.torrent.search_by_qb_hash(hash) # By qBittorrent hash + db.torrent.search_by_url(url) # By URL + db.torrent.check_new(torrents) # Filter out existing + + # Update + db.torrent.update_qb_hash(id, hash) # Set qb_hash +``` + +## Caching + +### Bangumi Cache + +`search_all()` results are cached at the module level with a 5-minute TTL: + +```python +# Module-level cache in bangumi.py +_bangumi_cache: list[Bangumi] | None = None +_bangumi_cache_time: float = 0 +_BANGUMI_CACHE_TTL: float = 300.0 # 5 minutes + +# Cache invalidation +def _invalidate_bangumi_cache(): + global _bangumi_cache, _bangumi_cache_time + _bangumi_cache = None + _bangumi_cache_time = 0 +``` + +**Important:** The cache is automatically invalidated on: +- `add()`, `add_all()` +- `update()`, `update_all()` +- `delete_one()`, `delete_all()` +- `archive_one()`, `unarchive_one()` +- Any RSS link update operations + +### Session Expunge + +Cached objects are **expunged** from the session to prevent `DetachedInstanceError`: + +```python +for b in bangumis: + self.session.expunge(b) # Detach from session +``` + +## Migration System + +### Schema Versioning + +Migrations are tracked via a `schema_version` table: + +```python +CURRENT_SCHEMA_VERSION = 7 + +# Each migration: (version, description, [SQL statements]) +MIGRATIONS = [ + (1, "add air_weekday column", [...]), + (2, "add connection status columns", [...]), + (3, "create passkey table", [...]), + (4, "add archived column", [...]), + (5, "rename offset to episode_offset", [...]), + (6, "add qb_hash column", [...]), + (7, "add suggested offset columns", [...]), +] +``` + +### Adding a New Migration + +1. Increment `CURRENT_SCHEMA_VERSION` in `combine.py` +2. Add migration tuple to `MIGRATIONS` list: + +```python +MIGRATIONS = [ + # ... existing migrations ... + ( + 8, + "add my_new_column to bangumi", + [ + "ALTER TABLE bangumi ADD COLUMN my_new_column TEXT DEFAULT NULL", + ], + ), +] +``` + +3. Add idempotency check in `run_migrations()`: + +```python +if "bangumi" in tables and version == 8: + columns = [col["name"] for col in inspector.get_columns("bangumi")] + if "my_new_column" in columns: + needs_run = False +``` + +4. Update the corresponding Pydantic model in `module/models/` + +### Default Value Backfill + +After migrations, `_fill_null_with_defaults()` automatically fills NULL values based on model defaults: + +```python +# If model defines: +class Bangumi(SQLModel, table=True): + my_field: bool = False + +# Then existing rows with NULL will be updated to False +``` + +## Performance Patterns + +### Batch Queries + +`add_all()` uses a single query to check for duplicates instead of N queries: + +```python +# Efficient: single SELECT +keys_to_check = [(d.title_raw, d.group_name) for d in datas] +conditions = [ + and_(Bangumi.title_raw == tr, Bangumi.group_name == gn) + for tr, gn in keys_to_check +] +statement = select(Bangumi.title_raw, Bangumi.group_name).where(or_(*conditions)) +``` + +### Regex Matching + +`match_list()` compiles a single regex pattern for all title matches: + +```python +# Compile once, match many +sorted_titles = sorted(title_index.keys(), key=len, reverse=True) +pattern = "|".join(re.escape(title) for title in sorted_titles) +title_regex = re.compile(pattern) + +# O(1) lookup per torrent instead of O(n) +for torrent in torrent_list: + match = title_regex.search(torrent.name) +``` + +### Indexed Columns + +The following columns have indexes for fast lookups: + +| Table | Column | Index Type | +|-------|--------|------------| +| `bangumi` | `title_raw` | Regular | +| `bangumi` | `deleted` | Regular | +| `bangumi` | `archived` | Regular | +| `rssitem` | `url` | Unique | +| `torrent` | `name` | Regular | +| `torrent` | `url` | Unique | +| `torrent` | `qb_hash` | Regular | + +## Testing + +### Test Database Setup + +Tests use an in-memory SQLite database: + +```python +# conftest.py +@pytest.fixture +def db_engine(): + engine = create_engine("sqlite:///:memory:") + SQLModel.metadata.create_all(engine) + yield engine + engine.dispose() + +@pytest.fixture +def db_session(db_engine): + with Session(db_engine) as session: + yield session +``` + +### Factory Functions + +Use factory functions for creating test data: + +```python +from test.factories import make_bangumi, make_torrent, make_rss_item + +def test_bangumi_search(): + bangumi = make_bangumi(title_raw="Test Title", season=2) + # ... test logic +``` + +## Design Notes + +### No Foreign Keys + +SQLite foreign key enforcement is disabled by default. Relationships (like `Torrent.bangumi_id`) are managed in application logic rather than database constraints. + +### Soft Deletes + +The `Bangumi.deleted` flag enables soft deletes. Queries should filter by `deleted=False` for user-facing data: + +```python +statement = select(Bangumi).where(Bangumi.deleted == false()) +``` + +### Torrent Tagging + +Torrents are tagged in qBittorrent with `ab:{bangumi_id}` for offset lookup during rename operations. This enables fast bangumi identification without database queries. + +## Common Issues + +### DetachedInstanceError + +If you access cached objects from a different session: + +```python +# Wrong: accessing cached object in new session +bangumis = db.bangumi.search_all() # Cached +with Database() as new_db: + new_db.session.add(bangumis[0]) # Error! + +# Right: objects are expunged, work independently +bangumis = db.bangumi.search_all() +bangumis[0].title_raw = "New Title" # OK, but won't persist +``` + +### Cache Staleness + +If manual SQL updates bypass the ORM, invalidate the cache: + +```python +from module.database.bangumi import _invalidate_bangumi_cache + +with engine.connect() as conn: + conn.execute(text("UPDATE bangumi SET ...")) + conn.commit() + +_invalidate_bangumi_cache() # Important! +``` diff --git a/docs/en/dev/index.md b/docs/en/dev/index.md new file mode 100644 index 00000000..020f99db --- /dev/null +++ b/docs/en/dev/index.md @@ -0,0 +1,135 @@ +# Contributing Guide + +We welcome contributors to help make AutoBangumi better at solving issues encountered by users. + +This guide will walk you through how to contribute code to AutoBangumi. Please take a few minutes to read through before submitting a Pull Request. + +This article covers: + +- [Project Roadmap](#project-roadmap) + - [Request for Comments (RFC)](#request-for-comments-rfc) +- [Git Branch Management](#git-branch-management) + - [Version Numbering](#version-numbering) + - [Branch Development, Trunk Release](#branch-development-trunk-release) + - [Branch Lifecycle](#branch-lifecycle) + - [Git Workflow Overview](#git-workflow-overview) +- [Pull Request](#pull-request) +- [Release Process](#release-process) + + +## Project Roadmap + +The AutoBangumi development team uses [GitHub Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) boards to manage planned development, ongoing fixes, and their progress. + +This helps you understand: +- What the development team is working on +- What aligns with your intended contribution, so you can participate directly +- What's already in progress, to avoid duplicate work + +In [Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen), beyond the usual `[Feature Request]`, `[BUG]`, and small improvements, you'll find **`[RFC]`** items. + +### Request for Comments (RFC) + +> Find existing [AutoBangumi RFCs](https://github.com/EstrellaXD/Auto_Bangumi/issues?q=is%3Aissue+label%3ARFC) via the `RFC` label in issues. + +For small improvements or bug fixes, feel free to adjust the code and submit a Pull Request. Just read the [Branch Management](#git-branch-management) section to base your work on the correct branch, and the [Pull Request](#pull-request) section to understand how PRs are merged. + +
+ +For **larger** feature refactors with broad scope, please first write an RFC proposal via [Issue: Feature Proposal](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?assignees=&labels=RFC&projects=&template=rfc.yml&title=%5BRFC%5D%3A+) to briefly describe your approach and seek developer discussion and consensus. + +Some proposals may conflict with decisions the development team has already made, and this step helps avoid wasted effort. + +> If you only want to discuss whether to add or improve a feature (not "how to implement it"), use -> [Issue: Feature Request](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?labels=feature+request&template=feature_request.yml&title=%5BFeature+Request%5D+) + + +
+ +An [RFC Proposal](https://github.com/EstrellaXD/Auto_Bangumi/issues?q=is%3Aissue+is%3Aopen+label%3ARFC) is **"a document for developers to review technical design/approach before concrete development of a feature/refactor"**. + +The purpose is to ensure collaborating developers clearly know "what to do" and "how it will be done", with all developers able to participate in open discussion. + +This helps evaluate impacts (overlooked considerations, backward compatibility, conflicts with existing features). + +Therefore, proposals focus on describing the **approach, design, and steps** for solving the problem. + + +## Git Branch Management + +### Version Numbering + +Git branches in the AutoBangumi project are closely related to release version rules. + +AutoBangumi follows [Semantic Versioning (SemVer)](https://semver.org/) with a `..` format: + +- **Major**: Major version update, likely with incompatible configuration/API changes +- **Minor**: Backward-compatible new functionality +- **Patch**: Backward-compatible bug fixes / minor improvements + +### Branch Development, Trunk Release + +AutoBangumi uses a "branch development, trunk release" model. + +[**`main`**](https://github.com/EstrellaXD/Auto_Bangumi/commits/main) is the stable **trunk branch**, used only for releases, not for direct development. + +Each Minor version has a corresponding **development branch** for new features and post-release maintenance. + +Development branches are named `.-dev`, e.g., `3.1-dev`, `3.0-dev`, `2.6-dev`. Find them in [All Branches](https://github.com/EstrellaXD/Auto_Bangumi/branches/all?query=-dev). + + +### Branch Lifecycle + +When a Minor development branch (e.g., `3.1-dev`) completes feature development and **first** merges into main: +- Release the Minor version (e.g., `3.1.0`) +- Create the **next** Minor development branch (`3.2-dev`) for next version features + - The **previous** version's branch (`3.0-dev`) is archived +- This Minor branch (`3.1-dev`) enters maintenance — no new features/refactors, only bug fixes + - Bug fixes are merged to the maintenance branch, then to main for `Patch` releases + +For contributors choosing Git branches: +- **Bug fixes** — base on the **current released version's** Minor branch, PR to that branch +- **New features/refactors** — base on the **next unreleased version's** Minor branch, PR to that branch + +> "Current released version" is the latest version on the [[Releases page]](https://github.com/EstrellaXD/Auto_Bangumi/releases) + + +### Git Workflow Overview + +> Commit timeline goes from left to right ---> + +![dev-branch](/image/dev/branch.png) + + +## Pull Request + +Ensure you've selected the correct PR target branch per the Git Branch Management section above: +> - **Bug fixes** → PR to the **current released version's** Minor maintenance branch +> - **New features/refactors** → PR to the **next version's** Minor development branch + +
+ +- A PR should correspond to a single concern and not introduce unrelated changes. + + Split different concerns into multiple PRs to help the team focus on one issue per review. + +- In the PR title and description, briefly explain the changes including reasons and intent. + + Link related issues or RFCs in the PR description. + + This helps the team understand context quickly during code review. + +- Ensure "Allow edits from maintainers" is checked. This allows direct minor edits/refactors and saves time. + +- Ensure local tests and linting pass. These are also checked in PR CI. + - For bug fixes and new features, the team may request corresponding unit test coverage. + + +The development team will review contributor PRs and discuss or approve merging as soon as possible. + +## Release Process + +Releases are currently triggered automatically after the development team manually merges a specific "release PR". + +Bug fix PRs are typically released quickly, usually within a week. + +New feature releases take longer and are less predictable. Check the [GitHub Project](https://github.com/EstrellaXD/Auto_Bangumi/projects?query=is%3Aopen) board for development progress — a version is released when all planned features are complete. diff --git a/docs/en/faq/index.md b/docs/en/faq/index.md new file mode 100644 index 00000000..887172c3 --- /dev/null +++ b/docs/en/faq/index.md @@ -0,0 +1,159 @@ +# Frequently Asked Questions + +## WebUI + +### WebUI Address + +The default port is 7892. For server deployments, access `http://serverhost:7892`. For local deployments, access `http://localhost:7892`. If you changed the port, remember to also update the Docker port mapping. + +### Default Username and Password + +- Default username: `admin`, default password: `adminadmin`. +- Please change your password after first login. + +### Changing or Resetting Password + +- Change password: After logging in, click `···` in the upper right, click `Profile`, and modify your username and password. +- There is currently no simple password reset method. If you forget your password, delete the `data/data.db` file and restart. + +### Why don't my configuration changes take effect? + +- After changing configuration, click the **Apply** button, then click **Restart** in the `···` menu to restart the main process. +- If Debug mode is enabled, click **Shutdown** in the `···` menu to restart the container. + +### How to check if the program is running normally + +The new WebUI has a small dot in the upper right corner. Green means running normally, red means an error occurred and the program is paused. + +### Poster wall not showing images + +- If your version is 3.0: + AB uses `mikanani.me` addresses as poster image sources by default. If images aren't showing, your network cannot access these images. +- If your version is 3.1 or later: + - If posters show an error icon, the images are missing. Click the refresh poster button in the upper right menu to fetch TMDB posters. + - If posters fail to load, clear your browser cache. + - When using `mikanime.tv` as the RSS address, client-side proxies may prevent poster loading. Add a `direct` rule for it. + +## How Does v3.0 Manage Bangumi + +After upgrading to v3.0, AB can manage anime torrents and download rules in the WebUI. It relies on the torrent download path and rule name. +If you manually change torrent download paths in QB, you may encounter issues like notifications missing posters or failed torrent deletion. +Please manage anime and torrents within AB as much as possible. + +## Downloads and Keyword Filtering + +### Download Path + +**What should I put for the download path?** +- This parameter just needs to match your qBittorrent configuration: + - Docker: If qB uses `/downloads`, then set `/downloads/Bangumi`. You can change `Bangumi` to anything. + - Linux/macOS: If it's `/home/usr/downloads` or `/User/UserName/Downloads`, just append `/Bangumi` at the end. + - Windows: Change `D:\Media\` to `D:\Media\Bangumi` + +### Downloads not starting automatically + +Check AutoBangumi's logs for any torrent-related entries. +- If none exist, check if your subscription is correct. + +### Downloads not saved in the correct directory + +- Check if the [download path](#download-path) is correct. +- Check qBittorrent's PGID and PUID configuration for folder creation permissions. Try manually downloading any torrent to a specified directory — if errors occur or the directory isn't created, it's a permissions issue. +- Check qBittorrent's default settings: Saving Management should be set to Manual (Saving Management >> Default Torrent Management Mode >> Manual). + +### Downloading many unsubscribed anime + +- Check if your Mikan subscription includes all subtitle groups for a single anime. Subscribe to only one group per anime, and enable advanced subscriptions. + - Advanced subscriptions can be enabled in Mikan Project's user settings. +- Regex filtering may be insufficient — see the next section for expanding regex. +- If neither applies, report with logs at [Issues][ISSUE]. + +### How to write filter keywords + +Filter keywords in AB are regular expressions, added only when rules are created. To expand rules after creation, use the WebUI (v3.0+) to configure each anime individually. +- Filter keywords are regex — separate unwanted keywords with `|`. +- The default `720|\d+-\d+` rule filters out all collections and 720P anime. Add filters before deploying AB; subsequent environment variable changes only affect new rules. +- Common regex keywords (separated by `|`): + - `720` — filters 720, 720P, 720p, etc. + - `\d+-\d+` — filters collections like [1-12] + - `[Bb]aha` — filters Baha releases + - `[Bb]ilibili`, `[Bb]-Global` — filters Bilibili releases + - `繁`, `CHT` — filters Traditional Chinese subtitles +- To match specific keywords, add in QB's include field: `XXXXX+1080P\+` where `1080P\+` matches 1080P+ releases. + +### First deployment downloaded unwanted anime + +1. Delete extra automatic download rules and files in QB. +2. Check subscriptions and filter rules. +3. Visit the resetRule API in your browser: `http://localhost:7892/api/v1/resetRule` to reset rules. +4. Restart AB. + +### AB identifies fewer RSS entries than subscribed + +In newer versions, AB's filter also filters all RSS entries by default. Don't add all filters at once. For fine-grained control, configure each anime individually in the WebUI. + +### Filter keywords not working + +- Check if the **global filter** parameter is set correctly. +- Check QB's RSS auto-download rules — you can see matched RSS on the right side, adjust download rules, and click save to identify which keyword is causing issues. + +## Episode Completion + +### Episode completion not working + +Check if the **Episode completion** parameter is correctly configured. + +## File Renaming + +### Parse error `Cannot parse XXX` + +- AB does not currently support parsing collections. +- If it's not a collection, report the issue on GitHub Issues. + +### `Rename failed` or renaming errors + +- Check file paths. Standard storage path should be `/title/Season/Episode.mp4`. Non-standard paths cause naming errors — check your qBittorrent configuration. +- Check if the `download path` is filled in correctly. Incorrect paths prevent proper renaming. +- For other issues, report on GitHub Issues. + +### No automatic renaming + +- Check if the torrent category in QB is `Bangumi`. +- AB only renames downloaded files. + +### How to rename non-AB anime with AB + +- Simply change the torrent's category to `Bangumi`. +- Note: The torrent must be stored in a `Title/Season X/` folder to trigger renaming. + +### How to rename collections + +1. Change the collection's category to `Bangumi`. +2. Change the collection's storage path to `Title/Season X/`. +3. Wait for the collection to finish downloading, and renaming will complete. + +## Docker + +### How to auto-update + +Run a `watchtower` daemon in Docker to automatically update your containers. + +[watchtower](https://containrrr.dev/watchtower) official documentation + +### Updating with Docker Compose + +If your AB is deployed with Docker Compose, use `docker compose pull` to update. +After pulling the new image, use `docker compose up -d` to restart. + +You can also add `pull_policy: always` to your `docker-compose.yml` to pull the latest image on every start. + +### What to do if an upgrade causes issues + +Since configurations may vary, upgrades might cause the program to fail. In this case, delete all previous data and generated configuration files, then restart the container. +Then reconfigure in the WebUI. +If upgrading from an older version, first refer to the [upgrade guide](/changelog/2.6). + +If you encounter issues not covered above, report them at [Issues][ISSUE] using the bug template. + + +[ISSUE]: https://github.com/EstrellaXD/Auto_Bangumi/issues diff --git a/docs/en/faq/network.md b/docs/en/faq/network.md new file mode 100644 index 00000000..eecf05c6 --- /dev/null +++ b/docs/en/faq/network.md @@ -0,0 +1,97 @@ +# Network Issues + +## Cannot Connect to Mikan Project + +Since the main Mikan Project site (`https://mikanani.me`) may be blocked in some regions, AB may fail to connect. Use the following solutions: + +- [Use Mikan Project alternative domain](#mikan-project-alternative-domain) +- [Use a proxy](#configuring-a-proxy) +- [Use a Cloudflare Worker reverse proxy](#cloudflare-workers-reverse-proxy) + +### Mikan Project Alternative Domain + +Mikan Project has a new domain `https://mikanime.tv`. Use this domain with AB without enabling a proxy. + +If you see: +``` +DNS/Connect ERROR +``` + +- Check your network connection. If it's fine, check DNS resolution. +- Add `dns=8.8.8.8` to AB. If using Host network mode, this can be ignored. + +If you're using a proxy, this error typically won't occur with correct configuration. + +### Configuring a Proxy + +::: tip +In AB 3.1+, AB handles RSS updates and notifications itself, so you only need to configure the proxy in AB. +::: + +AB has built-in proxy configuration. To configure a proxy, follow the instructions in [Proxy Settings](../config/proxy) to set up HTTP or SOCKS proxy correctly. This resolves access issues. + +**For versions before 3.1, qBittorrent proxy configuration is also needed** + +Configure the proxy in QB as shown below (same approach for SOCKS): + +image + + +### Cloudflare Workers Reverse Proxy + +You can also use a reverse proxy approach via Cloudflare Workers. Setting up a domain and binding it to Cloudflare is beyond the scope of this guide. +Add the following code in Workers to use your own domain to access Mikan Project and download torrents from RSS links: + +```javascript +const TELEGRAPH_URL = 'https://mikanani.me'; +const MY_DOMAIN = 'https://yourdomain.com' + +addEventListener('fetch', event => { + event.respondWith(handleRequest(event.request)) +}) + +async function handleRequest(request) { + const url = new URL(request.url); + url.host = TELEGRAPH_URL.replace(/^https?:\/\//, ''); + + const modifiedRequest = new Request(url.toString(), { + headers: request.headers, + method: request.method, + body: request.body, + redirect: 'manual' + }); + + const response = await fetch(modifiedRequest); + const contentType = response.headers.get('Content-Type') || ''; + + // Only perform replacement if content type is RSS + if (contentType.includes('application/xml')) { + const text = await response.text(); + const replacedText = text.replace(/https?:\/\/mikanani\.me/g, MY_DOMAIN); + const modifiedResponse = new Response(replacedText, response); + + // Add CORS headers + modifiedResponse.headers.set('Access-Control-Allow-Origin', '*'); + + return modifiedResponse; + } else { + const modifiedResponse = new Response(response.body, response); + + // Add CORS headers + modifiedResponse.headers.set('Access-Control-Allow-Origin', '*'); + + return modifiedResponse; + } +} +``` + +After completing the configuration, replace `https://mikanani.me` with your domain when **adding RSS**. + +## Cannot Connect to qBittorrent + +First, check if the **downloader address** parameter in AB is correct. +- If AB and QB are on the same Docker network, try using the container name for addressing, e.g., `http://qbittorrent:8080`. +- If AB and QB are on the same Docker server, try using the Docker gateway address, e.g., `http://172.17.0.1:8080`. +- If AB's network mode is not `host`, do not use `127.0.0.1` to access QB. + +If containers in Docker cannot access each other, set up a network link between QB and AB in QB's network connection settings. If qBittorrent uses HTTPS, add the `https://` prefix to the **downloader address**. diff --git a/docs/en/faq/troubleshooting.md b/docs/en/faq/troubleshooting.md new file mode 100644 index 00000000..74bab6ce --- /dev/null +++ b/docs/en/faq/troubleshooting.md @@ -0,0 +1,39 @@ +--- +title: Troubleshooting +--- + +## General Troubleshooting Flow + +1. If AB fails to start, check if the startup command is correct. If incorrect and you don't know how to fix it, try redeploying AB. +2. After deploying AB, check the logs first. If you see output like the following, AB is running normally and connected to QB: + ``` + [2022-07-09 21:55:19,164] INFO: _ ____ _ + [2022-07-09 21:55:19,165] INFO: /\ | | | _ \ (_) + [2022-07-09 21:55:19,166] INFO: / \ _ _| |_ ___ | |_) | __ _ _ __ __ _ _ _ _ __ ___ _ + [2022-07-09 21:55:19,167] INFO: / /\ \| | | | __/ _ \| _ < / _` | '_ \ / _` | | | | '_ ` _ \| | + [2022-07-09 21:55:19,167] INFO: / ____ \ |_| | || (_) | |_) | (_| | | | | (_| | |_| | | | | | | | + [2022-07-09 21:55:19,168] INFO: /_/ \_\__,_|\__\___/|____/ \__,_|_| |_|\__, |\__,_|_| |_| |_|_| + [2022-07-09 21:55:19,169] INFO: __/ | + [2022-07-09 21:55:19,169] INFO: |___/ + [2022-07-09 21:55:19,170] INFO: Version 3.0.1 Author: EstrellaXD Twitter: https://twitter.com/Estrella_Pan + [2022-07-09 21:55:19,171] INFO: GitHub: https://github.com/EstrellaXD/Auto_Bangumi/ + [2022-07-09 21:55:19,172] INFO: Starting AutoBangumi... + [2022-07-09 21:55:20,717] INFO: Add RSS Feed successfully. + [2022-07-09 21:55:21,761] INFO: Start collecting RSS info. + [2022-07-09 21:55:23,431] INFO: Finished + [2022-07-09 21:55:23,432] INFO: Running.... + ``` + 1. If you see this log, AB cannot connect to qBittorrent. Check if qBittorrent is running. If it is, go to the [Network Issues](/faq/network) section. + ``` + [2022-07-09 22:01:24,534] WARNING: Cannot connect to qBittorrent, wait 5min and retry + ``` + 2. If you see this log, AB cannot connect to Mikan RSS. Go to the [Network Issues](/faq/network) section. + ``` + [2022-07-09 21:55:21,761] INFO: Start collecting RSS info. + [2022-07-09 22:01:24,534] WARNING: Connected Failed, please check DNS/Connection + ``` +3. At this point, QB should have download tasks. + 1. If downloads show path issues, check QB's "Saving Management" → "Default Torrent Management Mode" is set to "Manual". + 2. If all downloads show exclamation marks or no category folders are created in the download path, check QB's permissions. +4. If none of the above resolves the issue, try redeploying a fresh qBittorrent. +5. If still unsuccessful, report with logs at [Issues](https://www.github.com/EstrellaXD/Auto_Bangumi/issues). diff --git a/docs/en/feature/bangumi.md b/docs/en/feature/bangumi.md new file mode 100644 index 00000000..a0f8b815 --- /dev/null +++ b/docs/en/feature/bangumi.md @@ -0,0 +1,83 @@ +# Bangumi Management + +Click an anime poster on the homepage to manage individual anime entries. + +![Bangumi List](/image/feature/bangumi-list.png) + +If an anime has multiple download rules (e.g., different subtitle groups), a rule selection popup will appear: + +![Rule Selection](/image/feature/rule-select.png) + +After selecting a rule, the edit modal opens: + +![Edit Bangumi](/image/feature/bangumi-edit.png) + +## Notification Badges + +Since v3.2, bangumi cards display iOS-style notification badges to indicate status: + +- **Yellow badge with `!`**: Subscription needs review (e.g., offset issues detected) +- **Number badge**: Multiple rules exist for this anime +- **Combined badge** (e.g., `! | 2`): Has warning and multiple rules + +Cards with warnings also display a yellow glow animation to draw attention. + +## Episode Offset Auto-Detection + +Some anime have complex season structures that cause mismatches between RSS episode numbers and TMDB data. For example: +- "Frieren: Beyond Journey's End" Season 1 was broadcast in two parts with a 6-month gap +- RSS may show "S2E01" while TMDB considers it "S1E29" + +AB v3.2 can automatically detect these issues: + +1. Click the **Auto Detect** button in the edit modal +2. AB analyzes TMDB episode air dates to identify "virtual seasons" +3. If a mismatch is found, AB suggests the correct offset values +4. Click **Apply** to save the offset + +The background scan thread also periodically checks existing subscriptions for offset issues and marks them for review. + +## Archive / Unarchive Anime + +Since v3.2, you can archive completed or inactive anime to keep your list organized. + +### Manual Archive + +1. Click on an anime poster +2. In the edit modal, click the **Archive** button +3. The anime moves to the "Archived" section at the bottom of the list + +### Automatic Archive + +AB can automatically archive anime when: +- The series status on TMDB shows as "Ended" or "Canceled" +- Use **Config** → refresh metadata to trigger auto-archive + +### Viewing Archived Anime + +Archived anime appear in a collapsible "Archived" section at the bottom of the bangumi list. Click to expand and view archived items. + +### Unarchive + +To restore an archived anime: +1. Expand the "Archived" section +2. Click on the anime poster +3. Click the **Unarchive** button + +## Disable / Delete Anime + +Since AB continuously parses **aggregated RSS** feeds, for download rules from aggregated RSS that you no longer need: +- Disable anime: The anime won't be downloaded or re-parsed +- Remove the subscription from the aggregated RSS + +If you delete the anime entry, it will be recreated on the next parse cycle. + +## Advanced Settings + +Click **Advanced Settings** in the edit modal to access additional options: + +![Advanced Settings](/image/feature/bangumi-edit-advanced.png) + +- **Season Offset**: Adjust the season number offset +- **Episode Offset**: Adjust the episode number offset +- **Filter**: Custom regex filter for torrent matching diff --git a/docs/en/feature/calendar.md b/docs/en/feature/calendar.md new file mode 100644 index 00000000..f7e8532c --- /dev/null +++ b/docs/en/feature/calendar.md @@ -0,0 +1,40 @@ +# Calendar View + +Since v3.2, AB includes a calendar view that shows your subscribed anime organized by broadcast day. + +![Calendar](/image/feature/calendar.png) + +## Features + +### Weekly Schedule + +The calendar displays anime organized by their broadcast weekday (Monday through Sunday), plus an "Unknown" column for anime without broadcast schedule data. + +### Bangumi.tv Integration + +AB fetches broadcast schedule data from Bangumi.tv to accurately display when each anime airs. + +Click the **Refresh schedule** button to update the broadcast data. + +### Grouped Display + +Since v3.2, anime with multiple download rules are grouped together: + +- Same anime appears once, even with multiple subtitle group rules +- Click on a grouped anime to see all available rules +- Select a specific rule to edit + +This keeps the calendar clean while still providing access to all your rules. + +## Navigation + +Click on any anime poster in the calendar to: +- View anime details +- Edit download rules +- Access archive/disable options + +## Tips + +::: tip +If an anime appears in the "Unknown" column, it may not have broadcast data on Bangumi.tv, or the anime title couldn't be matched. +::: diff --git a/docs/en/feature/rename.md b/docs/en/feature/rename.md new file mode 100644 index 00000000..cb85840e --- /dev/null +++ b/docs/en/feature/rename.md @@ -0,0 +1,61 @@ +# File Renaming + +AB currently provides three renaming methods: `pn`, `advance`, and `none`. + +### pn + +Short for `pure name`. This method uses the torrent download name for renaming. + +Example: +``` +[Lilith-Raws] 86 - Eighty Six - 01 [Baha][WEB-DL][1080p][AVC AAC][CHT][MKV].mkv +>> +86 - Eighty Six S01E01.mkv +``` + +### advance + +Advanced renaming. This method uses the parent folder name for renaming. + +``` +/downloads/Bangumi/86 - Eighty Six(2023)/Season 1/[Lilith-Raws] 86 - Eighty Six - 01 [Baha][WEB-DL][1080p][AVC AAC][CHT][MKV].mkv +>> +86 - Eighty Six(2023) S01E01.mkv +``` + +### none + +No renaming. Files are left as-is. + +## Collection Renaming + +AB supports renaming collections. Collection renaming requires: +- Episodes are in the collection's first-level directory +- Episode numbers can be parsed from file names + +AB can also rename subtitle files in the first-level directory. + +After renaming, episodes and directories are placed in the `Season` folder. + +Renamed collections are moved and categorized under `BangumiCollection`. + +## Episode Offset + +Since v3.2, AB supports episode offset for renaming. This is useful when: +- RSS shows different episode numbers than expected (e.g., S2E01 should be S1E29) +- Anime has "virtual seasons" due to broadcast gaps + +When an offset is configured for a bangumi, AB automatically applies it during renaming: + +``` +Original: S02E01.mkv +With offset (season: -1, episode: +28): S01E29.mkv +``` + +To configure offset: +1. Click on the anime poster +2. Open Advanced Settings +3. Set Season Offset and/or Episode Offset values +4. Or use "Auto Detect" to let AB suggest the correct offset + +See [Bangumi Management](./bangumi.md#episode-offset-auto-detection) for more details on auto-detection. diff --git a/docs/en/feature/rss.md b/docs/en/feature/rss.md new file mode 100644 index 00000000..0f08754a --- /dev/null +++ b/docs/en/feature/rss.md @@ -0,0 +1,68 @@ +--- +title: RSS Management +--- + +# RSS Management + +## RSS Manager Page + +The RSS Manager page displays all your RSS subscriptions with their connection status. + +![RSS Manager](/image/feature/rss-manager.png) + +### Connection Status + +Since v3.2, AB tracks the connection status of each RSS source: + +| Status | Description | +|--------|-------------| +| **Connected** (green) | RSS source is reachable and returning valid data | +| **Error** (red) | RSS source failed to respond or returned invalid data | + +When a source shows an error, hover over the status label to see the error details in a tooltip. + +AB automatically updates the connection status on each RSS refresh cycle. + +## Adding Collections + +AB provides two manual download methods: +**Collect** and **Subscribe**. +- **Collect** downloads all episodes at once, suitable for completed anime. +- **Subscribe** adds an automatic download rule with the corresponding RSS link, suitable for ongoing anime. + +### Parsing RSS Links + +AB supports parsing collection RSS links from all resource sites. Find the collection RSS for your desired anime on the corresponding site, click the **+** button in the upper right corner of AB, and paste the RSS link in the popup window. + +### Adding Downloads + +If parsing succeeds, a window will appear showing the parsed anime information. Click **Collect** or **Subscribe** to add it to the download queue. + +### Common Issues + +If a parsing error occurs, it may be due to an incorrect RSS link or an unsupported subtitle group naming format. + +## Managing Bangumi + +Since v3.0, AB provides manual anime management in the WebUI, allowing you to manually adjust incorrectly parsed anime information. + +### Editing Anime Information + +In the anime list, click the anime poster to enter the anime information page. +After modifying the information, click **Apply**. +AB will readjust the directory and automatically rename files based on your changes. + + +### Deleting Anime + +Since v3.0, you can manually delete anime. Click the anime poster, enter the information page, and click **Delete**. + +::: warning +After deleting anime, if the RSS subscription hasn't been cancelled, AB will still re-parse it. To disable the download rule, use [Disable Anime](#disabling-anime). +::: + +### Disabling Anime + +Since v3.0, you can manually disable anime. Click the anime poster, enter the information page, and click **Disable**. + +Once disabled, the anime poster will be grayed out and sorted to the end. To re-enable the download rule, click **Enable**. diff --git a/docs/en/feature/search.md b/docs/en/feature/search.md new file mode 100644 index 00000000..789d1a67 --- /dev/null +++ b/docs/en/feature/search.md @@ -0,0 +1,69 @@ +# Torrent Search + +Since v3.1, AB includes a search feature for quickly finding anime. + +## Using the Search Feature + +::: warning +The search feature relies on the main program's parser. The current version does not support parsing collections. A `warning` when parsing collections is normal behavior. +::: + +The search bar is located in the AB top bar. Click to open the search panel. + +![Search Panel](/image/feature/search-panel.png) + +Select the source site, enter keywords, and AB will automatically parse and display search results. To add an anime, click the add button on the right side of the card. + +::: tip +When the source is **Mikan**, AB uses the `mikan` parser by default. For other sources, the TMDB parser is used. +::: + +## Managing Search Sources + +Since v3.2, you can manage search sources directly in the Settings page without editing JSON files. + +### Search Provider Settings Panel + +Navigate to **Config** → **Search Provider** to access the settings panel. + +![Search Provider Settings](/image/feature/search-provider.png) + +From here you can: +- **View** all configured search sources +- **Add** new search sources with the "Add Provider" button +- **Edit** existing source URLs +- **Delete** custom sources (default sources mikan, nyaa, dmhy cannot be deleted) + +### URL Template Format + +When adding a custom source, the URL must contain `%s` as a placeholder for the search keyword. + +Example: +``` +https://example.com/rss/search?q=%s +``` + +The `%s` will be replaced with the user's search query. + +### Default Sources + +The following sources are built-in and cannot be deleted: + +| Source | URL Template | +|--------|--------------| +| mikan | `https://mikanani.me/RSS/Search?searchstr=%s` | +| nyaa | `https://nyaa.si/?page=rss&q=%s&c=0_0&f=0` | +| dmhy | `http://dmhy.org/topics/rss/rss.xml?keyword=%s` | + +### Adding Sources via Config File + +You can also manually add sources by editing `config/search_provider.json`: + +```json +{ + "mikan": "https://mikanani.me/RSS/Search?searchstr=%s", + "nyaa": "https://nyaa.si/?page=rss&q=%s&c=0_0&f=0", + "dmhy": "http://dmhy.org/topics/rss/rss.xml?keyword=%s", + "bangumi.moe": "https://bangumi.moe/rss/search/%s" +} +``` diff --git a/docs/en/home/index.md b/docs/en/home/index.md new file mode 100644 index 00000000..2be2672b --- /dev/null +++ b/docs/en/home/index.md @@ -0,0 +1,102 @@ +--- +title: About +--- + +

+ + + + + +

+ + +## About AutoBangumi + + +

+ AutoBangumi WebUI +

+ +**`AutoBangumi`** is a fully automated anime downloading and organizing tool based on RSS feeds. Simply subscribe to anime on [Mikan Project][mikan] or similar sites, and it will automatically track and download new episodes. + +The organized file names and directory structure are directly compatible with [Plex][plex], [Jellyfin][jellyfin], and other media library software without requiring additional metadata scraping. + +## Features + +- Simple one-time configuration for continuous use +- Hands-free RSS parser that extracts anime information and automatically generates download rules +- Anime file organization: + + ``` + Bangumi + ├── bangumi_A_title + │ ├── Season 1 + │ │ ├── A S01E01.mp4 + │ │ ├── A S01E02.mp4 + │ │ ├── A S01E03.mp4 + │ │ └── A S01E04.mp4 + │ └── Season 2 + │ ├── A S02E01.mp4 + │ ├── A S02E02.mp4 + │ ├── A S02E03.mp4 + │ └── A S02E04.mp4 + ├── bangumi_B_title + │ └─── Season 1 + ``` + +- Fully automatic renaming — over 99% of anime files can be directly scraped by media library software after renaming + + ``` + [Lilith-Raws] Kakkou no Iinazuke - 07 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4].mp4 + >> + Kakkou no Iinazuke S01E07.mp4 + ``` + +- Custom renaming based on parent folder names for all child files +- Mid-season catch-up to fill in all missed episodes of the current season +- Highly customizable options that can be fine-tuned for different media library software +- Zero maintenance, completely transparent operation +- Built-in TMDB parser for generating complete TMDB-formatted files and anime metadata +- Reverse proxy support for Mikan RSS feeds + +## Community + +- Update notifications: [Telegram Channel](https://t.me/autobangumi_update) +- Bug reports: [Telegram](https://t.me/+yNisOnDGaX5jMTM9) + +## Acknowledgments + +Thanks to [Sean](https://github.com/findix) for extensive help with the project. + +## Contributing + +Issues and Pull Requests are welcome! + + + + + +## Disclaimer + +Since AutoBangumi obtains anime through unofficial copyright channels: + +- **Do not** use AutoBangumi for commercial purposes. +- **Do not** create video content featuring AutoBangumi for distribution on domestic video platforms (copyright stakeholders). +- **Do not** use AutoBangumi for any activity that violates laws or regulations. + +AutoBangumi is for educational and personal use only. + +## License + +[MIT License](https://github.com/EstrellaXD/Auto_Bangumi/blob/main/LICENSE) + +[mikan]: https://mikanani.me +[plex]: https://plex.tv +[jellyfin]: https://jellyfin.org diff --git a/docs/en/home/pipline.md b/docs/en/home/pipline.md new file mode 100644 index 00000000..f3a7270b --- /dev/null +++ b/docs/en/home/pipline.md @@ -0,0 +1,12 @@ +# How AutoBangumi Works + +AutoBangumi (AB for short) is essentially an RSS parser. It parses RSS feeds from anime torrent sites, extracts metadata from torrent titles, generates download rules, and sends them to qBittorrent for downloading. After downloading, it organizes files into a standard media library directory structure. + +## Pipeline Overview + +1. **RSS Parsing** — AB periodically fetches and parses your subscribed RSS feeds +2. **Title Analysis** — Torrent titles are parsed to extract anime name, episode number, season, subtitle group, and resolution +3. **Rule Generation** — Download rules are created in qBittorrent based on the parsed information +4. **Download Management** — qBittorrent handles the actual downloading of torrents +5. **File Organization** — Downloaded files are renamed and moved into a standardized directory structure +6. **Media Library Ready** — The organized files can be directly recognized by Plex, Jellyfin, and other media servers diff --git a/docs/en/index.md b/docs/en/index.md new file mode 100644 index 00000000..c615086e --- /dev/null +++ b/docs/en/index.md @@ -0,0 +1,100 @@ +--- +# https://vitepress.dev/reference/default-theme-home-page +layout: home + +title: AutoBangumi +titleTemplate: 全自动追番,解放双手! + +hero: + name: AutoBangumi + text: 全自动追番,解放双手! + tagline: 全自动 RSS 订阅解析、下载管理和文件整理 + actions: + - theme: brand + text: 快速开始 + link: /deploy/quick-start + - theme: alt + text: 关于 + link: /home/ + - theme: alt + text: 更新日志 + link: /changelog/3.2 + +features: + - icon: + src: /image/icons/rss.png + title: RSS 订阅解析 + details: 自动识别并解析番剧 RSS 订阅源。无需手动输入,只需订阅即可自动完成解析、下载和整理。 + - icon: + src: /image/icons/qbittorrent-logo.svg + title: qBittorrent 下载器 + details: 使用 qBittorrent 下载番剧资源。在 AutoBangumi 中即可管理现有番剧、下载往期番剧以及删除条目。 + - icon: + src: /image/icons/tmdb-icon.png + title: TMDB 元数据匹配 + details: 通过 TMDB 匹配番剧信息以获取准确的元数据,确保即使在多个字幕组之间也能正确解析。 + - icon: + src: /image/icons/plex-icon.png + title: Plex / Jellyfin / Infuse ... + details: 根据匹配结果自动整理文件名和目录结构,确保媒体库软件能够高成功率地刮削元数据。 +--- + + +
+
+ +## 鸣谢 + +### 致谢 +感谢 +- [Mikan Project](https://mikanani.me) 提供了如此优秀的番剧资源。 +- [VitePress](https://vitepress.dev) 提供了优秀的文档框架。 +- [qBittorrent](https://www.qbittorrent.org) 提供了优秀的下载器。 +- [Plex](https://www.plex.tv) / [Jellyfin](https://jellyfin.org) 提供了优秀的自托管媒体库。 +- [Infuse](https://firecore.com/infuse) 提供了优雅的视频播放器。 +- [弹弹 Play](https://www.dandanplay.com) 提供了优秀的弹幕播放器。 +- 每一个番剧制作组 / 字幕组 / 爱好者。 + +### 贡献者 + +[ + ![](https://contrib.rocks/image?repo=EstrellaXD/Auto_Bangumi){class=contributors-avatar} +](https://github.com/EstrellaXD/Auto_Bangumi/graphs/contributors) + +## 免责声明 + +由于 AutoBangumi 通过非官方版权渠道获取番剧: + +- **请勿**将 AutoBangumi 用于商业用途。 +- **请勿**制作包含 AutoBangumi 的视频内容并在国内视频平台(版权相关方)上发布。 +- **请勿**将 AutoBangumi 用于任何违反法律法规的活动。 + +
+
+ + diff --git a/docs/faq/index.md b/docs/faq/index.md index 887172c3..78a84dcd 100644 --- a/docs/faq/index.md +++ b/docs/faq/index.md @@ -1,159 +1,159 @@ -# Frequently Asked Questions +# 常见问题 ## WebUI -### WebUI Address +### WebUI 地址 -The default port is 7892. For server deployments, access `http://serverhost:7892`. For local deployments, access `http://localhost:7892`. If you changed the port, remember to also update the Docker port mapping. +默认端口为 7892。服务器部署时访问 `http://serverhost:7892`,本地部署时访问 `http://localhost:7892`。如果修改了端口,请记得同时修改 Docker 端口映射。 -### Default Username and Password +### 默认用户名和密码 -- Default username: `admin`, default password: `adminadmin`. -- Please change your password after first login. +- 默认用户名:`admin`,默认密码:`adminadmin`。 +- 请在首次登录后修改密码。 -### Changing or Resetting Password +### 修改或重置密码 -- Change password: After logging in, click `···` in the upper right, click `Profile`, and modify your username and password. -- There is currently no simple password reset method. If you forget your password, delete the `data/data.db` file and restart. +- 修改密码:登录后,点击右上角的 `···`,点击 `个人资料`,即可修改用户名和密码。 +- 目前没有简便的密码重置方法。如果忘记密码,请删除 `data/data.db` 文件后重启。 -### Why don't my configuration changes take effect? +### 为什么配置修改不生效? -- After changing configuration, click the **Apply** button, then click **Restart** in the `···` menu to restart the main process. -- If Debug mode is enabled, click **Shutdown** in the `···` menu to restart the container. +- 修改配置后,点击 **应用** 按钮,然后在 `···` 菜单中点击 **重启** 来重启主程序。 +- 如果启用了调试模式,请在 `···` 菜单中点击 **关闭** 来重启容器。 -### How to check if the program is running normally +### 如何检查程序是否正常运行 -The new WebUI has a small dot in the upper right corner. Green means running normally, red means an error occurred and the program is paused. +新版 WebUI 右上角有一个小圆点。绿色表示程序正常运行,红色表示发生错误且程序已暂停。 -### Poster wall not showing images +### 海报墙不显示图片 -- If your version is 3.0: - AB uses `mikanani.me` addresses as poster image sources by default. If images aren't showing, your network cannot access these images. -- If your version is 3.1 or later: - - If posters show an error icon, the images are missing. Click the refresh poster button in the upper right menu to fetch TMDB posters. - - If posters fail to load, clear your browser cache. - - When using `mikanime.tv` as the RSS address, client-side proxies may prevent poster loading. Add a `direct` rule for it. +- 如果您的版本是 3.0: + AB 默认使用 `mikanani.me` 地址作为海报图片来源。如果图片不显示,说明您的网络无法访问这些图片。 +- 如果您的版本是 3.1 或更高版本: + - 如果海报显示错误图标,说明图片缺失。请点击右上角菜单中的刷新海报按钮来获取 TMDB 海报。 + - 如果海报加载失败,请清除浏览器缓存。 + - 使用 `mikanime.tv` 作为 RSS 地址时,客户端代理可能会阻止海报加载。请为其添加 `direct` 规则。 -## How Does v3.0 Manage Bangumi +## v3.0 如何管理番剧 -After upgrading to v3.0, AB can manage anime torrents and download rules in the WebUI. It relies on the torrent download path and rule name. -If you manually change torrent download paths in QB, you may encounter issues like notifications missing posters or failed torrent deletion. -Please manage anime and torrents within AB as much as possible. +升级到 v3.0 后,AB 可以在 WebUI 中管理番剧种子和下载规则。这依赖于种子下载路径和规则名称。 +如果您在 QB 中手动修改了种子下载路径,可能会遇到通知缺少海报或种子删除失败等问题。 +请尽量在 AB 内管理番剧和种子。 -## Downloads and Keyword Filtering +## 下载与关键词过滤 -### Download Path +### 下载路径 -**What should I put for the download path?** -- This parameter just needs to match your qBittorrent configuration: - - Docker: If qB uses `/downloads`, then set `/downloads/Bangumi`. You can change `Bangumi` to anything. - - Linux/macOS: If it's `/home/usr/downloads` or `/User/UserName/Downloads`, just append `/Bangumi` at the end. - - Windows: Change `D:\Media\` to `D:\Media\Bangumi` +**下载路径应该填什么?** +- 这个参数只需要与您的 qBittorrent 配置匹配即可: + - Docker:如果 qB 使用 `/downloads`,则设置为 `/downloads/Bangumi`。您可以将 `Bangumi` 改为任何名称。 + - Linux/macOS:如果是 `/home/usr/downloads` 或 `/User/UserName/Downloads`,只需在末尾添加 `/Bangumi`。 + - Windows:将 `D:\Media\` 改为 `D:\Media\Bangumi` -### Downloads not starting automatically +### 下载没有自动开始 -Check AutoBangumi's logs for any torrent-related entries. -- If none exist, check if your subscription is correct. +检查 AutoBangumi 的日志中是否有种子相关的条目。 +- 如果没有,请检查您的订阅是否正确。 -### Downloads not saved in the correct directory +### 下载没有保存到正确的目录 -- Check if the [download path](#download-path) is correct. -- Check qBittorrent's PGID and PUID configuration for folder creation permissions. Try manually downloading any torrent to a specified directory — if errors occur or the directory isn't created, it's a permissions issue. -- Check qBittorrent's default settings: Saving Management should be set to Manual (Saving Management >> Default Torrent Management Mode >> Manual). +- 检查[下载路径](#下载路径)是否正确。 +- 检查 qBittorrent 的 PGID 和 PUID 配置是否有创建文件夹的权限。尝试手动下载任意种子到指定目录——如果出错或目录未创建,则是权限问题。 +- 检查 qBittorrent 的默认设置:保存管理应设置为手动(保存管理 >> 默认 Torrent 管理模式 >> 手动)。 -### Downloading many unsubscribed anime +### 下载了很多未订阅的番剧 -- Check if your Mikan subscription includes all subtitle groups for a single anime. Subscribe to only one group per anime, and enable advanced subscriptions. - - Advanced subscriptions can be enabled in Mikan Project's user settings. -- Regex filtering may be insufficient — see the next section for expanding regex. -- If neither applies, report with logs at [Issues][ISSUE]. +- 检查您的 Mikan 订阅是否包含了同一番剧的所有字幕组。每个番剧只订阅一个字幕组,并启用高级订阅。 + - 高级订阅可以在 Mikan Project 的用户设置中启用。 +- 正则表达式过滤可能不够——请参阅下一节来扩展正则表达式。 +- 如果以上都不适用,请携带日志在 [Issues][ISSUE] 报告。 -### How to write filter keywords +### 如何编写过滤关键词 -Filter keywords in AB are regular expressions, added only when rules are created. To expand rules after creation, use the WebUI (v3.0+) to configure each anime individually. -- Filter keywords are regex — separate unwanted keywords with `|`. -- The default `720|\d+-\d+` rule filters out all collections and 720P anime. Add filters before deploying AB; subsequent environment variable changes only affect new rules. -- Common regex keywords (separated by `|`): - - `720` — filters 720, 720P, 720p, etc. - - `\d+-\d+` — filters collections like [1-12] - - `[Bb]aha` — filters Baha releases - - `[Bb]ilibili`, `[Bb]-Global` — filters Bilibili releases - - `繁`, `CHT` — filters Traditional Chinese subtitles -- To match specific keywords, add in QB's include field: `XXXXX+1080P\+` where `1080P\+` matches 1080P+ releases. +AB 中的过滤关键词是正则表达式,仅在创建规则时添加。要在创建后扩展规则,请使用 WebUI(v3.0+)单独配置每个番剧。 +- 过滤关键词是正则表达式——用 `|` 分隔不需要的关键词。 +- 默认的 `720|\d+-\d+` 规则会过滤掉所有合集和 720P 番剧。在部署 AB 前添加过滤器;之后的环境变量修改只影响新规则。 +- 常用正则表达式关键词(用 `|` 分隔): + - `720` — 过滤 720、720P、720p 等。 + - `\d+-\d+` — 过滤 [1-12] 等合集 + - `[Bb]aha` — 过滤 Baha 发布 + - `[Bb]ilibili`、`[Bb]-Global` — 过滤 Bilibili 发布 + - `繁`、`CHT` — 过滤繁体中文字幕 +- 要匹配特定关键词,请在 QB 的包含字段中添加:`XXXXX+1080P\+`,其中 `1080P\+` 匹配 1080P+ 发布。 -### First deployment downloaded unwanted anime +### 首次部署时下载了不想要的番剧 -1. Delete extra automatic download rules and files in QB. -2. Check subscriptions and filter rules. -3. Visit the resetRule API in your browser: `http://localhost:7892/api/v1/resetRule` to reset rules. -4. Restart AB. +1. 删除 QB 中多余的自动下载规则和文件。 +2. 检查订阅和过滤规则。 +3. 在浏览器中访问 resetRule API:`http://localhost:7892/api/v1/resetRule` 来重置规则。 +4. 重启 AB。 -### AB identifies fewer RSS entries than subscribed +### AB 识别的 RSS 条目比订阅的少 -In newer versions, AB's filter also filters all RSS entries by default. Don't add all filters at once. For fine-grained control, configure each anime individually in the WebUI. +在较新版本中,AB 的过滤器默认也会过滤所有 RSS 条目。不要一次添加所有过滤器。要进行细粒度控制,请在 WebUI 中单独配置每个番剧。 -### Filter keywords not working +### 过滤关键词不生效 -- Check if the **global filter** parameter is set correctly. -- Check QB's RSS auto-download rules — you can see matched RSS on the right side, adjust download rules, and click save to identify which keyword is causing issues. +- 检查 **全局过滤器** 参数是否设置正确。 +- 检查 QB 的 RSS 自动下载规则——您可以在右侧看到匹配的 RSS,调整下载规则并点击保存来确定是哪个关键词导致问题。 -## Episode Completion +## 剧集补全 -### Episode completion not working +### 剧集补全不生效 -Check if the **Episode completion** parameter is correctly configured. +检查 **剧集补全** 参数是否配置正确。 -## File Renaming +## 文件重命名 -### Parse error `Cannot parse XXX` +### 解析错误 `Cannot parse XXX` -- AB does not currently support parsing collections. -- If it's not a collection, report the issue on GitHub Issues. +- AB 目前不支持解析合集。 +- 如果不是合集,请在 GitHub Issues 上报告问题。 -### `Rename failed` or renaming errors +### `Rename failed` 或重命名错误 -- Check file paths. Standard storage path should be `/title/Season/Episode.mp4`. Non-standard paths cause naming errors — check your qBittorrent configuration. -- Check if the `download path` is filled in correctly. Incorrect paths prevent proper renaming. -- For other issues, report on GitHub Issues. +- 检查文件路径。标准存储路径应为 `/title/Season/Episode.mp4`。非标准路径会导致命名错误——请检查您的 qBittorrent 配置。 +- 检查 `下载路径` 是否填写正确。路径不正确会导致无法正确重命名。 +- 其他问题请在 GitHub Issues 上报告。 -### No automatic renaming +### 没有自动重命名 -- Check if the torrent category in QB is `Bangumi`. -- AB only renames downloaded files. +- 检查 QB 中的种子分类是否为 `Bangumi`。 +- AB 只会重命名已下载的文件。 -### How to rename non-AB anime with AB +### 如何使用 AB 重命名非 AB 下载的番剧 -- Simply change the torrent's category to `Bangumi`. -- Note: The torrent must be stored in a `Title/Season X/` folder to trigger renaming. +- 只需将种子的分类改为 `Bangumi`。 +- 注意:种子必须存储在 `Title/Season X/` 文件夹中才能触发重命名。 -### How to rename collections +### 如何重命名合集 -1. Change the collection's category to `Bangumi`. -2. Change the collection's storage path to `Title/Season X/`. -3. Wait for the collection to finish downloading, and renaming will complete. +1. 将合集的分类改为 `Bangumi`。 +2. 将合集的存储路径改为 `Title/Season X/`。 +3. 等待合集下载完成,重命名将自动完成。 ## Docker -### How to auto-update +### 如何自动更新 -Run a `watchtower` daemon in Docker to automatically update your containers. +在 Docker 中运行 `watchtower` 守护进程来自动更新您的容器。 -[watchtower](https://containrrr.dev/watchtower) official documentation +[watchtower](https://containrrr.dev/watchtower) 官方文档 -### Updating with Docker Compose +### 使用 Docker Compose 更新 -If your AB is deployed with Docker Compose, use `docker compose pull` to update. -After pulling the new image, use `docker compose up -d` to restart. +如果您的 AB 是使用 Docker Compose 部署的,请使用 `docker compose pull` 来更新。 +拉取新镜像后,使用 `docker compose up -d` 来重启。 -You can also add `pull_policy: always` to your `docker-compose.yml` to pull the latest image on every start. +您也可以在 `docker-compose.yml` 中添加 `pull_policy: always` 来在每次启动时拉取最新镜像。 -### What to do if an upgrade causes issues +### 升级导致问题怎么办 -Since configurations may vary, upgrades might cause the program to fail. In this case, delete all previous data and generated configuration files, then restart the container. -Then reconfigure in the WebUI. -If upgrading from an older version, first refer to the [upgrade guide](/changelog/2.6). +由于配置可能各不相同,升级可能会导致程序失败。在这种情况下,删除所有之前的数据和生成的配置文件,然后重启容器。 +然后在 WebUI 中重新配置。 +如果从旧版本升级,请先参阅[升级指南](/changelog/2.6)。 -If you encounter issues not covered above, report them at [Issues][ISSUE] using the bug template. +如果您遇到上述未涵盖的问题,请使用 bug 模板在 [Issues][ISSUE] 报告。 [ISSUE]: https://github.com/EstrellaXD/Auto_Bangumi/issues diff --git a/docs/faq/network.md b/docs/faq/network.md index eecf05c6..a5b8e2fb 100644 --- a/docs/faq/network.md +++ b/docs/faq/network.md @@ -1,46 +1,46 @@ -# Network Issues +# 网络问题 -## Cannot Connect to Mikan Project +## 无法连接到 Mikan Project -Since the main Mikan Project site (`https://mikanani.me`) may be blocked in some regions, AB may fail to connect. Use the following solutions: +由于 Mikan Project 主站(`https://mikanani.me`)在某些地区可能被屏蔽,AB 可能无法连接。请使用以下解决方案: -- [Use Mikan Project alternative domain](#mikan-project-alternative-domain) -- [Use a proxy](#configuring-a-proxy) -- [Use a Cloudflare Worker reverse proxy](#cloudflare-workers-reverse-proxy) +- [使用 Mikan Project 备用域名](#mikan-project-备用域名) +- [使用代理](#配置代理) +- [使用 Cloudflare Worker 反向代理](#cloudflare-workers-反向代理) -### Mikan Project Alternative Domain +### Mikan Project 备用域名 -Mikan Project has a new domain `https://mikanime.tv`. Use this domain with AB without enabling a proxy. +Mikan Project 有一个新域名 `https://mikanime.tv`。使用此域名配合 AB,无需启用代理。 -If you see: +如果您看到: ``` DNS/Connect ERROR ``` -- Check your network connection. If it's fine, check DNS resolution. -- Add `dns=8.8.8.8` to AB. If using Host network mode, this can be ignored. +- 请检查您的网络连接。如果网络正常,请检查 DNS 解析。 +- 在 AB 中添加 `dns=8.8.8.8`。如果使用 Host 网络模式,可以忽略此项。 -If you're using a proxy, this error typically won't occur with correct configuration. +如果您使用代理,正确配置后通常不会出现此错误。 -### Configuring a Proxy +### 配置代理 ::: tip -In AB 3.1+, AB handles RSS updates and notifications itself, so you only need to configure the proxy in AB. +在 AB 3.1+ 中,AB 自己处理 RSS 更新和通知,因此您只需要在 AB 中配置代理。 ::: -AB has built-in proxy configuration. To configure a proxy, follow the instructions in [Proxy Settings](../config/proxy) to set up HTTP or SOCKS proxy correctly. This resolves access issues. +AB 有内置的代理配置。要配置代理,请按照[代理设置](../config/proxy)中的说明正确设置 HTTP 或 SOCKS 代理。这可以解决访问问题。 -**For versions before 3.1, qBittorrent proxy configuration is also needed** +**对于 3.1 之前的版本,还需要配置 qBittorrent 代理** -Configure the proxy in QB as shown below (same approach for SOCKS): +如下图所示在 QB 中配置代理(SOCKS 方法相同): image -### Cloudflare Workers Reverse Proxy +### Cloudflare Workers 反向代理 -You can also use a reverse proxy approach via Cloudflare Workers. Setting up a domain and binding it to Cloudflare is beyond the scope of this guide. -Add the following code in Workers to use your own domain to access Mikan Project and download torrents from RSS links: +您也可以通过 Cloudflare Workers 使用反向代理方式。设置域名并绑定到 Cloudflare 超出了本指南的范围。 +在 Workers 中添加以下代码,即可使用您自己的域名访问 Mikan Project 并从 RSS 链接下载种子: ```javascript const TELEGRAPH_URL = 'https://mikanani.me'; @@ -85,13 +85,13 @@ async function handleRequest(request) { } ``` -After completing the configuration, replace `https://mikanani.me` with your domain when **adding RSS**. +完成配置后,**添加 RSS** 时将 `https://mikanani.me` 替换为您的域名。 -## Cannot Connect to qBittorrent +## 无法连接到 qBittorrent -First, check if the **downloader address** parameter in AB is correct. -- If AB and QB are on the same Docker network, try using the container name for addressing, e.g., `http://qbittorrent:8080`. -- If AB and QB are on the same Docker server, try using the Docker gateway address, e.g., `http://172.17.0.1:8080`. -- If AB's network mode is not `host`, do not use `127.0.0.1` to access QB. +首先,检查 AB 中的 **下载器地址** 参数是否正确。 +- 如果 AB 和 QB 在同一个 Docker 网络中,请尝试使用容器名称进行寻址,例如 `http://qbittorrent:8080`。 +- 如果 AB 和 QB 在同一台 Docker 服务器上,请尝试使用 Docker 网关地址,例如 `http://172.17.0.1:8080`。 +- 如果 AB 的网络模式不是 `host`,请不要使用 `127.0.0.1` 访问 QB。 -If containers in Docker cannot access each other, set up a network link between QB and AB in QB's network connection settings. If qBittorrent uses HTTPS, add the `https://` prefix to the **downloader address**. +如果 Docker 中的容器无法相互访问,请在 QB 的网络连接设置中设置 QB 和 AB 之间的网络链接。如果 qBittorrent 使用 HTTPS,请在 **下载器地址** 前添加 `https://` 前缀。 diff --git a/docs/faq/troubleshooting.md b/docs/faq/troubleshooting.md index 74bab6ce..9445e64d 100644 --- a/docs/faq/troubleshooting.md +++ b/docs/faq/troubleshooting.md @@ -1,11 +1,11 @@ --- -title: Troubleshooting +title: 故障排除 --- -## General Troubleshooting Flow +## 一般故障排除流程 -1. If AB fails to start, check if the startup command is correct. If incorrect and you don't know how to fix it, try redeploying AB. -2. After deploying AB, check the logs first. If you see output like the following, AB is running normally and connected to QB: +1. 如果 AB 无法启动,请检查启动命令是否正确。如果不正确且您不知道如何修复,请尝试重新部署 AB。 +2. 部署 AB 后,首先检查日志。如果您看到类似以下的输出,说明 AB 正常运行并已连接到 QB: ``` [2022-07-09 21:55:19,164] INFO: _ ____ _ [2022-07-09 21:55:19,165] INFO: /\ | | | _ \ (_) @@ -23,17 +23,17 @@ title: Troubleshooting [2022-07-09 21:55:23,431] INFO: Finished [2022-07-09 21:55:23,432] INFO: Running.... ``` - 1. If you see this log, AB cannot connect to qBittorrent. Check if qBittorrent is running. If it is, go to the [Network Issues](/faq/network) section. + 1. 如果您看到此日志,说明 AB 无法连接到 qBittorrent。请检查 qBittorrent 是否正在运行。如果正在运行,请前往[网络问题](/faq/network)部分。 ``` [2022-07-09 22:01:24,534] WARNING: Cannot connect to qBittorrent, wait 5min and retry ``` - 2. If you see this log, AB cannot connect to Mikan RSS. Go to the [Network Issues](/faq/network) section. + 2. 如果您看到此日志,说明 AB 无法连接到 Mikan RSS。请前往[网络问题](/faq/network)部分。 ``` [2022-07-09 21:55:21,761] INFO: Start collecting RSS info. [2022-07-09 22:01:24,534] WARNING: Connected Failed, please check DNS/Connection ``` -3. At this point, QB should have download tasks. - 1. If downloads show path issues, check QB's "Saving Management" → "Default Torrent Management Mode" is set to "Manual". - 2. If all downloads show exclamation marks or no category folders are created in the download path, check QB's permissions. -4. If none of the above resolves the issue, try redeploying a fresh qBittorrent. -5. If still unsuccessful, report with logs at [Issues](https://www.github.com/EstrellaXD/Auto_Bangumi/issues). +3. 此时,QB 应该有下载任务了。 + 1. 如果下载显示路径问题,请检查 QB 的"保存管理"→"默认 Torrent 管理模式"是否设置为"手动"。 + 2. 如果所有下载都显示感叹号或下载路径中没有创建分类文件夹,请检查 QB 的权限。 +4. 如果以上都无法解决问题,请尝试重新部署一个全新的 qBittorrent。 +5. 如果仍然不成功,请携带日志在 [Issues](https://www.github.com/EstrellaXD/Auto_Bangumi/issues) 报告。 diff --git a/docs/feature/bangumi.md b/docs/feature/bangumi.md index b08ceb30..68da89b0 100644 --- a/docs/feature/bangumi.md +++ b/docs/feature/bangumi.md @@ -1,83 +1,83 @@ -# Bangumi Management +# 番剧管理 -Click an anime poster on the homepage to manage individual anime entries. +点击首页的番剧海报可管理单个番剧条目。 ![Bangumi List](../image/feature/bangumi-list.png) -If an anime has multiple download rules (e.g., different subtitle groups), a rule selection popup will appear: +如果一部番剧有多个下载规则(例如不同字幕组),将出现规则选择弹窗: ![Rule Selection](../image/feature/rule-select.png) -After selecting a rule, the edit modal opens: +选择规则后,编辑弹窗打开: ![Edit Bangumi](../image/feature/bangumi-edit.png) -## Notification Badges +## 通知徽章 -Since v3.2, bangumi cards display iOS-style notification badges to indicate status: +从 v3.2 开始,番剧卡片显示 iOS 风格的通知徽章来指示状态: -- **Yellow badge with `!`**: Subscription needs review (e.g., offset issues detected) -- **Number badge**: Multiple rules exist for this anime -- **Combined badge** (e.g., `! | 2`): Has warning and multiple rules +- **黄色徽章带 `!`**:订阅需要审核(例如检测到偏移问题) +- **数字徽章**:该番剧存在多个规则 +- **组合徽章**(例如 `! | 2`):有警告且有多个规则 -Cards with warnings also display a yellow glow animation to draw attention. +带有警告的卡片还会显示黄色发光动画以引起注意。 -## Episode Offset Auto-Detection +## 剧集偏移自动检测 -Some anime have complex season structures that cause mismatches between RSS episode numbers and TMDB data. For example: -- "Frieren: Beyond Journey's End" Season 1 was broadcast in two parts with a 6-month gap -- RSS may show "S2E01" while TMDB considers it "S1E29" +某些番剧具有复杂的季度结构,导致 RSS 剧集编号与 TMDB 数据不匹配。例如: +- "葬送的芙莉莲" 第一季分两部分播出,中间隔了 6 个月 +- RSS 可能显示 "S2E01",而 TMDB 认为是 "S1E29" -AB v3.2 can automatically detect these issues: +AB v3.2 可以自动检测这些问题: -1. Click the **Auto Detect** button in the edit modal -2. AB analyzes TMDB episode air dates to identify "virtual seasons" -3. If a mismatch is found, AB suggests the correct offset values -4. Click **Apply** to save the offset +1. 点击编辑弹窗中的 **自动检测** 按钮 +2. AB 分析 TMDB 剧集播出日期以识别"虚拟季度" +3. 如果发现不匹配,AB 会建议正确的偏移值 +4. 点击 **应用** 保存偏移 -The background scan thread also periodically checks existing subscriptions for offset issues and marks them for review. +后台扫描线程还会定期检查现有订阅的偏移问题,并标记需要审核的项目。 -## Archive / Unarchive Anime +## 归档 / 取消归档番剧 -Since v3.2, you can archive completed or inactive anime to keep your list organized. +从 v3.2 开始,您可以归档已完结或不活跃的番剧,以保持列表整洁。 -### Manual Archive +### 手动归档 -1. Click on an anime poster -2. In the edit modal, click the **Archive** button -3. The anime moves to the "Archived" section at the bottom of the list +1. 点击番剧海报 +2. 在编辑弹窗中,点击 **归档** 按钮 +3. 番剧移至列表底部的"已归档"区域 -### Automatic Archive +### 自动归档 -AB can automatically archive anime when: -- The series status on TMDB shows as "Ended" or "Canceled" -- Use **Config** → refresh metadata to trigger auto-archive +AB 可以在以下情况自动归档番剧: +- TMDB 上的系列状态显示为"已完结"或"已取消" +- 使用 **配置** → 刷新元数据触发自动归档 -### Viewing Archived Anime +### 查看已归档番剧 -Archived anime appear in a collapsible "Archived" section at the bottom of the bangumi list. Click to expand and view archived items. +已归档番剧出现在番剧列表底部的可折叠"已归档"区域。点击展开查看已归档项目。 -### Unarchive +### 取消归档 -To restore an archived anime: -1. Expand the "Archived" section -2. Click on the anime poster -3. Click the **Unarchive** button +要恢复已归档番剧: +1. 展开"已归档"区域 +2. 点击番剧海报 +3. 点击 **取消归档** 按钮 -## Disable / Delete Anime +## 禁用 / 删除番剧 -Since AB continuously parses **aggregated RSS** feeds, for download rules from aggregated RSS that you no longer need: -- Disable anime: The anime won't be downloaded or re-parsed -- Remove the subscription from the aggregated RSS +由于 AB 会持续解析**聚合 RSS** 订阅,对于来自聚合 RSS 中不再需要的下载规则: +- 禁用番剧:番剧不会被下载或重新解析 +- 从聚合 RSS 中移除订阅 -If you delete the anime entry, it will be recreated on the next parse cycle. +如果您删除番剧条目,它将在下次解析周期被重新创建。 -## Advanced Settings +## 高级设置 -Click **Advanced Settings** in the edit modal to access additional options: +点击编辑弹窗中的 **高级设置** 访问更多选项: ![Advanced Settings](../image/feature/bangumi-edit-advanced.png) -- **Season Offset**: Adjust the season number offset -- **Episode Offset**: Adjust the episode number offset -- **Filter**: Custom regex filter for torrent matching +- **季度偏移**:调整季度编号偏移 +- **剧集偏移**:调整剧集编号偏移 +- **过滤**:用于种子匹配的自定义正则表达式过滤器 diff --git a/docs/feature/calendar.md b/docs/feature/calendar.md index a373576e..33da5ec7 100644 --- a/docs/feature/calendar.md +++ b/docs/feature/calendar.md @@ -1,40 +1,40 @@ -# Calendar View +# 日历视图 -Since v3.2, AB includes a calendar view that shows your subscribed anime organized by broadcast day. +从 v3.2 开始,AB 包含日历视图,按播出日期显示您订阅的番剧。 ![Calendar](../image/feature/calendar.png) -## Features +## 功能 -### Weekly Schedule +### 每周时间表 -The calendar displays anime organized by their broadcast weekday (Monday through Sunday), plus an "Unknown" column for anime without broadcast schedule data. +日历按播出日期(周一至周日)组织显示番剧,另有"未知"列显示没有播出时间数据的番剧。 -### Bangumi.tv Integration +### Bangumi.tv 集成 -AB fetches broadcast schedule data from Bangumi.tv to accurately display when each anime airs. +AB 从 Bangumi.tv 获取播出时间数据,以准确显示每部番剧的播出时间。 -Click the **Refresh schedule** button to update the broadcast data. +点击 **刷新时间表** 按钮更新播出数据。 -### Grouped Display +### 分组显示 -Since v3.2, anime with multiple download rules are grouped together: +从 v3.2 开始,具有多个下载规则的番剧会被分组显示: -- Same anime appears once, even with multiple subtitle group rules -- Click on a grouped anime to see all available rules -- Select a specific rule to edit +- 同一番剧只显示一次,即使有多个字幕组规则 +- 点击分组番剧可查看所有可用规则 +- 选择特定规则进行编辑 -This keeps the calendar clean while still providing access to all your rules. +这样可以保持日历整洁,同时仍能访问所有规则。 -## Navigation +## 导航 -Click on any anime poster in the calendar to: -- View anime details -- Edit download rules -- Access archive/disable options +点击日历中的任意番剧海报可: +- 查看番剧详情 +- 编辑下载规则 +- 访问归档/禁用选项 -## Tips +## 提示 ::: tip -If an anime appears in the "Unknown" column, it may not have broadcast data on Bangumi.tv, or the anime title couldn't be matched. +如果番剧出现在"未知"列,可能是 Bangumi.tv 上没有播出数据,或番剧标题无法匹配。 ::: diff --git a/docs/feature/rename.md b/docs/feature/rename.md index cb85840e..4a1a3892 100644 --- a/docs/feature/rename.md +++ b/docs/feature/rename.md @@ -1,12 +1,12 @@ -# File Renaming +# 文件重命名 -AB currently provides three renaming methods: `pn`, `advance`, and `none`. +AB 目前提供三种重命名方式:`pn`、`advance` 和 `none`。 ### pn -Short for `pure name`. This method uses the torrent download name for renaming. +`pure name` 的缩写。此方法使用种子下载名称进行重命名。 -Example: +示例: ``` [Lilith-Raws] 86 - Eighty Six - 01 [Baha][WEB-DL][1080p][AVC AAC][CHT][MKV].mkv >> @@ -15,7 +15,7 @@ Example: ### advance -Advanced renaming. This method uses the parent folder name for renaming. +高级重命名。此方法使用父文件夹名称进行重命名。 ``` /downloads/Bangumi/86 - Eighty Six(2023)/Season 1/[Lilith-Raws] 86 - Eighty Six - 01 [Baha][WEB-DL][1080p][AVC AAC][CHT][MKV].mkv @@ -25,37 +25,37 @@ Advanced renaming. This method uses the parent folder name for renaming. ### none -No renaming. Files are left as-is. +不重命名。文件保持原样。 -## Collection Renaming +## 收藏重命名 -AB supports renaming collections. Collection renaming requires: -- Episodes are in the collection's first-level directory -- Episode numbers can be parsed from file names +AB 支持收藏重命名。收藏重命名需要: +- 剧集位于收藏的一级目录中 +- 可以从文件名解析出剧集编号 -AB can also rename subtitle files in the first-level directory. +AB 还可以重命名一级目录中的字幕文件。 -After renaming, episodes and directories are placed in the `Season` folder. +重命名后,剧集和目录将放置在 `Season` 文件夹中。 -Renamed collections are moved and categorized under `BangumiCollection`. +重命名后的收藏将被移动并归类到 `BangumiCollection` 下。 -## Episode Offset +## 剧集偏移 -Since v3.2, AB supports episode offset for renaming. This is useful when: -- RSS shows different episode numbers than expected (e.g., S2E01 should be S1E29) -- Anime has "virtual seasons" due to broadcast gaps +从 v3.2 开始,AB 支持重命名时的剧集偏移。在以下情况下很有用: +- RSS 显示的剧集编号与预期不同(例如 S2E01 应该是 S1E29) +- 番剧因播出间隔而产生"虚拟季度" -When an offset is configured for a bangumi, AB automatically applies it during renaming: +当为番剧配置偏移后,AB 会在重命名时自动应用: ``` -Original: S02E01.mkv -With offset (season: -1, episode: +28): S01E29.mkv +原始:S02E01.mkv +应用偏移(季度:-1,剧集:+28):S01E29.mkv ``` -To configure offset: -1. Click on the anime poster -2. Open Advanced Settings -3. Set Season Offset and/or Episode Offset values -4. Or use "Auto Detect" to let AB suggest the correct offset +配置偏移: +1. 点击番剧海报 +2. 打开高级设置 +3. 设置季度偏移和/或剧集偏移值 +4. 或使用"自动检测"让 AB 建议正确的偏移 -See [Bangumi Management](./bangumi.md#episode-offset-auto-detection) for more details on auto-detection. +有关自动检测的更多详情,请参阅[番剧管理](./bangumi.md#episode-offset-auto-detection)。 diff --git a/docs/feature/rss.md b/docs/feature/rss.md index 87384bdd..1e178c2b 100644 --- a/docs/feature/rss.md +++ b/docs/feature/rss.md @@ -1,68 +1,68 @@ --- -title: RSS Management +title: RSS 管理 --- -# RSS Management +# RSS 管理 -## RSS Manager Page +## RSS 管理页面 -The RSS Manager page displays all your RSS subscriptions with their connection status. +RSS 管理页面显示您所有的 RSS 订阅及其连接状态。 ![RSS Manager](../image/feature/rss-manager.png) -### Connection Status +### 连接状态 -Since v3.2, AB tracks the connection status of each RSS source: +从 v3.2 开始,AB 会跟踪每个 RSS 源的连接状态: -| Status | Description | -|--------|-------------| -| **Connected** (green) | RSS source is reachable and returning valid data | -| **Error** (red) | RSS source failed to respond or returned invalid data | +| 状态 | 说明 | +|------|------| +| **已连接**(绿色) | RSS 源可访问且返回有效数据 | +| **错误**(红色) | RSS 源无法响应或返回无效数据 | -When a source shows an error, hover over the status label to see the error details in a tooltip. +当源显示错误时,将鼠标悬停在状态标签上可在提示框中查看错误详情。 -AB automatically updates the connection status on each RSS refresh cycle. +AB 会在每次 RSS 刷新周期自动更新连接状态。 -## Adding Collections +## 添加收藏 -AB provides two manual download methods: -**Collect** and **Subscribe**. -- **Collect** downloads all episodes at once, suitable for completed anime. -- **Subscribe** adds an automatic download rule with the corresponding RSS link, suitable for ongoing anime. +AB 提供两种手动下载方式: +**收藏** 和 **订阅**。 +- **收藏** 一次性下载所有剧集,适用于已完结番剧。 +- **订阅** 添加带有对应 RSS 链接的自动下载规则,适用于连载番剧。 -### Parsing RSS Links +### 解析 RSS 链接 -AB supports parsing collection RSS links from all resource sites. Find the collection RSS for your desired anime on the corresponding site, click the **+** button in the upper right corner of AB, and paste the RSS link in the popup window. +AB 支持解析所有资源站的收藏 RSS 链接。在对应网站找到您想要的番剧收藏 RSS,点击 AB 右上角的 **+** 按钮,在弹出窗口中粘贴 RSS 链接。 -### Adding Downloads +### 添加下载 -If parsing succeeds, a window will appear showing the parsed anime information. Click **Collect** or **Subscribe** to add it to the download queue. +如果解析成功,将出现一个窗口显示解析后的番剧信息。点击 **收藏** 或 **订阅** 将其添加到下载队列。 -### Common Issues +### 常见问题 -If a parsing error occurs, it may be due to an incorrect RSS link or an unsupported subtitle group naming format. +如果出现解析错误,可能是由于 RSS 链接不正确或字幕组命名格式不支持。 -## Managing Bangumi +## 管理番剧 -Since v3.0, AB provides manual anime management in the WebUI, allowing you to manually adjust incorrectly parsed anime information. +从 v3.0 开始,AB 在 WebUI 中提供手动番剧管理功能,允许您手动调整解析错误的番剧信息。 -### Editing Anime Information +### 编辑番剧信息 -In the anime list, click the anime poster to enter the anime information page. -After modifying the information, click **Apply**. -AB will readjust the directory and automatically rename files based on your changes. +在番剧列表中,点击番剧海报进入番剧信息页面。 +修改信息后,点击 **应用**。 +AB 将根据您的更改重新调整目录并自动重命名文件。 -### Deleting Anime +### 删除番剧 -Since v3.0, you can manually delete anime. Click the anime poster, enter the information page, and click **Delete**. +从 v3.0 开始,您可以手动删除番剧。点击番剧海报,进入信息页面,点击 **删除**。 ::: warning -After deleting anime, if the RSS subscription hasn't been cancelled, AB will still re-parse it. To disable the download rule, use [Disable Anime](#disabling-anime). +删除番剧后,如果 RSS 订阅未取消,AB 仍会重新解析。要禁用下载规则,请使用[禁用番剧](#禁用番剧)。 ::: -### Disabling Anime +### 禁用番剧 -Since v3.0, you can manually disable anime. Click the anime poster, enter the information page, and click **Disable**. +从 v3.0 开始,您可以手动禁用番剧。点击番剧海报,进入信息页面,点击 **禁用**。 -Once disabled, the anime poster will be grayed out and sorted to the end. To re-enable the download rule, click **Enable**. +禁用后,番剧海报将变灰并排序到末尾。要重新启用下载规则,点击 **启用**。 diff --git a/docs/feature/search.md b/docs/feature/search.md index 3037b460..65106c52 100644 --- a/docs/feature/search.md +++ b/docs/feature/search.md @@ -1,63 +1,63 @@ -# Torrent Search +# 种子搜索 -Since v3.1, AB includes a search feature for quickly finding anime. +从 v3.1 开始,AB 包含搜索功能,可快速查找番剧。 -## Using the Search Feature +## 使用搜索功能 ::: warning -The search feature relies on the main program's parser. The current version does not support parsing collections. A `warning` when parsing collections is normal behavior. +搜索功能依赖主程序的解析器。当前版本不支持解析收藏。解析收藏时出现 `warning` 是正常现象。 ::: -The search bar is located in the AB top bar. Click to open the search panel. +搜索栏位于 AB 顶栏。点击打开搜索面板。 ![Search Panel](../image/feature/search-panel.png) -Select the source site, enter keywords, and AB will automatically parse and display search results. To add an anime, click the add button on the right side of the card. +选择资源站,输入关键词,AB 将自动解析并显示搜索结果。要添加番剧,点击卡片右侧的添加按钮。 ::: tip -When the source is **Mikan**, AB uses the `mikan` parser by default. For other sources, the TMDB parser is used. +当资源站为 **Mikan** 时,AB 默认使用 `mikan` 解析器。其他资源站使用 TMDB 解析器。 ::: -## Managing Search Sources +## 管理搜索源 -Since v3.2, you can manage search sources directly in the Settings page without editing JSON files. +从 v3.2 开始,您可以直接在设置页面管理搜索源,无需编辑 JSON 文件。 -### Search Provider Settings Panel +### 搜索源设置面板 -Navigate to **Config** → **Search Provider** to access the settings panel. +导航至 **配置** → **搜索源** 访问设置面板。 ![Search Provider Settings](../image/feature/search-provider.png) -From here you can: -- **View** all configured search sources -- **Add** new search sources with the "Add Provider" button -- **Edit** existing source URLs -- **Delete** custom sources (default sources mikan, nyaa, dmhy cannot be deleted) +在这里您可以: +- **查看** 所有已配置的搜索源 +- **添加** 新搜索源,使用"添加源"按钮 +- **编辑** 现有源的 URL +- **删除** 自定义源(默认源 mikan、nyaa、dmhy 不能删除) -### URL Template Format +### URL 模板格式 -When adding a custom source, the URL must contain `%s` as a placeholder for the search keyword. +添加自定义源时,URL 必须包含 `%s` 作为搜索关键词的占位符。 -Example: +示例: ``` https://example.com/rss/search?q=%s ``` -The `%s` will be replaced with the user's search query. +`%s` 将被替换为用户的搜索查询。 -### Default Sources +### 默认源 -The following sources are built-in and cannot be deleted: +以下源为内置源,不能删除: -| Source | URL Template | -|--------|--------------| +| 源 | URL 模板 | +|----|----------| | mikan | `https://mikanani.me/RSS/Search?searchstr=%s` | | nyaa | `https://nyaa.si/?page=rss&q=%s&c=0_0&f=0` | | dmhy | `http://dmhy.org/topics/rss/rss.xml?keyword=%s` | -### Adding Sources via Config File +### 通过配置文件添加源 -You can also manually add sources by editing `config/search_provider.json`: +您也可以通过编辑 `config/search_provider.json` 手动添加源: ```json { diff --git a/docs/home/index.md b/docs/home/index.md index 314f4e77..04d820b1 100644 --- a/docs/home/index.md +++ b/docs/home/index.md @@ -1,5 +1,5 @@ --- -title: About +title: 关于 ---

@@ -11,7 +11,7 @@ title: About

-## About AutoBangumi +## 关于 AutoBangumi

@@ -24,15 +24,15 @@ title: About >

-**`AutoBangumi`** is a fully automated anime downloading and organizing tool based on RSS feeds. Simply subscribe to anime on [Mikan Project][mikan] or similar sites, and it will automatically track and download new episodes. +**`AutoBangumi`** 是一款基于 RSS 订阅的全自动番剧下载和整理工具。只需在 [Mikan Project][mikan] 或类似网站订阅番剧,即可自动追踪和下载最新剧集。 -The organized file names and directory structure are directly compatible with [Plex][plex], [Jellyfin][jellyfin], and other media library software without requiring additional metadata scraping. +整理后的文件名和目录结构可直接兼容 [Plex][plex]、[Jellyfin][jellyfin] 等媒体库软件,无需额外的元数据刮削。 -## Features +## 功能特性 -- Simple one-time configuration for continuous use -- Hands-free RSS parser that extracts anime information and automatically generates download rules -- Anime file organization: +- 简单的一次性配置,持续使用 +- 无需操心的 RSS 解析器,可提取番剧信息并自动生成下载规则 +- 番剧文件整理: ``` Bangumi @@ -51,7 +51,7 @@ The organized file names and directory structure are directly compatible with [P │ └─── Season 1 ``` -- Fully automatic renaming — over 99% of anime files can be directly scraped by media library software after renaming +- 全自动重命名——超过 99% 的番剧文件在重命名后可被媒体库软件直接刮削 ``` [Lilith-Raws] Kakkou no Iinazuke - 07 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4].mp4 @@ -59,41 +59,41 @@ The organized file names and directory structure are directly compatible with [P Kakkou no Iinazuke S01E07.mp4 ``` -- Custom renaming based on parent folder names for all child files -- Mid-season catch-up to fill in all missed episodes of the current season -- Highly customizable options that can be fine-tuned for different media library software -- Zero maintenance, completely transparent operation -- Built-in TMDB parser for generating complete TMDB-formatted files and anime metadata -- Reverse proxy support for Mikan RSS feeds +- 基于父文件夹名称自定义重命名所有子文件 +- 季中追番补全当季所有缺失剧集 +- 高度自定义选项,可针对不同媒体库软件进行微调 +- 零维护,完全透明运行 +- 内置 TMDB 解析器,可生成完整的 TMDB 格式文件和番剧元数据 +- 支持 Mikan RSS 订阅的反向代理 -## Community +## 社区 -- Update notifications: [Telegram Channel](https://t.me/autobangumi_update) -- Bug reports: [Telegram](https://t.me/+yNisOnDGaX5jMTM9) +- 更新通知:[Telegram 频道](https://t.me/autobangumi_update) +- Bug 反馈:[Telegram](https://t.me/+yNisOnDGaX5jMTM9) -## Acknowledgments +## 致谢 -Thanks to [Sean](https://github.com/findix) for extensive help with the project. +感谢 [Sean](https://github.com/findix) 对项目的大力帮助。 -## Contributing +## 参与贡献 -Issues and Pull Requests are welcome! +欢迎提交 Issues 和 Pull Requests! -## Disclaimer +## 免责声明 -Since AutoBangumi obtains anime through unofficial copyright channels: +由于 AutoBangumi 通过非官方版权渠道获取番剧: -- **Do not** use AutoBangumi for commercial purposes. -- **Do not** create video content featuring AutoBangumi for distribution on domestic video platforms (copyright stakeholders). -- **Do not** use AutoBangumi for any activity that violates laws or regulations. +- **请勿**将 AutoBangumi 用于商业用途。 +- **请勿**制作包含 AutoBangumi 的视频内容并在国内视频平台(版权相关方)上发布。 +- **请勿**将 AutoBangumi 用于任何违反法律法规的活动。 -AutoBangumi is for educational and personal use only. +AutoBangumi 仅供学习和个人使用。 -## License +## 许可证 [MIT License](https://github.com/EstrellaXD/Auto_Bangumi/blob/main/LICENSE) diff --git a/docs/home/pipline.md b/docs/home/pipline.md index f3a7270b..01c99235 100644 --- a/docs/home/pipline.md +++ b/docs/home/pipline.md @@ -1,12 +1,12 @@ -# How AutoBangumi Works +# AutoBangumi 工作原理 -AutoBangumi (AB for short) is essentially an RSS parser. It parses RSS feeds from anime torrent sites, extracts metadata from torrent titles, generates download rules, and sends them to qBittorrent for downloading. After downloading, it organizes files into a standard media library directory structure. +AutoBangumi(简称 AB)本质上是一个 RSS 解析器。它从番剧种子站点解析 RSS 订阅源,从种子标题中提取元数据,生成下载规则并发送给 qBittorrent 进行下载。下载完成后,将文件整理成标准的媒体库目录结构。 -## Pipeline Overview +## 流程概览 -1. **RSS Parsing** — AB periodically fetches and parses your subscribed RSS feeds -2. **Title Analysis** — Torrent titles are parsed to extract anime name, episode number, season, subtitle group, and resolution -3. **Rule Generation** — Download rules are created in qBittorrent based on the parsed information -4. **Download Management** — qBittorrent handles the actual downloading of torrents -5. **File Organization** — Downloaded files are renamed and moved into a standardized directory structure -6. **Media Library Ready** — The organized files can be directly recognized by Plex, Jellyfin, and other media servers +1. **RSS 解析** — AB 定期获取并解析您订阅的 RSS 源 +2. **标题分析** — 解析种子标题以提取番剧名称、集数、季度、字幕组和分辨率 +3. **规则生成** — 根据解析的信息在 qBittorrent 中创建下载规则 +4. **下载管理** — qBittorrent 负责实际的种子下载 +5. **文件整理** — 下载的文件被重命名并移动到标准化的目录结构中 +6. **媒体库就绪** — 整理后的文件可直接被 Plex、Jellyfin 等媒体服务器识别 diff --git a/docs/index.md b/docs/index.md index 1d4f016f..c615086e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,71 +3,71 @@ layout: home title: AutoBangumi -titleTemplate: Automatic anime tracking, hands-free! +titleTemplate: 全自动追番,解放双手! hero: name: AutoBangumi - text: Automatic anime tracking, hands-free! - tagline: Fully automated RSS subscription parsing, download management, and file organization + text: 全自动追番,解放双手! + tagline: 全自动 RSS 订阅解析、下载管理和文件整理 actions: - theme: brand - text: Quick Start + text: 快速开始 link: /deploy/quick-start - theme: alt - text: About + text: 关于 link: /home/ - theme: alt - text: Changelog + text: 更新日志 link: /changelog/3.2 features: - icon: src: /image/icons/rss.png - title: RSS Subscription Parsing - details: Automatically identifies and parses anime RSS feeds. No manual input needed — just subscribe and it handles parsing, downloading, and organizing. + title: RSS 订阅解析 + details: 自动识别并解析番剧 RSS 订阅源。无需手动输入,只需订阅即可自动完成解析、下载和整理。 - icon: src: /image/icons/qbittorrent-logo.svg - title: qBittorrent Downloader - details: Uses qBittorrent to download anime resources. Manage existing anime, download older series, and delete entries all within AutoBangumi. + title: qBittorrent 下载器 + details: 使用 qBittorrent 下载番剧资源。在 AutoBangumi 中即可管理现有番剧、下载往期番剧以及删除条目。 - icon: src: /image/icons/tmdb-icon.png - title: TMDB Metadata Matching - details: Matches anime information via TMDB for accurate metadata, ensuring correct parsing even across multiple subtitle groups. + title: TMDB 元数据匹配 + details: 通过 TMDB 匹配番剧信息以获取准确的元数据,确保即使在多个字幕组之间也能正确解析。 - icon: src: /image/icons/plex-icon.png title: Plex / Jellyfin / Infuse ... - details: Automatically organizes file names and directory structure based on match results, ensuring high success rates for media library metadata scraping. + details: 根据匹配结果自动整理文件名和目录结构,确保媒体库软件能够高成功率地刮削元数据。 ---
-## Credits +## 鸣谢 -### Acknowledgments -Thanks to -- [Mikan Project](https://mikanani.me) for providing such a great anime resource. -- [VitePress](https://vitepress.dev) for providing a great documentation framework. -- [qBittorrent](https://www.qbittorrent.org) for providing a great downloader. -- [Plex](https://www.plex.tv) / [Jellyfin](https://jellyfin.org) for providing great self-hosted media libraries. -- [Infuse](https://firecore.com/infuse) for providing an elegant video player. -- [DanDan Play](https://www.dandanplay.com) for providing a great danmaku player. -- Every anime production team / translator team / fans. +### 致谢 +感谢 +- [Mikan Project](https://mikanani.me) 提供了如此优秀的番剧资源。 +- [VitePress](https://vitepress.dev) 提供了优秀的文档框架。 +- [qBittorrent](https://www.qbittorrent.org) 提供了优秀的下载器。 +- [Plex](https://www.plex.tv) / [Jellyfin](https://jellyfin.org) 提供了优秀的自托管媒体库。 +- [Infuse](https://firecore.com/infuse) 提供了优雅的视频播放器。 +- [弹弹 Play](https://www.dandanplay.com) 提供了优秀的弹幕播放器。 +- 每一个番剧制作组 / 字幕组 / 爱好者。 -### Contributors +### 贡献者 [ ![](https://contrib.rocks/image?repo=EstrellaXD/Auto_Bangumi){class=contributors-avatar} ](https://github.com/EstrellaXD/Auto_Bangumi/graphs/contributors) -## Disclaimer +## 免责声明 -Since AutoBangumi obtains anime through unofficial copyright channels: +由于 AutoBangumi 通过非官方版权渠道获取番剧: -- **Do not** use AutoBangumi for commercial purposes. -- **Do not** create video content featuring AutoBangumi for distribution on domestic video platforms (copyright stakeholders). -- **Do not** use AutoBangumi for any activity that violates laws or regulations. +- **请勿**将 AutoBangumi 用于商业用途。 +- **请勿**制作包含 AutoBangumi 的视频内容并在国内视频平台(版权相关方)上发布。 +- **请勿**将 AutoBangumi 用于任何违反法律法规的活动。