Fix cookie fallback breaking yt-dlp in Docker; add OAuth2 auth flow

- _cookie_args() no longer falls through to --cookies-from-browser when
  cookies_file is configured but missing. Firefox isn't installed in the
  Docker image, so that fallback caused yt-dlp to exit with empty stdout
  and every metadata fetch to return "Video not found on YouTube".
- fetch_video_metadata() now retries without auth args if the first call
  fails, so a broken cookie config can't block public video fetches.
- Add use_oauth2 setting + full device-auth flow (POST /settings/oauth2-init,
  GET /settings/oauth2-status) with OAuth2Section UI in Settings page.
- Add GET /settings/ytdlp-test diagnostics endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mattias Tall
2026-05-26 09:53:02 +02:00
parent b3284b35da
commit 98d986cd95
6 changed files with 336 additions and 13 deletions

View File

@@ -107,6 +107,11 @@ export const uploadCookiesFile = (file) => {
return api.post("/settings/cookies-file", form);
};
export const deleteCookiesFile = () => api.delete("/settings/cookies-file");
export const initOAuth2 = () => api.post("/settings/oauth2-init");
export const getOAuth2Status = () => api.get("/settings/oauth2-status");
export const enableOAuth2 = () => api.post("/settings/oauth2-enable");
export const disableOAuth2 = () => api.post("/settings/oauth2-disable");
export const testYtdlp = () => api.get("/settings/ytdlp-test");
// Discovery
export const getDiscovery = (offset = 0, limit = 50) =>