feat(identity): source-aware short-drama enrichment with snippet mode and hit rate (META-2)
- classify enrich sources: encyclopedia, platform pages (hongguo, kuaikaw, video platforms), douban (search snippet only) and other sites' search snippets (snippet mode, pages never opened); one extractor per source, fields carry source kind and confidence, merged by noisy-OR across hosts - new cast field (applied as MediaCredit with placeholder ids) - robots.txt check (cached per host 1 day) and login-wall/captcha give-up - per-enrichment source attempts + GET /identity/enrich-stats, 30-day hit-rate table under settings -> metadata -> identity - setting identity.enrichSnippetAllSites (default on); default domains add baike.com and kuaikaw.cn - replay fixtures from the real run on the 4 user-library short dramas (sanitized Brave responses, hongguo page, robots.txt) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
081db4651c
commit
9489e40e0c
23 files changed
+2615
-323
No files matched your search
@@ -452,6 +452,9 @@ export const DEFAULT_ENRICH_DOMAINS: string[] = [
|
||||
"ixigua.com",
|
||||
"baike.sogou.com",
|
||||
"mydramalist.com",
|
||||
// META-2:快懂百科、河马剧场(短剧平台公开作品页);红果短剧的 /series/ 页 robots 不允许,只读 robots 放行的页面
|
||||
"baike.com",
|
||||
"kuaikaw.cn",
|
||||
];
|
||||
|
||||
export const IdentitySettings = z.object({
|
||||
@@ -475,6 +478,11 @@ export const IdentitySettings = z.object({
|
||||
.regex(/^[a-z0-9.-]+\.[a-z]{2,}$/),
|
||||
)
|
||||
.max(100),
|
||||
/**
|
||||
* META-2 摘要模式:白名单外网站(多为短剧聚合站)的搜索结果摘要也用来抽字段(只读搜索引擎给的摘要,不打开这些网页)。
|
||||
* 缺省开;关掉后只用白名单网站的摘要与网页。旧设置没有这个键,按开处理
|
||||
*/
|
||||
enrichSnippetAllSites: z.boolean().optional(),
|
||||
});
|
||||
export type IdentitySettings = z.infer<typeof IdentitySettings>;
|
||||
|
||||
@@ -668,6 +676,7 @@ export const DEFAULT_SETTINGS: GlobalSettings = {
|
||||
autoEnrich: false,
|
||||
enrichDailyBudget: 20,
|
||||
enrichDomains: DEFAULT_ENRICH_DOMAINS,
|
||||
enrichSnippetAllSites: true,
|
||||
},
|
||||
search: { defaultSiteMode: "default", siteIds: [] },
|
||||
storage: DEFAULT_STORAGE_SETTINGS,
|
||||
@@ -960,6 +969,7 @@ export const SETTINGS_SECTIONS: readonly SettingsSectionDef[] = [
|
||||
"identity.autoEnrich",
|
||||
"identity.enrichDailyBudget",
|
||||
"identity.enrichDomains",
|
||||
"identity.enrichSnippetAllSites",
|
||||
"cache.globalImageCache",
|
||||
"cache.globalImageCacheDays",
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user