mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 10:33:25 +00:00
fix vidsrc
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||||
"eslint.format.enable": true
|
"eslint.format.enable": true,
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,21 +32,24 @@ 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];
|
let setPassLink = html.match(setPassRegex)?.[1];
|
||||||
if (!setPassLink) throw new Error('Unable to find set_pass.php link');
|
|
||||||
|
|
||||||
if (setPassLink.startsWith('//')) {
|
// isn't neeeded, the stream works without it anyway
|
||||||
setPassLink = `https:${setPassLink}`;
|
// shouldn't fail if the setpass link is not found
|
||||||
|
if (setPassLink) {
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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