feat(sandbox): 不可信字节在沙箱子进程里解析(撤销权限、超时与内存强杀);种子、文件预览、字幕解析迁入
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1a76d2d700
commit
eeec91e892
21 files changed
+632
-178
No files matched your search
@@ -9,6 +9,8 @@
|
||||
* - `app/modules/indexer/parser/mtorrent.py`(api/member/profile)→ `healthCheck`
|
||||
* 详情 `/api/torrent/detail` 为本项目扩展(MP spider 无详情调用,字段结构参考 MovieClaw mteam.py,data-ref)。
|
||||
*/
|
||||
|
||||
import { inspectTorrentIsolated } from "../../isolation.ts";
|
||||
import { redactUrl } from "../../rss/redact.ts";
|
||||
import { buildHttpContext, type SiteAdapterDeps } from "../deps.ts";
|
||||
import { pageFromBbcode } from "../detail-text.ts";
|
||||
@@ -26,7 +28,7 @@ import {
|
||||
type SiteRelease,
|
||||
type SiteReleaseDetail,
|
||||
} from "../types.ts";
|
||||
import { extractDoubanId, inspectTorrent, parseSiteTime } from "../util.ts";
|
||||
import { extractDoubanId, parseSiteTime } from "../util.ts";
|
||||
import { mteamPost } from "./client.ts";
|
||||
import { type MteamDefinition, mteamApiBase } from "./definition.ts";
|
||||
import { type MteamTorrentJson, mteamSearchParams, parseMteamResult } from "./spider.ts";
|
||||
@@ -192,7 +194,7 @@ export function createMteamAdapter(input: MteamDefinition, deps: SiteAdapterDeps
|
||||
);
|
||||
}
|
||||
const bytes = await readBody(http, res);
|
||||
const info = inspectTorrent(bytes);
|
||||
const info = await inspectTorrentIsolated(bytes);
|
||||
if (!info) throw new SiteError(def.id, "parse_error", `下载 ${id}:返回内容不是 .torrent`);
|
||||
return {
|
||||
kind: "torrent",
|
||||
|
||||
Reference in new issue
Block a user