mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-30 07:21:32 -07:00
feat(youtube): add mediaCache mode and safer stream media extraction
- Add `youtube.mediaCache.mode` config option (`direct` | `background`) - Resolve EDL stream URLs to single audio/video URLs before ffmpeg extraction - Pass reconnect, user-agent, and safe headers to ffmpeg for remote streams - Add background yt-dlp media cache with fallback to direct extraction - Introduce `MediaInput` structured type replacing bare path strings
This commit is contained in:
@@ -93,3 +93,32 @@ test('select controls show config-only current values without offering them othe
|
||||
restoreDocument();
|
||||
}
|
||||
});
|
||||
|
||||
test('select controls use configured option labels', () => {
|
||||
const restoreDocument = installDocumentStub();
|
||||
try {
|
||||
const field = {
|
||||
...createSelectField(),
|
||||
enumValues: ['direct', 'background'],
|
||||
enumLabels: {
|
||||
direct: 'Direct stream extraction',
|
||||
background: 'Background media cache',
|
||||
},
|
||||
} as ConfigSettingsField & { enumLabels: Record<string, string> };
|
||||
|
||||
const control = renderControl(field, {
|
||||
valueForField: () => 'direct',
|
||||
valueForPath: () => undefined,
|
||||
updateDraft: () => {},
|
||||
resetDraftPath: () => {},
|
||||
setFieldError: () => {},
|
||||
}) as HTMLSelectElement;
|
||||
|
||||
assert.deepEqual(
|
||||
Array.from(control.options).map((option) => option.textContent),
|
||||
['Direct stream extraction', 'Background media cache'],
|
||||
);
|
||||
} finally {
|
||||
restoreDocument();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user