fix: robust handle extraction — reject non-platform URLs, fix type safety

discover-channels: new extractHandle() validates each handle belongs to
its platform (rejects hospital-internal URLs like /idtube/view being
treated as YouTube). Extracts handles from full URLs correctly.

collect-channel-data: explicit Record<string,unknown> typing for DB JSON
fields — fixes TypeScript property access on VerifiedChannels from DB.

verifyHandles: fix TikTok double-URL concatenation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Opus 4.6 committed 2026-04-04 00:03:26 +09:00
1 parent 0d72750982
commit f65f0e85b3
3 files changed
+68 -16

No files matched your search

+2 -1
View File
@@ -228,7 +228,8 @@ export async function verifyAllHandles(
// TikTok — skip verification for now (TikTok blocks HEAD requests)
if (candidates.tiktok.length > 0) {
result.tiktok = { handle: candidates.tiktok[0], verified: false, url: `https://tiktok.com/@${candidates.tiktok[0]}` };
const tkHandle = candidates.tiktok[0].replace(/^@/, '');
result.tiktok = { handle: tkHandle, verified: false, url: `https://tiktok.com/@${tkHandle}` };
}
await Promise.allSettled(tasks);