mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-24 18:51:53 +01:00
Limit stream types to mp4 or m3u8 for gomostream
This commit is contained in:
parent
4eacd9f0c9
commit
e30f2ee457
@ -88,7 +88,10 @@ export const gomostreamScraper: MWMediaProvider = {
|
|||||||
const index = unpacked.findIndex((e) => e === '"');
|
const index = unpacked.findIndex((e) => e === '"');
|
||||||
const streamUrl = unpacked.slice(0, index).join('');
|
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> {
|
async getSeasonDataFromMedia(media: MWPortableMedia): Promise<MWMediaSeasons> {
|
||||||
|
@ -20,8 +20,7 @@ export interface MWMediaCaption {
|
|||||||
}
|
}
|
||||||
export interface MWMediaStream {
|
export interface MWMediaStream {
|
||||||
url: string;
|
url: string;
|
||||||
// type: MWMediaStreamType;
|
type: MWMediaStreamType;
|
||||||
type: string;
|
|
||||||
captions: MWMediaCaption[];
|
captions: MWMediaCaption[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user