mirror of
https://github.com/sussy-code/providers.git
synced 2026-01-11 20:10:17 +00:00
This commit is contained in:
parent
ef7a4c8bde
commit
88f8842006
2 changed files with 63 additions and 0 deletions
|
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
61
src/providers/sources/theyallsayflix.ts
Normal file
61
src/providers/sources/theyallsayflix.ts
Normal 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,
|
||||
});
|
||||
Loading…
Reference in a new issue