feat(subtitles): 字幕站(SubHD、字幕库)在线搜索与下载;rar / 7z 解压;验证码与页面解析在沙箱里
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
92d456d123
commit
59b3680f35
32 files changed
+1704
-166
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import type { Kysely } from "kysely";
|
||||
import { execDdl, oneOf } from "../src/migration-helpers.ts";
|
||||
|
||||
// 字幕站(docs/plan/subtitles.md 第 2 步):站点类型 subtitle、适配器 subtitle(SubHD、字幕库),
|
||||
// 复用站点的代理 / 限流 / 健康 / 浏览器会话;不参与资源搜索、快照、RSS。
|
||||
const KINDS = ["pt", "public_bt", "rss_feed", "torznab", "subtitle"];
|
||||
const ADAPTERS = ["nexusphp", "mteam_api", "api", "generic_rss", "subtitle"];
|
||||
const OLD_KINDS = ["pt", "public_bt", "rss_feed", "torznab"];
|
||||
const OLD_ADAPTERS = ["nexusphp", "mteam_api", "api", "generic_rss"];
|
||||
|
||||
// biome-ignore lint/suspicious/noExplicitAny: 迁移不依赖应用表类型
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await execDdl(
|
||||
db,
|
||||
`alter table site drop constraint if exists site_kind_check;
|
||||
alter table site add constraint site_kind_check ${oneOf("kind", KINDS)};
|
||||
alter table site drop constraint if exists site_adapter_check;
|
||||
alter table site add constraint site_adapter_check ${oneOf("adapter", ADAPTERS)};`,
|
||||
);
|
||||
}
|
||||
// biome-ignore lint/suspicious/noExplicitAny: 同上
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await execDdl(
|
||||
db,
|
||||
`delete from site where kind = 'subtitle';
|
||||
alter table site drop constraint if exists site_kind_check;
|
||||
alter table site add constraint site_kind_check ${oneOf("kind", OLD_KINDS)};
|
||||
alter table site drop constraint if exists site_adapter_check;
|
||||
alter table site add constraint site_adapter_check ${oneOf("adapter", OLD_ADAPTERS)};`,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user