From 7a190b7d35781c4db336c55d72146d77b093fd81 Mon Sep 17 00:00:00 2001 From: Gigi Date: Mon, 13 Oct 2025 19:43:04 +0200 Subject: [PATCH] fix(api): be more lenient extracting YouTube description from details fields --- api/youtube-meta.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/youtube-meta.ts b/api/youtube-meta.ts index eda1e6ed..d9ef0dbe 100644 --- a/api/youtube-meta.ts +++ b/api/youtube-meta.ts @@ -56,8 +56,8 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { try { const details = await getVideoDetails({ videoID: videoId, lang }) - const title = details?.title || '' - const description = details?.description || '' + const title = (details as any)?.title || '' + const description = (details as any)?.description || (details as any)?.shortDescription || (details as any)?.descriptionText || '' // Language order: manual en -> uiLocale -> lang -> any manual, then auto with same order const langs: string[] = Array.from(new Set(['en', uiLocale, lang].filter(Boolean) as string[]))