Add theyallsayflix source
Some checks are pending
Testing / Testing (push) Waiting to run

This commit is contained in:
TPN 2025-01-10 10:23:42 +00:00
parent ef7a4c8bde
commit 88f8842006
2 changed files with 63 additions and 0 deletions

View file

@ -29,6 +29,7 @@ import { nsbxScraper } from '@/providers/sources/nsbx';
import { redStarScraper } from '@/providers/sources/redstar';
import { remotestreamScraper } from '@/providers/sources/remotestream';
import { showboxScraper } from '@/providers/sources/showbox/index';
import { TASFScraper } from '@/providers/sources/theyallsayflix';
import { tugaflixScraper } from '@/providers/sources/tugaflix';
import { vidsrcScraper } from '@/providers/sources/vidsrc/index';
import { vidsrcsuScraper } from '@/providers/sources/vidsrcsu';
@ -106,6 +107,7 @@ export function gatherAllSources(): Array<Sourcerer> {
redStarScraper,
bombtheirishScraper,
vidsrcsuScraper,
TASFScraper,
];
}

View file

@ -0,0 +1,61 @@
import { flags } from '@/entrypoint/utils/targets';
import { SourcererOutput, makeSourcerer } from '@/providers/base';
import { Caption, labelToLanguageCode } from '@/providers/captions';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
import { NotFoundError } from '@/utils/errors';
const baseUrl = 'https://theyallsayflix.su/';
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
const apiRes = await ctx.proxiedFetcher.full('/api/v1/search', {
query: {
type: ctx.media.type,
tmdb_id: ctx.media.tmdbId,
...(ctx.media.type === 'show' && {
season: ctx.media.season.number.toString(),
episode: ctx.media.episode.number.toString(),
}),
},
baseUrl,
});
const data: { streams: { play_url: string }[]; subtitles: { label: string; url: string }[] } = apiRes.body;
if (apiRes.statusCode !== 200 || !data.streams[0].play_url) throw new NotFoundError('No watchable item found');
const captions: Caption[] = [];
if (data.subtitles) {
for (const caption of data.subtitles) {
const language = labelToLanguageCode(caption.label);
if (!language) continue;
captions.push({
id: caption.url,
url: caption.url,
type: 'vtt',
hasCorsRestrictions: false,
language,
});
}
}
return {
embeds: [],
stream: [
{
id: 'primary',
playlist: data.streams[0].play_url,
type: 'hls',
flags: [flags.CORS_ALLOWED],
captions,
},
],
};
}
export const TASFScraper = makeSourcerer({
id: 'tasf',
name: 'theyallsayflix.su',
rank: 225,
flags: [flags.CORS_ALLOWED],
scrapeMovie: comboScraper,
scrapeShow: comboScraper,
});