Add vadapav file (idk how to test this)
This commit is contained in:
parent
3d0207a0db
commit
f2a9b8c966
11390
.docs/pnpm-lock.yaml
11390
.docs/pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -64,6 +64,7 @@ import { primewireScraper } from './sources/primewire';
|
|||
import { ridooMoviesScraper } from './sources/ridomovies';
|
||||
import { smashyStreamScraper } from './sources/smashystream';
|
||||
import { soaperTvScraper } from './sources/soapertv';
|
||||
import { vadapavScraper } from './sources/vadapav';
|
||||
import { vidSrcToScraper } from './sources/vidsrcto';
|
||||
import { warezcdnScraper } from './sources/warezcdn';
|
||||
|
||||
|
@ -71,6 +72,7 @@ export function gatherAllSources(): Array<Sourcerer> {
|
|||
// all sources are gathered here
|
||||
return [
|
||||
catflixScraper,
|
||||
vadapavScraper,
|
||||
flixhqScraper,
|
||||
remotestreamScraper,
|
||||
kissAsianScraper,
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
const searchUrl = `https://vadapav.mov/s/${encodeURIComponent(ctx.media.title)}`;
|
||||
const htmlContent = await ctx.fetcher(searchUrl);
|
||||
const regex = new RegExp(`<a class="directory-entry wrap" href="(.*)">${ctx.media.title}</a>`);
|
||||
const match = htmlContent.match(regex);
|
||||
|
||||
if (!match || match.length < 2) throw new NotFoundError('No matching link found');
|
||||
|
||||
const endpoint = match[1];
|
||||
const pageContent = await ctx.fetcher(endpoint);
|
||||
const seasonEpisodeRegex = /S(\d+)E(\d+)/i;
|
||||
const seasonEpisodeMatch = pageContent.match(seasonEpisodeRegex);
|
||||
|
||||
if (!seasonEpisodeMatch) throw new NotFoundError('Season and Episode number not found');
|
||||
const seasonNumber = seasonEpisodeMatch[1].padStart(2, '0');
|
||||
const episodeNumber = seasonEpisodeMatch[2].padStart(2, '0');
|
||||
const embeds = [
|
||||
{
|
||||
embedId: `${seasonNumber}${episodeNumber}`,
|
||||
url: `${searchUrl}|${endpoint}`,
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
embeds,
|
||||
};
|
||||
}
|
||||
|
||||
export const vadapavScraper = makeSourcerer({
|
||||
id: 'vadapav',
|
||||
name: 'Vadapav',
|
||||
rank: 135,
|
||||
flags: [],
|
||||
disabled: false,
|
||||
scrapeMovie: comboScraper,
|
||||
scrapeShow: comboScraper,
|
||||
});
|
Loading…
Reference in New Issue