@mkterswingman/5mghost-yonder 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/subtitles.js +7 -0
- package/package.json +1 -1
package/dist/tools/subtitles.js
CHANGED
|
@@ -362,6 +362,10 @@ export async function downloadSubtitlesForLanguages(input) {
|
|
|
362
362
|
input.onProgress?.(completed, total);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
+
const hasAnySubtitleFiles = Object.values(filesByFormat).some((files) => files.length > 0);
|
|
366
|
+
if (!hasAnySubtitleFiles) {
|
|
367
|
+
throw new Error(`No subtitles found for requested languages: ${input.languages.join(", ")}`);
|
|
368
|
+
}
|
|
365
369
|
return filesByFormat;
|
|
366
370
|
}
|
|
367
371
|
function isUnavailableSubtitleError(error) {
|
|
@@ -459,6 +463,9 @@ export function registerSubtitleTools(server, config, tokenManager) {
|
|
|
459
463
|
});
|
|
460
464
|
}
|
|
461
465
|
}
|
|
466
|
+
if (results.length === 0) {
|
|
467
|
+
return toolErr("NO_SUBTITLES", `No subtitles found for requested languages: ${langs.join(", ")}`);
|
|
468
|
+
}
|
|
462
469
|
return toolOk({
|
|
463
470
|
status: "completed",
|
|
464
471
|
video_id: videoId,
|