mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-30 17:40:53 -07:00
feat(youtube): add YouTube browser window and Whisper subtitle source (#273)
This commit is contained in:
@@ -115,6 +115,7 @@ export const CORE_DEFAULT_CONFIG: Pick<
|
||||
},
|
||||
youtube: {
|
||||
primarySubLanguages: ['ja', 'jpn'],
|
||||
subtitleSource: 'youtube',
|
||||
mediaCache: {
|
||||
mode: 'direct',
|
||||
maxHeight: 720,
|
||||
|
||||
@@ -13,7 +13,6 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
|
||||
| 'jellyfin'
|
||||
| 'discordPresence'
|
||||
| 'ai'
|
||||
| 'youtubeSubgen'
|
||||
> = {
|
||||
ankiConnect: {
|
||||
enabled: true,
|
||||
@@ -179,15 +178,4 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
|
||||
'You are a translation engine. Return only the translated text with no explanations.',
|
||||
requestTimeoutMs: 15_000,
|
||||
},
|
||||
youtubeSubgen: {
|
||||
whisperBin: '',
|
||||
whisperModel: '',
|
||||
whisperVadModel: '',
|
||||
whisperThreads: 4,
|
||||
fixWithAi: false,
|
||||
ai: {
|
||||
model: '',
|
||||
systemPrompt: '',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -85,13 +85,6 @@ const UNDOCUMENTED_LEAVES: ReadonlySet<string> = new Set([
|
||||
'subtitleStyle.textShadow',
|
||||
'subtitleStyle.WebkitTextStroke',
|
||||
'subtitleStyle.wordSpacing',
|
||||
'youtubeSubgen.ai.model',
|
||||
'youtubeSubgen.ai.systemPrompt',
|
||||
'youtubeSubgen.fixWithAi',
|
||||
'youtubeSubgen.whisperBin',
|
||||
'youtubeSubgen.whisperModel',
|
||||
'youtubeSubgen.whisperThreads',
|
||||
'youtubeSubgen.whisperVadModel',
|
||||
]);
|
||||
|
||||
test('config option registry includes critical paths and has unique entries', () => {
|
||||
|
||||
@@ -119,6 +119,18 @@ export function buildCoreConfigOptionRegistry(
|
||||
description:
|
||||
'Comma-separated primary subtitle language priority for managed subtitle auto-selection.',
|
||||
},
|
||||
{
|
||||
path: 'youtube.subtitleSource',
|
||||
kind: 'enum',
|
||||
enumValues: ['youtube', 'whisper'],
|
||||
enumLabels: {
|
||||
youtube: 'Download YouTube captions',
|
||||
whisper: 'Generate with Whisper',
|
||||
},
|
||||
defaultValue: defaultConfig.youtube.subtitleSource,
|
||||
description:
|
||||
'Where primary YouTube subtitles come from. Whisper transcribes the audio locally using the subtitleGeneration settings.',
|
||||
},
|
||||
{
|
||||
path: 'youtube.mediaCache.mode',
|
||||
kind: 'enum',
|
||||
|
||||
@@ -183,7 +183,9 @@ const INTEGRATION_TEMPLATE_SECTIONS: ConfigTemplateSection[] = [
|
||||
description: [
|
||||
'Defaults for managed subtitle language preferences and YouTube subtitle loading.',
|
||||
],
|
||||
notes: ['Hot-reload: primarySubLanguages applies to the next YouTube subtitle load.'],
|
||||
notes: [
|
||||
'Hot-reload: primarySubLanguages and subtitleSource apply to the next YouTube subtitle load.',
|
||||
],
|
||||
key: 'youtube',
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user