diff --git a/common/whisperx.ts b/common/whisperx.ts index 6c2e2b3..17c84a6 100644 --- a/common/whisperx.ts +++ b/common/whisperx.ts @@ -46,7 +46,11 @@ export function makeWhisperXTranscriptsPath( category: CategoryId, videoId: VideoId, language: Iso6393Code): string { - const iso6391Code = langs.where('3', language)['1']; + const iso6391Code = langs.where('3', language)?.['1']; + if (!iso6391Code) { + throw new Error(`Unsupported language code: ${language}`); + } + return makePublicPath( category, Constants.WHISPERX_ARCHIVE_SUBDIR,