mirror of
https://github.com/p-stream/providers.git
synced 2026-03-11 17:55:36 +00:00
simplify vidify
This commit is contained in:
parent
fc1c1c49cc
commit
1de8f8b583
2 changed files with 48 additions and 469 deletions
|
|
@ -41,18 +41,7 @@ import {
|
||||||
streamwishSpanishScraper,
|
streamwishSpanishScraper,
|
||||||
} from './embeds/streamwish';
|
} from './embeds/streamwish';
|
||||||
import { vidCloudScraper } from './embeds/vidcloud';
|
import { vidCloudScraper } from './embeds/vidcloud';
|
||||||
import {
|
import { vidifyEmbeds } from './embeds/vidify';
|
||||||
vidifyAlfaEmbed,
|
|
||||||
vidifyBravoEmbed,
|
|
||||||
vidifyCharlieEmbed,
|
|
||||||
vidifyDeltaEmbed,
|
|
||||||
vidifyEchoEmbed,
|
|
||||||
vidifyFoxtrotEmbed,
|
|
||||||
vidifyGolfEmbed,
|
|
||||||
vidifyHotelEmbed,
|
|
||||||
vidifyIndiaEmbed,
|
|
||||||
vidifyJuliettEmbed,
|
|
||||||
} from './embeds/vidify';
|
|
||||||
import {
|
import {
|
||||||
VidsrcsuServer10Scraper,
|
VidsrcsuServer10Scraper,
|
||||||
VidsrcsuServer11Scraper,
|
VidsrcsuServer11Scraper,
|
||||||
|
|
@ -183,16 +172,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
||||||
madplayNsapiEmbed,
|
madplayNsapiEmbed,
|
||||||
madplayRoperEmbed,
|
madplayRoperEmbed,
|
||||||
madplayNsapiVidFastEmbed,
|
madplayNsapiVidFastEmbed,
|
||||||
vidifyAlfaEmbed,
|
...vidifyEmbeds,
|
||||||
vidifyBravoEmbed,
|
|
||||||
vidifyCharlieEmbed,
|
|
||||||
vidifyDeltaEmbed,
|
|
||||||
vidifyEchoEmbed,
|
|
||||||
vidifyFoxtrotEmbed,
|
|
||||||
vidifyGolfEmbed,
|
|
||||||
vidifyHotelEmbed,
|
|
||||||
vidifyIndiaEmbed,
|
|
||||||
vidifyJuliettEmbed,
|
|
||||||
...rivestreamEmbeds,
|
...rivestreamEmbeds,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { createM3U8ProxyUrl } from '@/utils/proxy';
|
||||||
|
|
||||||
import { EmbedOutput, makeEmbed } from '../base';
|
import { EmbedOutput, makeEmbed } from '../base';
|
||||||
|
|
||||||
|
const VIDIFY_SERVERS = ['alfa', 'bravo', 'charlie', 'delta', 'echo', 'foxtrot', 'golf', 'hotel', 'india', 'juliett'];
|
||||||
|
|
||||||
// Do not do this. This is very lazy!
|
// Do not do this. This is very lazy!
|
||||||
const M3U8_URL_REGEX = /https?:\/\/[^\s"'<>]+?\.m3u8[^\s"'<>]*/i;
|
const M3U8_URL_REGEX = /https?:\/\/[^\s"'<>]+?\.m3u8[^\s"'<>]*/i;
|
||||||
|
|
||||||
|
|
@ -63,457 +65,54 @@ const headers = {
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const vidifyAlfaEmbed = makeEmbed({
|
export function makeVidifyEmbed(id: string, rank: number = 100) {
|
||||||
id: 'vidify-alfa',
|
const serverIndex = VIDIFY_SERVERS.indexOf(id) + 1;
|
||||||
name: 'Vidify Alfa',
|
|
||||||
rank: 230,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
return makeEmbed({
|
||||||
|
id: `vidify-${id}`,
|
||||||
|
name: `Vidify ${id.charAt(0).toUpperCase() + id.slice(1)}`,
|
||||||
|
rank,
|
||||||
|
async scrape(ctx): Promise<EmbedOutput> {
|
||||||
|
const query = JSON.parse(ctx.url);
|
||||||
|
const { type, tmdbId, season, episode } = query;
|
||||||
|
|
||||||
if (type === 'movie') {
|
let url = `https://${baseUrl}/`;
|
||||||
url += `/movie/${tmdbId}?sr=1`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=1`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
if (type === 'movie') {
|
||||||
|
url += `/movie/${tmdbId}?sr=${serverIndex}`;
|
||||||
|
} else if (type === 'show') {
|
||||||
|
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=${serverIndex}`;
|
||||||
|
} else {
|
||||||
|
throw new NotFoundError('Unsupported media type');
|
||||||
|
}
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
const res = await ctx.proxiedFetcher(url, { headers });
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
const playlistUrl = findFirstM3U8Url(res);
|
||||||
|
if (playlistUrl) {
|
||||||
|
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
||||||
|
throw new NotFoundError('No playlist URL found');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!playlistUrl) {
|
||||||
throw new NotFoundError('No playlist URL found');
|
throw new NotFoundError('No playlist URL found');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
ctx.progress(100);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stream: [
|
stream: [
|
||||||
{
|
{
|
||||||
id: 'primary',
|
id: 'primary',
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [flags.CORS_ALLOWED],
|
||||||
captions: [],
|
captions: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
export const vidifyBravoEmbed = makeEmbed({
|
|
||||||
id: 'vidify-bravo',
|
export const vidifyEmbeds = VIDIFY_SERVERS.map((server, i) => makeVidifyEmbed(server, 230 - i));
|
||||||
name: 'Vidify Bravo',
|
|
||||||
rank: 229,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=2`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=2`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyCharlieEmbed = makeEmbed({
|
|
||||||
id: 'vidify-charlie',
|
|
||||||
name: 'Vidify Charlie',
|
|
||||||
rank: 228,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=3`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=3`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyDeltaEmbed = makeEmbed({
|
|
||||||
id: 'vidify-delta',
|
|
||||||
name: 'Vidify Delta',
|
|
||||||
rank: 227,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=4`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=4`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyEchoEmbed = makeEmbed({
|
|
||||||
id: 'vidify-echo',
|
|
||||||
name: 'Vidify Echo',
|
|
||||||
rank: 226,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=5`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=5`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyFoxtrotEmbed = makeEmbed({
|
|
||||||
id: 'vidify-foxtrot',
|
|
||||||
name: 'Vidify Foxtrot',
|
|
||||||
rank: 225,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=6`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=6`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyGolfEmbed = makeEmbed({
|
|
||||||
id: 'vidify-golf',
|
|
||||||
name: 'Vidify Golf',
|
|
||||||
rank: 224,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=7`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=7`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyHotelEmbed = makeEmbed({
|
|
||||||
id: 'vidify-hotel',
|
|
||||||
name: 'Vidify Hotel',
|
|
||||||
rank: 223,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=8`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=8`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyIndiaEmbed = makeEmbed({
|
|
||||||
id: 'vidify-india',
|
|
||||||
name: 'Vidify India',
|
|
||||||
rank: 222,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=9`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=9`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidifyJuliettEmbed = makeEmbed({
|
|
||||||
id: 'vidify-juliett',
|
|
||||||
name: 'Vidify Juliett',
|
|
||||||
rank: 221,
|
|
||||||
async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
const query = JSON.parse(ctx.url);
|
|
||||||
const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
let url = `https://${baseUrl}/`;
|
|
||||||
|
|
||||||
if (type === 'movie') {
|
|
||||||
url += `/movie/${tmdbId}?sr=10`;
|
|
||||||
} else if (type === 'show') {
|
|
||||||
url += `/tv/${tmdbId}/season/${season}/episode/${episode}?sr=10`;
|
|
||||||
} else {
|
|
||||||
throw new NotFoundError('Unsupported media type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await ctx.proxiedFetcher(url, { headers });
|
|
||||||
|
|
||||||
const playlistUrl = findFirstM3U8Url(res);
|
|
||||||
if (playlistUrl) {
|
|
||||||
if (playlistUrl.includes('https://live.adultiptv.net/rough.m3u8')) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!playlistUrl) {
|
|
||||||
throw new NotFoundError('No playlist URL found');
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.progress(100);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
playlist: createM3U8ProxyUrl(playlistUrl, headers),
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue