♻️ refactor(bestdebrid): switch from browser login to cookie file import
Replace BrowserWindow-based login flow with Netscape cookie file import for BestDebrid authentication. Cloudflare Turnstile captcha cannot be solved in Electron's embedded browser, so users export cookies from their real browser and import them here. - Rewrite bestdebrid-web.ts: remove BrowserWindow/CDP code, add parseNetscapeCookieFile() and importCookiesFromFile() - Add file picker dialog for .txt cookie files in main IPC handler - Update IPC channel from OPEN_BESTDEBRID_LOGIN to IMPORT_BESTDEBRID_COOKIES - Update preload bridge and renderer UI with cookie import button - Fix pLabel scope in downloadToFile (pass as parameter from processItem) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d776ad589d
commit
153318274d
+11
-7
@@ -1156,13 +1156,17 @@ export function App(): ReactElement {
|
||||
});
|
||||
};
|
||||
|
||||
const onOpenBestDebridLogin = async (): Promise<void> => {
|
||||
const onImportBestDebridCookies = async (): Promise<void> => {
|
||||
await performQuickAction(async () => {
|
||||
await persistDraftSettings();
|
||||
await window.rd.openBestDebridLogin();
|
||||
showToast("BestDebrid Login-Fenster geöffnet", 2200);
|
||||
const count = await window.rd.importBestDebridCookies();
|
||||
if (count > 0) {
|
||||
showToast(`${count} BestDebrid-Cookies importiert`, 2200);
|
||||
} else {
|
||||
showToast("Keine Cookie-Datei ausgewählt", 2200);
|
||||
}
|
||||
}, (error) => {
|
||||
showToast(`BestDebrid Login fehlgeschlagen: ${String(error)}`, 2800);
|
||||
showToast(`BestDebrid Cookie-Import fehlgeschlagen: ${String(error)}`, 2800);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2854,11 +2858,11 @@ export function App(): ReactElement {
|
||||
<label className="toggle-line"><input type="checkbox" checked={settingsDraft.megaDebridPreferApi} onChange={(e) => setBool("megaDebridPreferApi", e.target.checked)} /> Mega-Debrid bevorzugt über API (schneller, Fallback auf Web)</label>
|
||||
<label>BestDebrid API Token</label>
|
||||
<input type="password" value={settingsDraft.bestToken} onChange={(e) => setText("bestToken", e.target.value)} />
|
||||
<label className="toggle-line"><input type="checkbox" checked={settingsDraft.bestDebridUseWebLogin} onChange={(e) => setBool("bestDebridUseWebLogin", e.target.checked)} /> BestDebrid per Web-Login statt API-Token verwenden</label>
|
||||
<label className="toggle-line"><input type="checkbox" checked={settingsDraft.bestDebridUseWebLogin} onChange={(e) => setBool("bestDebridUseWebLogin", e.target.checked)} /> BestDebrid per Cookie-Import statt API-Token verwenden</label>
|
||||
{settingsDraft.bestDebridUseWebLogin && (
|
||||
<>
|
||||
<div className="hint">Beim ersten Link oder über den Button unten öffnet sich ein BestDebrid-Browserfenster. Der Login läuft dort manuell über die Website.</div>
|
||||
<button className="btn" disabled={actionBusy} onClick={() => { void onOpenBestDebridLogin(); }}>BestDebrid Web-Login öffnen</button>
|
||||
<div className="hint">Exportiere deine BestDebrid-Cookies als Netscape-Textdatei (z.B. mit der Browser-Extension "Get cookies.txt LOCALLY") und importiere sie hier.</div>
|
||||
<button className="btn" disabled={actionBusy} onClick={() => { void onImportBestDebridCookies(); }}>BestDebrid Cookies importieren</button>
|
||||
</>
|
||||
)}
|
||||
<label>AllDebrid API Key</label>
|
||||
|
||||
Reference in New Issue
Block a user