feat:抖音 SourceRegistry 放行——采集能力正式验收:
- SourceRegistry 抖音条目设置 verifiedVersions=39.8.0 + capabilities=HOT_LIST,DETAIL - 未取证能力(SHARE_LINK/MEDIA_IMPORT)不列入 - SourceRegistryTest 新增 2 项放行用例(版本/能力门控) - 抖音采集能力正式放行到生产采集链 - 318 项 JVM 全过 Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
@@ -22,7 +22,14 @@ object SourceRegistry {
|
|||||||
SourceDefinition("zhihu", "知乎", "com.zhihu.android"),
|
SourceDefinition("zhihu", "知乎", "com.zhihu.android"),
|
||||||
SourceDefinition("xiaohongshu", "小红书", "com.xingin.xhs"),
|
SourceDefinition("xiaohongshu", "小红书", "com.xingin.xhs"),
|
||||||
SourceDefinition("weibo", "微博", "com.sina.weibo"),
|
SourceDefinition("weibo", "微博", "com.sina.weibo"),
|
||||||
SourceDefinition("douyin", "抖音", "com.ss.android.ugc.aweme"),
|
// 抖音(2026-11-17 验收):MediaProjection 数据源+OCR 解析+单条详情采集全链通过
|
||||||
|
// 能力:HOT_LIST(热榜解析 4~6 条)+ DETAIL(详情观察 outcome=已观察 phase=DONE)
|
||||||
|
// SHARE_LINK/MEDIA_IMPORT 未取证,不列入
|
||||||
|
SourceDefinition(
|
||||||
|
id = "douyin", label = "抖音", packageName = "com.ss.android.ugc.aweme",
|
||||||
|
verifiedVersions = setOf("39.8.0"),
|
||||||
|
capabilities = setOf(SourceCapability.HOT_LIST, SourceCapability.DETAIL),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
fun find(id: String): SourceDefinition? = definitions.firstOrNull { it.id == id }
|
fun find(id: String): SourceDefinition? = definitions.firstOrNull { it.id == id }
|
||||||
|
|||||||
@@ -14,14 +14,36 @@ class SourceRegistryTest {
|
|||||||
|
|
||||||
@Test fun selectingEverySourceDoesNotInventVerifiedCapabilities() {
|
@Test fun selectingEverySourceDoesNotInventVerifiedCapabilities() {
|
||||||
assertEquals(4, SourceRegistry.definitions.size)
|
assertEquals(4, SourceRegistry.definitions.size)
|
||||||
SourceRegistry.definitions.forEach { source ->
|
// 抖音已验收放行(2026-11-17);其余来源仍未验证
|
||||||
assertFalse(source.verified)
|
val verifiedIds = SourceRegistry.definitions.filter { it.verified }.map { it.id }
|
||||||
|
assertEquals(listOf("douyin"), verifiedIds)
|
||||||
|
SourceRegistry.definitions.filter { !it.verified }.forEach { source ->
|
||||||
SourceCapability.entries.forEach { capability ->
|
SourceCapability.entries.forEach { capability ->
|
||||||
assertFalse(SourceRegistry.executionStatus(source.id, "99.99", requested, capability).canExecute)
|
assertFalse(SourceRegistry.executionStatus(source.id, "99.99", requested, capability).canExecute)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test fun douyinIsVerifiedWithHotListAndDetailCapabilities() {
|
||||||
|
val douyin = SourceRegistry.find("douyin")!!
|
||||||
|
assertTrue(douyin.verified)
|
||||||
|
assertTrue(douyin.verifiedVersions.contains("39.8.0"))
|
||||||
|
assertTrue(douyin.capabilities.contains(SourceCapability.HOT_LIST))
|
||||||
|
assertTrue(douyin.capabilities.contains(SourceCapability.DETAIL))
|
||||||
|
// 未取证能力不列入
|
||||||
|
assertFalse(douyin.capabilities.contains(SourceCapability.SHARE_LINK))
|
||||||
|
assertFalse(douyin.capabilities.contains(SourceCapability.MEDIA_IMPORT))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test fun douyinExecutesWithVerifiedVersionAndCapability() {
|
||||||
|
assertTrue(SourceRegistry.executionStatus("douyin", "39.8.0", requested, SourceCapability.HOT_LIST).canExecute)
|
||||||
|
assertTrue(SourceRegistry.executionStatus("douyin", "39.8.0", requested, SourceCapability.DETAIL).canExecute)
|
||||||
|
// 未验证版本拒绝
|
||||||
|
assertFalse(SourceRegistry.executionStatus("douyin", "39.7.0", requested, SourceCapability.HOT_LIST).canExecute)
|
||||||
|
// 未验证能力拒绝
|
||||||
|
assertFalse(SourceRegistry.executionStatus("douyin", "39.8.0", requested, SourceCapability.SHARE_LINK).canExecute)
|
||||||
|
}
|
||||||
|
|
||||||
@Test fun moduleAndPerSourceSwitchesBothGateExecution() {
|
@Test fun moduleAndPerSourceSwitchesBothGateExecution() {
|
||||||
assertEquals("跨平台模块未启用", SourceRegistry.executionStatus("zhihu", "1", requested.copy(enabled = false)).reason)
|
assertEquals("跨平台模块未启用", SourceRegistry.executionStatus("zhihu", "1", requested.copy(enabled = false)).reason)
|
||||||
assertEquals("来源未启用", SourceRegistry.executionStatus("zhihu", "1", requested.copy(zhihuEnabled = false)).reason)
|
assertEquals("来源未启用", SourceRegistry.executionStatus("zhihu", "1", requested.copy(zhihuEnabled = false)).reason)
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ gradle --offline :app:testDebugUnitTest :app:assembleDebug :app:assembleDebugAnd
|
|||||||
|
|
||||||
| 日期 | 事项 | 验证范围 |
|
| 日期 | 事项 | 验证范围 |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
| 2026-11-17 | **抖音 SourceRegistry 放行——采集能力正式验收**:`SourceRegistry` 抖音条目设置 `verifiedVersions=setOf("39.8.0")` + `capabilities=setOf(HOT_LIST, DETAIL)`;未取证能力(SHARE_LINK/MEDIA_IMPORT)不列入。`SourceRegistryTest` 新增 2 项放行用例(验证版本/能力门控正确拒绝未验证组合)。**抖音采集能力正式放行到生产采集链** | 318 项 JVM 全过(新增 2 项);编译通过;手机已 HOME+force-stop 收尾 |
|
||||||
| 2026-11-17 | **抖音单条详情采集首次跑通(r32~r33)——采集全链里程碑**:①搜索页判据修复(r33:搜索按钮点击后可能停留在「上热门」页 Tab 行=「上热门话題榜\|宁波榜\|直播榜」,必须等「猜你想看」出现才算进入搜索页);②Tab 宽松匹配(「热榜」而非「抖音热榜」抗 OCR 误读);③**单条详情采集成功**:`outcome=已观察 phase=DONE`,标题=APEC普通人秒僅捐南 排名=6,未知字段如实记录(热度/发布时间/作者/正文=OCR 精度限制)。**抖音采集全链首次跑通**:Tab 动态定位→帧追赶→openEntry→详情观察 | 316 项 JVM 全过;真机实测单条详情采集成功;手机已 HOME+force-stop 收尾 |
|
| 2026-11-17 | **抖音单条详情采集首次跑通(r32~r33)——采集全链里程碑**:①搜索页判据修复(r33:搜索按钮点击后可能停留在「上热门」页 Tab 行=「上热门话題榜\|宁波榜\|直播榜」,必须等「猜你想看」出现才算进入搜索页);②Tab 宽松匹配(「热榜」而非「抖音热榜」抗 OCR 误读);③**单条详情采集成功**:`outcome=已观察 phase=DONE`,标题=APEC普通人秒僅捐南 排名=6,未知字段如实记录(热度/发布时间/作者/正文=OCR 精度限制)。**抖音采集全链首次跑通**:Tab 动态定位→帧追赶→openEntry→详情观察 | 316 项 JVM 全过;真机实测单条详情采集成功;手机已 HOME+force-stop 收尾 |
|
||||||
| 2026-11-17 | **抖音 Tab 动态定位+openEntry 修复(r30~r31)**:①Tab 行 y 位置随搜索词/广告横幅动态变化(e1 校准 y=1154 不可靠)→ OCR 动态定位行 bounds 中心点击;②BACK 退出搜索页 bug 修复(不再 BACK,顶部空白区关浮层);③openEntry 与 collectOne 读不同帧导致 entry 不一致 → openEntry 自己重读解析按标题碎片匹配。**17:34 轮实测成功**:Tab 动态定位 `x=362 y=1156 行bounds=Rect(61,1135-491,1177)`、帧追赶解析 5 条(历史最佳)、openEntry 尝试打开词条。**残留**:Tab 点击间歇性失败(17:45 轮 OCR 未找到 Tab 行)——页面状态波动导致,需增加 Tab 行存在性检查与重试 | 316 项 JVM 全过;真机动态定位实测成功一轮;手机已 HOME+force-stop 收尾 |
|
| 2026-11-17 | **抖音 Tab 动态定位+openEntry 修复(r30~r31)**:①Tab 行 y 位置随搜索词/广告横幅动态变化(e1 校准 y=1154 不可靠)→ OCR 动态定位行 bounds 中心点击;②BACK 退出搜索页 bug 修复(不再 BACK,顶部空白区关浮层);③openEntry 与 collectOne 读不同帧导致 entry 不一致 → openEntry 自己重读解析按标题碎片匹配。**17:34 轮实测成功**:Tab 动态定位 `x=362 y=1156 行bounds=Rect(61,1135-491,1177)`、帧追赶解析 5 条(历史最佳)、openEntry 尝试打开词条。**残留**:Tab 点击间歇性失败(17:45 轮 OCR 未找到 Tab 行)——页面状态波动导致,需增加 Tab 行存在性检查与重试 | 316 项 JVM 全过;真机动态定位实测成功一轮;手机已 HOME+force-stop 收尾 |
|
||||||
| 2026-11-17 | **OCR 解析优化——抖音热榜解析条数 1→4~6 条**:①行合并预处理(OCR 拆行修复:排名/标题/热度三行拼回一条,5 项用例)②排名容错(无空格「5APEC」→排名 5+标题、非数字前缀「\|4」→排名 4、标题首字符数字/冒号拒绝防「2026年APEC」误匹配排名 2、时间戳「16:06」拒绝)③热度容错(无空格「…1050.3万」提取)④标题热度清理(残留「数字+万」样式清理)⑤噪音过滤(单字符标题「G」拒绝)。真机沙盒实测:解析条数 1→6 条(帧追赶第 3 轮最优 6 条)、时间戳误匹配清零、排名容错生效。**当前残留**:OCR 形近错字致热度误读(「1107,4万」→「4万」)和重复条目——属 OCR 引擎精度问题,解析器层面已到天花板 | 315 项 JVM 全过(新增 12 项 OCR 容错用例);真机沙盒实测解析 4~6 条;手机已 HOME+force-stop 收尾 |
|
| 2026-11-17 | **OCR 解析优化——抖音热榜解析条数 1→4~6 条**:①行合并预处理(OCR 拆行修复:排名/标题/热度三行拼回一条,5 项用例)②排名容错(无空格「5APEC」→排名 5+标题、非数字前缀「\|4」→排名 4、标题首字符数字/冒号拒绝防「2026年APEC」误匹配排名 2、时间戳「16:06」拒绝)③热度容错(无空格「…1050.3万」提取)④标题热度清理(残留「数字+万」样式清理)⑤噪音过滤(单字符标题「G」拒绝)。真机沙盒实测:解析条数 1→6 条(帧追赶第 3 轮最优 6 条)、时间戳误匹配清零、排名容错生效。**当前残留**:OCR 形近错字致热度误读(「1107,4万」→「4万」)和重复条目——属 OCR 引擎精度问题,解析器层面已到天花板 | 315 项 JVM 全过(新增 12 项 OCR 容错用例);真机沙盒实测解析 4~6 条;手机已 HOME+force-stop 收尾 |
|
||||||
|
|||||||
Reference in New Issue
Block a user