diff --git a/backend/src/ingestion/youtubei.ts b/backend/src/ingestion/youtubei.ts index c1edbda..f921c45 100644 --- a/backend/src/ingestion/youtubei.ts +++ b/backend/src/ingestion/youtubei.ts @@ -306,10 +306,14 @@ function normalizeAction(action: any): ChatMessage | null { } } + // Extract channel ID from author object (item.author.id contains the YouTube channel ID) + const authorChannelId = item.author?.id; + return { id: String(item.id ?? item.timestamp_usec ?? Date.now()), author: String(item.author?.name ?? 'Unknown'), authorPhoto: item.author?.thumbnails?.[0]?.url, + authorChannelId: authorChannelId ? String(authorChannelId) : undefined, text: resolveMessageText(item), publishedAt: resolveTimestamp(item.timestamp ?? item.timestamp_usec), badges: badges.length > 0 ? badges : undefined, diff --git a/shared/chat.ts b/shared/chat.ts index 77e1cef..597e692 100644 --- a/shared/chat.ts +++ b/shared/chat.ts @@ -14,6 +14,7 @@ export type ChatMessage = { id: string; author: string; authorPhoto?: string; + authorChannelId?: string; text: string; publishedAt: string; badges?: Badge[];