feat(youtube): add YouTube browser window and Whisper subtitle source (#273)

This commit is contained in:
2026-09-28 20:35:47 -07:00
committed by GitHub
parent c68b73c8c1
commit 07b32626a6
101 changed files with 2269 additions and 726 deletions
+14
View File
@@ -4,6 +4,7 @@ import {
launchTexthookerOnly,
runAppCommandWithInherit,
} from '../mpv.js';
import { shouldForwardLogLevel } from '../types.js';
import type { LauncherCommandContext } from './context.js';
type AppCommandDeps = {
@@ -12,6 +13,10 @@ type AppCommandDeps = {
appPath: string,
logLevel: LauncherCommandContext['args']['logLevel'],
) => void;
launchYoutubeBrowserDetached: (
appPath: string,
logLevel: LauncherCommandContext['args']['logLevel'],
) => void;
launchAppBackgroundDetached: (
appPath: string,
logLevel: LauncherCommandContext['args']['logLevel'],
@@ -22,6 +27,11 @@ const defaultAppCommandDeps: AppCommandDeps = {
runAppCommandWithInherit,
launchSyncUiDetached: (appPath, logLevel) =>
launchAppCommandDetached(appPath, ['--sync-window'], logLevel, 'sync-ui'),
launchYoutubeBrowserDetached: (appPath, logLevel) => {
const appArgs = ['--youtube-browser'];
if (shouldForwardLogLevel(logLevel)) appArgs.push('--log-level', logLevel);
launchAppCommandDetached(appPath, appArgs, logLevel, 'youtube-browser');
},
launchAppBackgroundDetached,
};
@@ -41,6 +51,10 @@ export function runAppPassthroughCommand(
deps.launchSyncUiDetached(appPath, args.logLevel);
return true;
}
if (args.youtubeBrowser) {
deps.launchYoutubeBrowserDetached(appPath, args.logLevel);
return true;
}
if (!args.appPassthrough) {
return false;
}