Better error handling for superstream

This commit is contained in:
mrjvs
2023-12-02 00:51:41 +01:00
parent fee543642e
commit 2f02522ca6
2 changed files with 4 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ export const superStreamScraper = makeSourcerer({
}; };
const { qualities, fid } = await getStreamQualities(ctx, apiQuery); const { qualities, fid } = await getStreamQualities(ctx, apiQuery);
if (fid === undefined) throw new NotFoundError('No streamable file found');
return { return {
embeds: [], embeds: [],
@@ -90,6 +91,7 @@ export const superStreamScraper = makeSourcerer({
}; };
const { qualities, fid } = await getStreamQualities(ctx, apiQuery); const { qualities, fid } = await getStreamQualities(ctx, apiQuery);
if (fid === undefined) throw new NotFoundError('No streamable file found');
return { return {
embeds: [], embeds: [],

View File

@@ -31,10 +31,10 @@ export async function getSubtitles(
tid: type !== 'movie' ? id : undefined, tid: type !== 'movie' ? id : undefined,
episode: episodeId?.toString(), episode: episodeId?.toString(),
season: seasonId?.toString(), season: seasonId?.toString(),
group: episodeId ? '' : undefined,
}; };
const subtitleList = ((await sendRequest(ctx, subtitleApiQuery)) as CaptionApiResponse).data.list; const subResult = (await sendRequest(ctx, subtitleApiQuery)) as CaptionApiResponse;
const subtitleList = subResult.data.list;
const output: Caption[] = []; const output: Caption[] = [];
subtitleList.forEach((sub) => { subtitleList.forEach((sub) => {