mirror of
https://github.com/p-stream/providers.git
synced 2026-03-11 17:55:36 +00:00
we got more madplay embeds
This commit is contained in:
parent
9e19982c2f
commit
6aaeefd688
1 changed files with 82 additions and 39 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
import { flags } from '@/entrypoint/utils/targets';
|
import { flags } from '@/entrypoint/utils/targets';
|
||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
import { createM3U8ProxyUrl } from '@/utils/proxy';
|
import { createM3U8ProxyUrl } from '@/utils/proxy';
|
||||||
|
|
@ -102,50 +103,92 @@ export const madplayNsapiEmbed = makeEmbed({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Will show error: { error: 'Streamkey not found' }
|
export const madplayRoperEmbed = makeEmbed({
|
||||||
|
id: 'madplay-roper',
|
||||||
|
name: 'Flicky Roper',
|
||||||
|
rank: 102,
|
||||||
|
async scrape(ctx): Promise<EmbedOutput> {
|
||||||
|
const query = JSON.parse(ctx.url);
|
||||||
|
const { type, tmdbId, season, episode } = query;
|
||||||
|
|
||||||
// export const madplayHollyEmbed = makeEmbed({
|
let url = `https://${baseUrl}/api/roper/`;
|
||||||
// id: 'madplay-holly',
|
|
||||||
// name: 'Flicky Woods',
|
|
||||||
// rank: 102,
|
|
||||||
// async scrape(ctx): Promise<EmbedOutput> {
|
|
||||||
// const query = JSON.parse(ctx.url);
|
|
||||||
// const { type, tmdbId, season, episode } = query;
|
|
||||||
|
|
||||||
// let url = `https://${baseUrl}/api/holly`;
|
if (type === 'movie') {
|
||||||
|
url += `?id=${tmdbId}&type=movie`;
|
||||||
|
} else if (type === 'show') {
|
||||||
|
url += `?id=${tmdbId}&season=${season.number}&episode=${episode.number}&type=series`;
|
||||||
|
} else {
|
||||||
|
throw new NotFoundError('Unsupported media type');
|
||||||
|
}
|
||||||
|
|
||||||
// if (type === 'movie') {
|
const res = await ctx.proxiedFetcher(url, { headers });
|
||||||
// url += `?id=${tmdbId}&token=direct`;
|
|
||||||
// } else if (type === 'show') {
|
|
||||||
// url += `?id=${tmdbId}&s=${season.number}&e=${episode.number}&token=direct`;
|
|
||||||
// } else {
|
|
||||||
// throw new NotFoundError('Unsupported media type');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const res = await ctx.proxiedFetcher(url, { headers });
|
if (!Array.isArray(res) || res.length === 0) {
|
||||||
// console.log(res);
|
throw new NotFoundError('No streams found');
|
||||||
|
}
|
||||||
|
const stream = res[0];
|
||||||
|
|
||||||
// if (!Array.isArray(res) || res.length === 0) {
|
if (!stream.url) {
|
||||||
// throw new NotFoundError('No streams found');
|
throw new NotFoundError('No file URL found in stream');
|
||||||
// }
|
}
|
||||||
// const stream = res[0];
|
|
||||||
|
|
||||||
// if (!stream.url) {
|
ctx.progress(100);
|
||||||
// throw new NotFoundError('No file URL found in stream');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ctx.progress(100);
|
return {
|
||||||
|
stream: [
|
||||||
|
{
|
||||||
|
id: 'primary',
|
||||||
|
type: 'hls',
|
||||||
|
playlist: createM3U8ProxyUrl(stream.url, stream.headers || headers),
|
||||||
|
flags: [flags.CORS_ALLOWED],
|
||||||
|
captions: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// return {
|
export const madplayNsapiVidFastEmbed = makeEmbed({
|
||||||
// stream: [
|
id: 'madplay-vidfast',
|
||||||
// {
|
name: 'Flicky Vidfast',
|
||||||
// id: 'primary',
|
rank: 101,
|
||||||
// type: 'hls',
|
async scrape(ctx): Promise<EmbedOutput> {
|
||||||
// playlist: createM3U8ProxyUrl(stream.url, stream.headers || headers),
|
const query = JSON.parse(ctx.url);
|
||||||
// flags: [flags.CORS_ALLOWED],
|
const { type, tmdbId, season, episode } = query;
|
||||||
// captions: [],
|
|
||||||
// },
|
let url = `https://${baseUrl}/api/nsapi/test?url=https://vidfast.pro/`;
|
||||||
// ],
|
|
||||||
// };
|
if (type === 'movie') {
|
||||||
// },
|
url += `/movie/${tmdbId}`;
|
||||||
// });
|
} else if (type === 'show') {
|
||||||
|
url += `/tv/${tmdbId}/${season.number}/${episode.number}`;
|
||||||
|
} else {
|
||||||
|
throw new NotFoundError('Unsupported media type');
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await ctx.proxiedFetcher(url, { headers });
|
||||||
|
|
||||||
|
if (!Array.isArray(res) || res.length === 0) {
|
||||||
|
throw new NotFoundError('No streams found');
|
||||||
|
}
|
||||||
|
const stream = res[0];
|
||||||
|
|
||||||
|
if (!stream.url) {
|
||||||
|
throw new NotFoundError('No file URL found in stream');
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.progress(100);
|
||||||
|
|
||||||
|
return {
|
||||||
|
stream: [
|
||||||
|
{
|
||||||
|
id: 'primary',
|
||||||
|
type: 'hls',
|
||||||
|
playlist: createM3U8ProxyUrl(stream.url, stream.headers || headers),
|
||||||
|
flags: [flags.CORS_ALLOWED],
|
||||||
|
captions: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue