Browse Source

Limit stream types to mp4 or m3u8 for gomostream

pull/60/head
James Hawkins 3 years ago
parent
commit
e30f2ee457
  1. 5
      src/providers/list/gomostream/index.ts
  2. 3
      src/providers/types.ts

5
src/providers/list/gomostream/index.ts

@ -88,7 +88,10 @@ export const gomostreamScraper: MWMediaProvider = { @@ -88,7 +88,10 @@ export const gomostreamScraper: MWMediaProvider = {
const index = unpacked.findIndex((e) => e === '"');
const streamUrl = unpacked.slice(0, index).join('');
return { url: streamUrl, type: streamUrl.split('.').at(-1) || "mp4", captions: [] };
const streamType = streamUrl.split('.').at(-1);
if (streamType !== "mp4" && streamType !== "m3u8") throw new Error("Unsupported stream type");
return { url: streamUrl, type: streamType, captions: [] };
},
async getSeasonDataFromMedia(media: MWPortableMedia): Promise<MWMediaSeasons> {

3
src/providers/types.ts

@ -20,8 +20,7 @@ export interface MWMediaCaption { @@ -20,8 +20,7 @@ export interface MWMediaCaption {
}
export interface MWMediaStream {
url: string;
// type: MWMediaStreamType;
type: string;
type: MWMediaStreamType;
captions: MWMediaCaption[];
}

Loading…
Cancel
Save