This commit is contained in:
himanshu8443
2025-06-16 22:26:38 +05:30
parent 3f3e12f5df
commit 2a4aa2a680
185 changed files with 4645 additions and 3952 deletions

View File

@@ -1,85 +1,85 @@
export const catalogList = [
export const catalog = [
{
title: 'Latest',
filter: '',
title: "Latest",
filter: "",
},
{
title: 'Netflix',
filter: '/ott/netflix',
title: "Netflix",
filter: "/ott/netflix",
},
{
title: 'HBO Max',
filter: '/ott/hbo-max',
title: "HBO Max",
filter: "/ott/hbo-max",
},
{
title: 'Amazon Prime',
filter: '/ott/amazon-prime-video',
title: "Amazon Prime",
filter: "/ott/amazon-prime-video",
},
];
export const modGenresList = [
export const genres = [
{
title: 'Apple TV+',
filter: '/ott/apple-tv',
title: "Apple TV+",
filter: "/ott/apple-tv",
},
{
title: 'Disney+',
filter: '/ott/disney-plus',
title: "Disney+",
filter: "/ott/disney-plus",
},
{
title: 'Hulu',
filter: '/ott/hulu',
title: "Hulu",
filter: "/ott/hulu",
},
{
title: 'Crunchyroll',
filter: '/ott/crunchyroll',
title: "Crunchyroll",
filter: "/ott/crunchyroll",
},
{
title: 'Action',
filter: '/movies-by-genre/action/',
title: "Action",
filter: "/movies-by-genre/action/",
},
{
title: 'Adventure',
filter: '/movies-by-genre/adventure/',
title: "Adventure",
filter: "/movies-by-genre/adventure/",
},
{
title: 'Animation',
filter: '/movies-by-genre/animated/',
title: "Animation",
filter: "/movies-by-genre/animated/",
},
{
title: 'Comedy',
filter: '/movies-by-genre/comedy/',
title: "Comedy",
filter: "/movies-by-genre/comedy/",
},
{
title: 'Crime',
filter: '/movies-by-genre/crime/',
title: "Crime",
filter: "/movies-by-genre/crime/",
},
{
title: 'Documentary',
filter: '/movies-by-genre/documentary/',
title: "Documentary",
filter: "/movies-by-genre/documentary/",
},
{
title: 'Fantasy',
filter: '/movies-by-genre/fantasy/',
title: "Fantasy",
filter: "/movies-by-genre/fantasy/",
},
{
title: 'Horror',
filter: '/movies-by-genre/horror/',
title: "Horror",
filter: "/movies-by-genre/horror/",
},
{
title: 'Mystery',
filter: '/movies-by-genre/mystery/',
title: "Mystery",
filter: "/movies-by-genre/mystery/",
},
{
title: 'Romance',
filter: '/movies-by-genre/romance/',
title: "Romance",
filter: "/movies-by-genre/romance/",
},
{
title: 'Thriller',
filter: '/movies-by-genre/thriller/',
title: "Thriller",
filter: "/movies-by-genre/thriller/",
},
{
title: 'Sci-Fi',
filter: '/movies-by-genre/sci-fi/',
title: "Sci-Fi",
filter: "/movies-by-genre/sci-fi/",
},
];

52
providers/mod/episodes.ts Normal file
View File

@@ -0,0 +1,52 @@
import { EpisodeLink, ProviderContext } from "../types";
export const getEpisodes = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const { axios, cheerio } = providerContext;
try {
if (url.includes("url=")) {
url = atob(url.split("url=")[1]);
}
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
if (url.includes("url=")) {
const newUrl = $("meta[http-equiv='refresh']")
.attr("content")
?.split("url=")[1];
const res2 = await axios.get(newUrl || url);
const html2 = res2.data;
$ = cheerio.load(html2);
}
const episodeLinks: EpisodeLink[] = [];
$("h3,h4").map((i, element) => {
const seriesTitle = $(element).text();
const episodesLink = $(element).find("a").attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
$("a.maxbutton").map((i, element) => {
const seriesTitle = $(element).children("span").text();
const episodesLink = $(element).attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
return episodeLinks;
} catch (err) {
console.error(err);
return [];
}
};

View File

@@ -1,17 +0,0 @@
import {modGenresList, catalogList} from './catalog';
import {modGetInfo} from './modGetInfo';
import {modGetEpisodeLinks} from './modGetEpisodesList';
import {modGetPosts, modGetPostsSearch} from './modGetPosts';
import {modGetStream} from './modGetStream';
import {ProviderType} from '../types';
export const modMovies: ProviderType = {
catalog: catalogList,
genres: modGenresList,
GetMetaData: modGetInfo,
GetHomePosts: modGetPosts,
GetStream: modGetStream,
GetEpisodeLinks: modGetEpisodeLinks,
// nonStreamableServer: ['Gdrive-Instant'],
GetSearchPosts: modGetPostsSearch,
};

71
providers/mod/meta.ts Normal file
View File

@@ -0,0 +1,71 @@
import { Info, Link, ProviderContext } from "../types";
export const getMeta = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const meta = {
title: $(".imdbwp__title").text(),
synopsis: $(".imdbwp__teaser").text(),
image: $(".imdbwp__thumb").find("img").attr("src") || "",
imdbId: $(".imdbwp__link").attr("href")?.split("/")[4] || "",
type: $(".thecontent").text().toLocaleLowerCase().includes("season")
? "series"
: "movie",
};
const links: Link[] = [];
$("h3,h4").map((i, element) => {
const seriesTitle = $(element).text();
// const batchZipLink = $(element)
// .next("p")
// .find(".maxbutton-batch-zip,.maxbutton-zip-download")
// .attr("href");
const episodesLink = $(element)
.next("p")
.find(
".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download"
)
.attr("href");
const movieLink = $(element)
.next("p")
.find(".maxbutton-download-links")
.attr("href");
if (
movieLink ||
(episodesLink && episodesLink !== "javascript:void(0);")
) {
links.push({
title: seriesTitle.replace("Download ", "").trim() || "Download",
episodesLink: episodesLink || "",
directLinks: movieLink
? [{ link: movieLink, title: "Movie", type: "movie" }]
: [],
quality: seriesTitle?.match(/\d+p\b/)?.[0] || "",
});
}
});
// console.log('mod meta', links);
return { ...meta, linkList: links };
} catch (err) {
console.error(err);
return {
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}
};

View File

@@ -1,52 +0,0 @@
import {EpisodeLink, ProviderContext} from '../types';
export const modGetEpisodeLinks = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const {axios, cheerio} = providerContext;
try {
if (url.includes('url=')) {
url = atob(url.split('url=')[1]);
}
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
if (url.includes('url=')) {
const newUrl = $("meta[http-equiv='refresh']")
.attr('content')
?.split('url=')[1];
const res2 = await axios.get(newUrl || url);
const html2 = res2.data;
$ = cheerio.load(html2);
}
const episodeLinks: EpisodeLink[] = [];
$('h3,h4').map((i, element) => {
const seriesTitle = $(element).text();
const episodesLink = $(element).find('a').attr('href');
if (episodesLink && episodesLink !== '#') {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
});
}
});
$('a.maxbutton').map((i, element) => {
const seriesTitle = $(element).children('span').text();
const episodesLink = $(element).attr('href');
if (episodesLink && episodesLink !== '#') {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
});
}
});
return episodeLinks;
} catch (err) {
console.error(err);
return [];
}
};

