mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-29 17:40:50 -07:00
feat(youtube): add YouTube browser window and Whisper subtitle source (#273)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user