diff --git a/apps/api-daemon/src/youtubePolling.ts b/apps/api-daemon/src/youtubePolling.ts index 91a9b01..2e471b1 100644 --- a/apps/api-daemon/src/youtubePolling.ts +++ b/apps/api-daemon/src/youtubePolling.ts @@ -65,10 +65,12 @@ async function findLiveVideoId(channelId: string): Promise { const match = html.match(/"videoDetails":\{"videoId":"([^"]+)"/); const hasConsentForm = /action="https:\/\/consent\.youtube\.com/.test(html); + const playabilityMatch = html.match(/"playabilityStatus":\{"status":"([^"]*)"(?:,"reason":"([^"]*)")?/); lastPollDebug.set( channelId, `finalUrl=${res.url} htmlLength=${html.length} cookieSent=${Boolean(cookieHeader)} ` + - `hasVideoDetails=${Boolean(match)} hasConsentForm=${hasConsentForm}`, + `hasVideoDetails=${Boolean(match)} hasConsentForm=${hasConsentForm} ` + + `playability=${playabilityMatch ? `${playabilityMatch[1]}/${playabilityMatch[2] ?? ""}` : "n/a"}`, ); if (!match) return null;