From 5391ebda855a371af79985baf82ebd3b0eb487e3 Mon Sep 17 00:00:00 2001 From: chrisk325 Date: Sun, 1 Mar 2026 18:24:18 +0530 Subject: [PATCH] add wview fallback as well --- src/services/youtubeExtractor.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/services/youtubeExtractor.ts b/src/services/youtubeExtractor.ts index 50eaebbe..c01aeda3 100644 --- a/src/services/youtubeExtractor.ts +++ b/src/services/youtubeExtractor.ts @@ -109,6 +109,19 @@ const TVHTML5_EMBEDDED_CONTEXT = { }, }; +// Web Embedded client — good fallback for content that rejects app clients +const WEB_EMBEDDED_CONTEXT = { + client: { + clientName: 'WEB_EMBEDDED_PLAYER', + clientVersion: '2.20240726.00.00', + hl: 'en', + gl: 'US', + }, + thirdParty: { + embedUrl: 'https://www.youtube.com', + }, +}; + // --------------------------------------------------------------------------- // Itag reference tables // --------------------------------------------------------------------------- @@ -503,6 +516,11 @@ export class YouTubeExtractor { context: TVHTML5_EMBEDDED_CONTEXT, userAgent: 'Mozilla/5.0 (SMART-TV; Linux; Tizen 6.0)', }, + { + name: 'WEB_EMBEDDED', + context: WEB_EMBEDDED_CONTEXT, + userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36', + }, ]; let muxedFormats: InnertubeFormat[] = [];