From 90c73c4091df498d2e3581de7e274a07e2cb327a Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Fri, 6 Mar 2026 11:29:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(bestdebrid):=20set=20user=20?= =?UTF-8?q?agent=20on=20session=20and=20webContents=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cloudflare Turnstile blocks Electron's default user agent. Set a Chrome user agent on both the session and webContents level so the login captcha passes correctly. Co-Authored-By: Claude Opus 4.6 --- src/main/bestdebrid-web.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/bestdebrid-web.ts b/src/main/bestdebrid-web.ts index 29ba1c4..cf7e1a2 100644 --- a/src/main/bestdebrid-web.ts +++ b/src/main/bestdebrid-web.ts @@ -173,6 +173,10 @@ export class BestDebridWebFallback { existing.close(); } + // Set user agent on session level so Cloudflare Turnstile sees a real Chrome + const currentSession = session.fromPartition(partition); + currentSession.setUserAgent(BESTDEBRID_USER_AGENT); + const window = new BrowserWindow({ width: 1120, height: 900, @@ -186,6 +190,7 @@ export class BestDebridWebFallback { nodeIntegration: false } }); + window.webContents.setUserAgent(BESTDEBRID_USER_AGENT); window.setMenuBarVisibility(false); window.on("closed", () => { if (this.loginWindow === window) {