diff --git a/supabase/functions/_shared/verifyHandles.ts b/supabase/functions/_shared/verifyHandles.ts index 1dd95c2..7812189 100644 --- a/supabase/functions/_shared/verifyHandles.ts +++ b/supabase/functions/_shared/verifyHandles.ts @@ -190,10 +190,10 @@ export async function verifyAllHandles( tiktok: null, }; - // Instagram — verify each candidate + // Instagram — verify each candidate, keep unverified as fallback for (const handle of candidates.instagram.slice(0, 5)) { tasks.push( - verifyInstagram(handle).then(v => { if (v.verified) result.instagram.push(v); }) + verifyInstagram(handle).then(v => { result.instagram.push(v); }) ); } diff --git a/supabase/functions/collect-channel-data/index.ts b/supabase/functions/collect-channel-data/index.ts index e3f2e17..1221432 100644 --- a/supabase/functions/collect-channel-data/index.ts +++ b/supabase/functions/collect-channel-data/index.ts @@ -72,12 +72,12 @@ Deno.serve(async (req) => { const analysisData: Record = {}; const tasks: Promise[] = []; - // ─── 1. Instagram (multi-account) ─── - const igVerified = (verified.instagram || []).filter((v: Record) => v.verified && v.handle); - if (APIFY_TOKEN && igVerified.length > 0) { + // ─── 1. Instagram (multi-account) — try ALL candidates including unverified ─── + const igCandidates = (verified.instagram || []).filter((v: Record) => v.handle); + if (APIFY_TOKEN && igCandidates.length > 0) { tasks.push((async () => { const accounts: Record[] = []; - for (const ig of igVerified) { + for (const ig of igCandidates) { const items = await runApifyActor("apify~instagram-profile-scraper", { usernames: [ig.handle], resultsLimit: 12 }, APIFY_TOKEN); const profile = (items as Record[])[0]; if (profile && !profile.error) {