Per Joost's request, added Filemoon MP4
This commit is contained in:
parent
39ce1023c2
commit
f34580978b
|
@ -26,6 +26,7 @@ import { zoechipScraper } from '@/providers/sources/zoechip';
|
|||
import { bflixScraper } from './embeds/bflix';
|
||||
import { closeLoadScraper } from './embeds/closeload';
|
||||
import { fileMoonScraper } from './embeds/filemoon';
|
||||
import { fileMoonMp4Scraper } from './embeds/filemoon/mp4';
|
||||
import { ridooScraper } from './embeds/ridoo';
|
||||
import { smashyStreamOScraper } from './embeds/smashystream/opstream';
|
||||
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
||||
|
@ -92,6 +93,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||
ridooScraper,
|
||||
closeLoadScraper,
|
||||
fileMoonScraper,
|
||||
fileMoonMp4Scraper,
|
||||
vidplayScraper,
|
||||
wootlyScraper,
|
||||
doodScraper,
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
import { makeEmbed } from '../../base';
|
||||
|
||||
import { fileMoonScraper } from './index';
|
||||
|
||||
export const fileMoonMp4Scraper = makeEmbed({
|
||||
id: 'filemoon-mp4',
|
||||
name: 'Filemoon MP4',
|
||||
rank: 500,
|
||||
scrape: async (ctx) => {
|
||||
const result = await fileMoonScraper.scrape(ctx);
|
||||
|
||||
if (!result.stream) throw new NotFoundError('Failed to find result');
|
||||
|
||||
if (result.stream[0].type !== 'hls') throw new NotFoundError('Failed to find hls stream');
|
||||
|
||||
const url = result.stream[0].playlist.replace(/\/hls2\//, '/download/').replace(/\.m3u8/, '.mp4');
|
||||
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'file',
|
||||
qualities: {
|
||||
unknown: {
|
||||
type: 'mp4',
|
||||
url,
|
||||
},
|
||||
},
|
||||
flags: [],
|
||||
captions: result.stream[0].captions,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
|
@ -60,10 +60,16 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr
|
|||
const urlWithSubtitles = embedArr.find((v) => v.source === 'Vidplay' && v.url.includes('sub.info'))?.url;
|
||||
const subtitleUrl = urlWithSubtitles ? new URL(urlWithSubtitles).searchParams.get('sub.info') : null;
|
||||
if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl);
|
||||
embeds.push({
|
||||
embedId: 'filemoon',
|
||||
url: fullUrl.toString(),
|
||||
});
|
||||
embeds.push(
|
||||
{
|
||||
embedId: 'filemoon',
|
||||
url: fullUrl.toString(),
|
||||
},
|
||||
{
|
||||
embedId: 'filemoon-mp4',
|
||||
url: fullUrl.toString(),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue