mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-30 17:40:53 -07:00
feat(youtube): add mediaCache mode and safer stream media extraction (#130)
This commit is contained in:
@@ -111,6 +111,10 @@ export const CORE_DEFAULT_CONFIG: Pick<
|
||||
},
|
||||
youtube: {
|
||||
primarySubLanguages: ['ja', 'jpn'],
|
||||
mediaCache: {
|
||||
mode: 'direct',
|
||||
maxHeight: 720,
|
||||
},
|
||||
},
|
||||
subsync: {
|
||||
alass_path: '',
|
||||
|
||||
@@ -119,6 +119,24 @@ export function buildCoreConfigOptionRegistry(
|
||||
description:
|
||||
'Comma-separated primary subtitle language priority for managed subtitle auto-selection.',
|
||||
},
|
||||
{
|
||||
path: 'youtube.mediaCache.mode',
|
||||
kind: 'enum',
|
||||
enumValues: ['direct', 'background'],
|
||||
enumLabels: {
|
||||
direct: 'Direct stream extraction',
|
||||
background: 'Background media cache',
|
||||
},
|
||||
defaultValue: defaultConfig.youtube.mediaCache.mode,
|
||||
description: 'How YouTube card audio/images are extracted.',
|
||||
},
|
||||
{
|
||||
path: 'youtube.mediaCache.maxHeight',
|
||||
kind: 'number',
|
||||
defaultValue: defaultConfig.youtube.mediaCache.maxHeight,
|
||||
description:
|
||||
'Maximum video height downloaded for the YouTube background media cache. Set to 0 for unlimited.',
|
||||
},
|
||||
{
|
||||
path: 'controller.enabled',
|
||||
kind: 'boolean',
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface ConfigOptionRegistryEntry {
|
||||
* `osd` and `osd-system` in NOTIFICATION_TYPE_VALUES.
|
||||
*/
|
||||
enumValues?: readonly string[];
|
||||
enumLabels?: Record<string, string>;
|
||||
/**
|
||||
* Optional settings UI subset when legacy/runtime-valid enum options should remain
|
||||
* editable in config files but hidden from new UI choices, for example
|
||||
|
||||
Reference in New Issue
Block a user