mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:03:25 +00:00
reintroduce the password endpoint
This commit is contained in:
@@ -2,6 +2,7 @@ import { flags } from '@/entrypoint/utils/targets';
|
|||||||
import { makeEmbed } from '@/providers/base';
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
|
||||||
const hlsURLRegex = /file:"(.*?)"/;
|
const hlsURLRegex = /file:"(.*?)"/;
|
||||||
|
const setPassRegex = /var pass_path = "(.*set_pass\.php.*)";/;
|
||||||
|
|
||||||
export const vidsrcembedScraper = makeEmbed({
|
export const vidsrcembedScraper = makeEmbed({
|
||||||
id: 'vidsrcembed', // VidSrc is both a source and an embed host
|
id: 'vidsrcembed', // VidSrc is both a source and an embed host
|
||||||
@@ -23,6 +24,22 @@ export const vidsrcembedScraper = makeEmbed({
|
|||||||
|
|
||||||
if (!finalUrl.includes('.m3u8')) throw new Error('Unable to find HLS playlist');
|
if (!finalUrl.includes('.m3u8')) throw new Error('Unable to find HLS playlist');
|
||||||
|
|
||||||
|
let setPassLink = html.match(setPassRegex)?.[1];
|
||||||
|
if (!setPassLink) throw new Error('Unable to find set_pass.php link');
|
||||||
|
|
||||||
|
if (setPassLink.startsWith('//')) {
|
||||||
|
setPassLink = `https:${setPassLink}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// VidSrc uses a password endpoint to temporarily whitelist the user's IP. This is called in an interval by the player.
|
||||||
|
// It currently has no effect on the player itself, the content plays fine without it.
|
||||||
|
// In the future we might have to introduce hooks for the frontend to call this endpoint.
|
||||||
|
await ctx.proxiedFetcher(setPassLink, {
|
||||||
|
headers: {
|
||||||
|
referer: ctx.url,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stream: [
|
stream: [
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user