View File

@@ -1,71 +0,0 @@
import {Info, Link, ProviderContext} from '../types';
export const modGetInfo = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, cheerio} = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const meta = {
title: $('.imdbwp__title').text(),
synopsis: $('.imdbwp__teaser').text(),
image: $('.imdbwp__thumb').find('img').attr('src') || '',
imdbId: $('.imdbwp__link').attr('href')?.split('/')[4] || '',
type: $('.thecontent').text().toLocaleLowerCase().includes('season')
? 'series'
: 'movie',
};
const links: Link[] = [];
$('h3,h4').map((i, element) => {
const seriesTitle = $(element).text();
// const batchZipLink = $(element)
// .next("p")
// .find(".maxbutton-batch-zip,.maxbutton-zip-download")
// .attr("href");
const episodesLink = $(element)
.next('p')
.find(
'.maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download',
)
.attr('href');
const movieLink = $(element)
.next('p')
.find('.maxbutton-download-links')
.attr('href');
if (
movieLink ||
(episodesLink && episodesLink !== 'javascript:void(0);')
) {
links.push({
title: seriesTitle.replace('Download ', '').trim() || 'Download',
episodesLink: episodesLink || '',
directLinks: movieLink
? [{link: movieLink, title: 'Movie', type: 'movie'}]
: [],
quality: seriesTitle?.match(/\d+p\b/)?.[0] || '',
});
}
});
// console.log('mod meta', links);
return {...meta, linkList: links};
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
linkList: [],
};
}
};

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const modGetPosts = async function ({
export const getPosts = async function ({
filter,
page,
signal,
@@ -12,13 +12,13 @@ export const modGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, axios, cheerio} = providerContext;
const baseUrl = await getBaseUrl('Moviesmod');
const { getBaseUrl, axios, cheerio } = providerContext;
const baseUrl = await getBaseUrl("Moviesmod");
const url = `${baseUrl + filter}/page/${page}/`;
return posts({url, signal, axios, cheerio});
return posts({ url, signal, axios, cheerio });
};
export const modGetPostsSearch = async function ({
export const getSearchPosts = async function ({
searchQuery,
page,
signal,
@@ -30,10 +30,10 @@ export const modGetPostsSearch = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, axios, cheerio} = providerContext;
const baseUrl = await getBaseUrl('Moviesmod');
const { getBaseUrl, axios, cheerio } = providerContext;
const baseUrl = await getBaseUrl("Moviesmod");
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
return posts({url, signal, axios, cheerio});
return posts({ url, signal, axios, cheerio });
};
async function posts({
@@ -44,20 +44,20 @@ async function posts({
}: {
url: string;
signal: AbortSignal;
axios: ProviderContext['axios'];
cheerio: ProviderContext['cheerio'];
axios: ProviderContext["axios"];
cheerio: ProviderContext["cheerio"];
}): Promise<Post[]> {
try {
const res = await axios.get(url, {signal});
const res = await axios.get(url, { signal });
const data = res.data;
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.post-cards')
.find('article')
$(".post-cards")
.find("article")
.map((i, element) => {
const title = $(element).find('a').attr('title');
const link = $(element).find('a').attr('href');
const image = $(element).find('img').attr('src');
const title = $(element).find("a").attr("title");
const link = $(element).find("a").attr("href");
const image = $(element).find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title,
@@ -68,7 +68,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('modGetPosts error ', err);
console.error("modGetPosts error ", err);
return [];
}
}

View File

@@ -1,26 +1,26 @@
import {Stream, ProviderContext, EpisodeLink} from '../types';
import { Stream, ProviderContext, EpisodeLink } from "../types";
const headers = {
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'Cache-Control': 'no-store',
'Accept-Language': 'en-US,en;q=0.9',
DNT: '1',
'sec-ch-ua':
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Cache-Control": "no-store",
"Accept-Language": "en-US,en;q=0.9",
DNT: "1",
"sec-ch-ua":
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
Cookie: 'popads_user_id=6ba8fe60a481387a3249f05aa058822d',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
'Upgrade-Insecure-Requests': '1',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
Cookie: "popads_user_id=6ba8fe60a481387a3249f05aa058822d",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
};
export const modGetStream = async function ({
export const getStream = async function ({
link: url,
type,
providerContext,
@@ -29,7 +29,7 @@ export const modGetStream = async function ({
type: string;
providerContext: ProviderContext;
}): Promise<Stream[]> {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
try {
const modGetEpisodeLinks = async function ({
url,
@@ -38,40 +38,40 @@ export const modGetStream = async function ({
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
try {
if (url.includes('url=')) {
url = atob(url.split('url=')[1]);
if (url.includes("url=")) {
url = atob(url.split("url=")[1]);
}
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
if (url.includes('url=')) {
if (url.includes("url=")) {
const newUrl = $("meta[http-equiv='refresh']")
.attr('content')
?.split('url=')[1];
.attr("content")
?.split("url=")[1];
const res2 = await axios.get(newUrl || url);
const html2 = res2.data;
$ = cheerio.load(html2);
}
const episodeLinks: EpisodeLink[] = [];
$('h3,h4').map((i, element) => {
$("h3,h4").map((i, element) => {
const seriesTitle = $(element).text();
const episodesLink = $(element).find('a').attr('href');
if (episodesLink && episodesLink !== '#') {
const episodesLink = $(element).find("a").attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
$('a.maxbutton').map((i, element) => {
const seriesTitle = $(element).children('span').text();
const episodesLink = $(element).attr('href');
if (episodesLink && episodesLink !== '#') {
$("a.maxbutton").map((i, element) => {
const seriesTitle = $(element).children("span").text();
const episodesLink = $(element).attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
@@ -81,9 +81,9 @@ export const modGetStream = async function ({
return [];
}
};
console.log('modGetStream', type, url);
if (type === 'movie') {
const servers = await modGetEpisodeLinks({url, providerContext});
console.log("modGetStream", type, url);
if (type === "movie") {
const servers = await modGetEpisodeLinks({ url, providerContext });
url = servers[0].link || url;
}
@@ -98,22 +98,22 @@ export const modGetStream = async function ({
// console.log(ddl);
const servers: Stream[] = [];
const driveLink = await isDriveLink(ddl);
const driveRes = await axios.get(driveLink, {headers});
const driveRes = await axios.get(driveLink, { headers });
const driveHtml = driveRes.data;
const $drive = cheerio.load(driveHtml);
try {
const resumeBot = $drive('.btn.btn-light').attr('href') || '';
const resumeBotRes = await axios.get(resumeBot, {headers});
const resumeBot = $drive(".btn.btn-light").attr("href") || "";
const resumeBotRes = await axios.get(resumeBot, { headers });
const resumeBotToken = resumeBotRes.data.match(
/formData\.append\('token', '([a-f0-9]+)'\)/,
/formData\.append\('token', '([a-f0-9]+)'\)/
)[1];
const resumeBotBody = new FormData();
resumeBotBody.append('token', resumeBotToken);
resumeBotBody.append("token", resumeBotToken);
const resumeBotPath = resumeBotRes.data.match(
/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/,
/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/
)[1];
const resumeBotBaseUrl = resumeBot.split('/download')[0];
const resumeBotBaseUrl = resumeBot.split("/download")[0];
// console.log(
// 'resumeBotPath',
// resumeBotBaseUrl + '/download?id=' + resumeBotPath,
@@ -121,84 +121,84 @@ export const modGetStream = async function ({
// console.log('resumeBotBody', resumeBotToken);
const resumeBotDownload = await fetch(
resumeBotBaseUrl + '/download?id=' + resumeBotPath,
resumeBotBaseUrl + "/download?id=" + resumeBotPath,
{
method: 'POST',
method: "POST",
body: resumeBotBody,
headers: {
Referer: resumeBot,
Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308',
Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308",
},
},
}
);
const resumeBotDownloadData = await resumeBotDownload.json();
console.log('resumeBotDownloadData', resumeBotDownloadData.url);
console.log("resumeBotDownloadData", resumeBotDownloadData.url);
servers.push({
server: 'ResumeBot',
server: "ResumeBot",
link: resumeBotDownloadData.url,
type: 'mkv',
type: "mkv",
});
} catch (err) {
console.log('ResumeBot link not found', err);
console.log("ResumeBot link not found", err);
}
// CF workers type 1
try {
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=1';
const cfWorkersRes = await axios.get(cfWorkersLink, {headers});
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers('.btn-success');
const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => {
const link = el.attribs.href;
const link = (el as any).attribs?.href;
if (link) {
servers.push({
server: 'Cf Worker 1.' + i,
server: "Cf Worker 1." + i,
link: link,
type: 'mkv',
type: "mkv",
});
}
});
} catch (err) {
console.log('CF workers link not found', err);
console.log("CF workers link not found", err);
}
// CF workers type 2
try {
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=2';
const cfWorkersRes = await axios.get(cfWorkersLink, {headers});
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers('.btn-success');
const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => {
const link = el.attribs.href;
const link = (el as any).attribs?.href;
if (link) {
servers.push({
server: 'Cf Worker 2.' + i,
server: "Cf Worker 2." + i,
link: link,
type: 'mkv',
type: "mkv",
});
}
});
} catch (err) {
console.log('CF workers link not found', err);
console.log("CF workers link not found", err);
}
// gdrive
//instant link
try {
const seed = $drive('.btn-danger').attr('href') || '';
const instantToken = seed.split('=')[1];
const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken);
const InstantFromData = new FormData();
InstantFromData.append('keys', instantToken);
const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api';
InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, {
method: 'POST',
method: "POST",
body: InstantFromData,
headers: {
'x-token': videoSeedUrl,
"x-token": videoSeedUrl,
},
});
const instantLinkData = await instantLinkRes.json();
@@ -206,32 +206,32 @@ export const modGetStream = async function ({
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
servers.push({
server: 'Gdrive-Instant',
server: "Gdrive-Instant",
link: instantLink,
type: 'mkv',
type: "mkv",
});
} else {
console.log('Instant link not found', instantLinkData);
console.log("Instant link not found", instantLinkData);
}
} catch (err) {
console.log('Instant link not found', err);
console.log("Instant link not found", err);
}
return servers;
} catch (err) {
console.log('getStream error', err);
console.log("getStream error", err);
return [];
}
};
const isDriveLink = async (ddl: string) => {
if (ddl.includes('drive')) {
if (ddl.includes("drive")) {
const driveLeach = await fetch(ddl);
const driveLeachData = await driveLeach.text();
const pathMatch = driveLeachData.match(
/window\.location\.replace\("([^"]+)"\)/,
/window\.location\.replace\("([^"]+)"\)/
);
const path = pathMatch?.[1];
const mainUrl = ddl.split('/')[2];
const mainUrl = ddl.split("/")[2];
console.log(`driveUrl = https://${mainUrl}${path}`);
return `https://${mainUrl}${path}`;
} else {
@@ -240,13 +240,13 @@ const isDriveLink = async (ddl: string) => {
};
async function modExtractor(url: string, providerContext: ProviderContext) {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
try {
const wpHttp = url.split('sid=')[1];
const wpHttp = url.split("sid=")[1];
var bodyFormData0 = new FormData();
bodyFormData0.append('_wp_http', wpHttp);
const res = await fetch(url.split('?')[0], {
method: 'POST',
bodyFormData0.append("_wp_http", wpHttp);
const res = await fetch(url.split("?")[0], {
method: "POST",
body: bodyFormData0,
});
const data = await res.text();
@@ -255,25 +255,25 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
const $ = cheerio.load(html);
// find input with name="_wp_http2"
const wpHttp2 = $('input').attr('name', '_wp_http2').val();
const wpHttp2 = $("input").attr("name", "_wp_http2").val();
// console.log('wpHttp2', wpHttp2);
// form data
var bodyFormData = new FormData();
bodyFormData.append('_wp_http2', wpHttp2);
const formUrl1 = $('form').attr('action');
const formUrl = formUrl1 || url.split('?')[0];
bodyFormData.append("_wp_http2", wpHttp2);
const formUrl1 = $("form").attr("action");
const formUrl = formUrl1 || url.split("?")[0];
const res2 = await fetch(formUrl, {
method: 'POST',
method: "POST",
body: bodyFormData,
});
const html2: any = await res2.text();
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
console.log(link);
const cookie = link.split('=')[1];
console.log('cookie', cookie);
const cookie = link.split("=")[1];
console.log("cookie", cookie);
const downloadLink = await axios.get(link, {
headers: {
@@ -283,6 +283,6 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
});
return downloadLink;
} catch (err) {
console.log('modGetStream error', err);
console.log("modGetStream error", err);
}
}