mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
minify
This commit is contained in:
30
dist/world4u/catalog.js
vendored
30
dist/world4u/catalog.js
vendored
@@ -1,29 +1 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Latest",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Hollywood",
|
||||
filter: "/category/hollywood",
|
||||
},
|
||||
{
|
||||
title: "Bollywood",
|
||||
filter: "/category/bollywood",
|
||||
},
|
||||
{
|
||||
title: "Web Series",
|
||||
filter: "/category/web-series",
|
||||
},
|
||||
];
|
||||
exports.genres = [
|
||||
{ title: "South", filter: "/category/hindi-dubbed-movies/south-indian" },
|
||||
{ title: "Punjabi", filter: "/category/punjabi" },
|
||||
{ title: "Marathi", filter: "/category/bollywood/marathi" },
|
||||
{ title: "Gujarati", filter: "/category/gujarati" },
|
||||
{ title: "Bollywood", filter: "/category/bollywood" },
|
||||
{ title: "Hollywood", filter: "/category/hollywood" },
|
||||
];
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Latest",filter:""},{title:"Hollywood",filter:"/category/hollywood"},{title:"Bollywood",filter:"/category/bollywood"},{title:"Web Series",filter:"/category/web-series"}],exports.genres=[{title:"South",filter:"/category/hindi-dubbed-movies/south-indian"},{title:"Punjabi",filter:"/category/punjabi"},{title:"Marathi",filter:"/category/bollywood/marathi"},{title:"Gujarati",filter:"/category/gujarati"},{title:"Bollywood",filter:"/category/bollywood"},{title:"Hollywood",filter:"/category/hollywood"}];
|
||||
49
dist/world4u/episodes.js
vendored
49
dist/world4u/episodes.js
vendored
@@ -1,48 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) {
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const res = yield axios.get(url);
|
||||
const html = res.data;
|
||||
let $ = cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
$('strong:contains("Episode"),strong:contains("1080"),strong:contains("720"),strong:contains("480")').map((i, element) => {
|
||||
const title = $(element).text();
|
||||
const link = $(element)
|
||||
.parent()
|
||||
.parent()
|
||||
.next("h4")
|
||||
.find("a")
|
||||
.attr("href");
|
||||
if (link && !title.includes("zip")) {
|
||||
episodeLinks.push({
|
||||
title: title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
return [
|
||||
{
|
||||
title: "Server 1",
|
||||
link: url,
|
||||
},
|
||||
];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(i,r){function s(t){try{c(o.next(t))}catch(t){r(t)}}function a(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(t){return __awaiter(this,arguments,void 0,function*({url:t,providerContext:e}){const{axios:n,cheerio:o}=e;try{const e=(yield n.get(t)).data;let i=o.load(e);const r=[];return i('strong:contains("Episode"),strong:contains("1080"),strong:contains("720"),strong:contains("480")').map((t,e)=>{const n=i(e).text(),o=i(e).parent().parent().next("h4").find("a").attr("href");o&&!n.includes("zip")&&r.push({title:n,link:o})}),r}catch(e){return[{title:"Server 1",link:t}]}})};exports.getEpisodes=getEpisodes;
|
||||
90
dist/world4u/meta.js
vendored
90
dist/world4u/meta.js
vendored
@@ -1,89 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = yield axios.get(url);
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const type = $(".entry-content")
|
||||
.text()
|
||||
.toLocaleLowerCase()
|
||||
.includes("movie name")
|
||||
? "movie"
|
||||
: "series";
|
||||
const imdbId = ((_b = $(".imdb_left").find("a").attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "";
|
||||
const title = $(".entry-content")
|
||||
.find('strong:contains("Name")')
|
||||
.children()
|
||||
.remove()
|
||||
.end()
|
||||
.text()
|
||||
.replace(":", "");
|
||||
const synopsis = $(".entry-content")
|
||||
.find('p:contains("Synopsis"),p:contains("Plot"),p:contains("Story")')
|
||||
.children()
|
||||
.remove()
|
||||
.end()
|
||||
.text();
|
||||
const image = $(".wp-caption").find("img").attr("data-src") ||
|
||||
$(".entry-content").find("img").attr("data-src") ||
|
||||
"";
|
||||
const links = [];
|
||||
$(".my-button").map((i, element) => {
|
||||
var _a;
|
||||
const title = $(element).parent().parent().prev().text();
|
||||
const episodesLink = $(element).attr("href");
|
||||
const quality = ((_a = title.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || "";
|
||||
if (episodesLink && title) {
|
||||
links.push({
|
||||
title,
|
||||
episodesLink: type === "series" ? episodesLink : "",
|
||||
directLinks: type === "movie"
|
||||
? [
|
||||
{
|
||||
link: episodesLink,
|
||||
title,
|
||||
type: "movie",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
quality,
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(o,r){function a(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){var n;try{const{axios:i,cheerio:o}=e,r=t,a=(yield i.get(r)).data,s=o.load(a),c=s(".entry-content").text().toLocaleLowerCase().includes("movie name")?"movie":"series",d=(null===(n=s(".imdb_left").find("a").attr("href"))||void 0===n?void 0:n.split("/")[4])||"",p=s(".entry-content").find('strong:contains("Name")').children().remove().end().text().replace(":",""),l=s(".entry-content").find('p:contains("Synopsis"),p:contains("Plot"),p:contains("Story")').children().remove().end().text(),u=s(".wp-caption").find("img").attr("data-src")||s(".entry-content").find("img").attr("data-src")||"",v=[];return s(".my-button").map((t,e)=>{var n;const i=s(e).parent().parent().prev().text(),o=s(e).attr("href"),r=(null===(n=i.match(/\b(480p|720p|1080p|2160p)\b/i))||void 0===n?void 0:n[0])||"";o&&i&&v.push({title:i,episodesLink:"series"===c?o:"",directLinks:"movie"===c?[{link:o,title:i,type:"movie"}]:[],quality:r})}),{title:p,synopsis:l,image:u,imdbId:d,type:c,linkList:v}}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
64
dist/world4u/posts.js
vendored
64
dist/world4u/posts.js
vendored
@@ -1,63 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("w4u");
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, signal, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("w4u");
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, signal, axios, cheerio, }) {
|
||||
try {
|
||||
const res = yield axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".recent-posts")
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
const title = $(element).find(".post-thumb").find("a").attr("title");
|
||||
const link = $(element).find(".post-thumb").find("a").attr("href");
|
||||
const image = $(element).find(".post-thumb").find("img").attr("data-src") ||
|
||||
$(element).find(".post-thumb").find("img").attr("src");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title.replace("Download", "").trim(),
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))(function(n,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,page:e,signal:i,providerContext:r}){const{getBaseUrl:n,axios:s,cheerio:o}=r;return posts({url:`${(yield n("w4u"))+t}/page/${e}/`,signal:i,axios:s,cheerio:o})})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:i,providerContext:r}){const{getBaseUrl:n,axios:s,cheerio:o}=r;return posts({url:`${yield n("w4u")}/page/${e}/?s=${t}`,signal:i,axios:s,cheerio:o})})};function posts(t){return __awaiter(this,arguments,void 0,function*({url:t,signal:e,axios:i,cheerio:r}){try{const n=(yield i.get(t,{signal:e})).data,s=r.load(n),o=[];return s(".recent-posts").children().map((t,e)=>{const i=s(e).find(".post-thumb").find("a").attr("title"),r=s(e).find(".post-thumb").find("a").attr("href"),n=s(e).find(".post-thumb").find("img").attr("data-src")||s(e).find(".post-thumb").find("img").attr("src");i&&r&&n&&o.push({title:i.replace("Download","").trim(),link:r,image:n})}),o}catch(t){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
199
dist/world4u/stream.js
vendored
199
dist/world4u/stream.js
vendored
@@ -1,198 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link: url, type, providerContext, }) {
|
||||
var _b;
|
||||
const { axios, cheerio } = providerContext;
|
||||
const headers = {
|
||||
"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-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",
|
||||
};
|
||||
try {
|
||||
if (type === "movie") {
|
||||
const linkRes = yield axios.get(url, { headers });
|
||||
const linkData = linkRes.data;
|
||||
const $ = cheerio.load(linkData);
|
||||
url = $('strong:contains("INSTANT")').parent().attr("href") || url;
|
||||
}
|
||||
// fastilinks
|
||||
if (url.includes("fastilinks")) {
|
||||
const fastilinksRes = yield axios.get(url, { headers });
|
||||
const fastilinksData = fastilinksRes.data;
|
||||
const $$ = cheerio.load(fastilinksData);
|
||||
const fastilinksKey = $$('input[name="_csrf_token_645a83a41868941e4692aa31e7235f2"]').attr("value");
|
||||
console.log("fastilinksKey", fastilinksKey);
|
||||
const fastilinksFormData = new FormData();
|
||||
fastilinksFormData.append("_csrf_token_645a83a41868941e4692aa31e7235f2", fastilinksKey || "");
|
||||
const fastilinksRes2 = yield fetch(url, {
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
body: fastilinksFormData,
|
||||
});
|
||||
const fastilinksHtml = yield fastilinksRes2.text();
|
||||
// console.log('fastilinksHtml', fastilinksHtml);
|
||||
const $$$ = cheerio.load(fastilinksHtml);
|
||||
const fastilinksLink = $$$('a:contains("mediafire")').attr("href") ||
|
||||
$$$('a:contains("photolinx")').attr("href");
|
||||
console.log("fastilinksLink", fastilinksLink);
|
||||
url = fastilinksLink || url;
|
||||
}
|
||||
console.log("world4uGetStream", type, url);
|
||||
if (url.includes("photolinx")) {
|
||||
console.log("photolinx", url);
|
||||
// const photolinxBaseUrl = url.split('/').slice(0, 3).join('/');
|
||||
const photolinxRes = yield axios.get(url, { headers });
|
||||
const photolinxData = photolinxRes.data;
|
||||
const $$$ = cheerio.load(photolinxData);
|
||||
const access_token = $$$("#generate_url").attr("data-token");
|
||||
const uid = $$$("#generate_url").attr("data-uid");
|
||||
const body = {
|
||||
type: "DOWNLOAD_GENERATE",
|
||||
payload: {
|
||||
access_token,
|
||||
uid,
|
||||
},
|
||||
};
|
||||
console.log("photolinxData", JSON.stringify(body));
|
||||
const photolinxRes2 = yield fetch("https://photolinx.shop/action", {
|
||||
headers: {
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "xmlhttprequest",
|
||||
cookie: "PHPSESSID=9a8d855c700cf0711831c04960c2e2b4",
|
||||
Referer: "https://photolinx.shop/download/5mPkrBD0D2x",
|
||||
"Referrer-Policy": "strict-origin-when-cross-origin",
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
method: "POST",
|
||||
});
|
||||
const photolinxData2 = yield photolinxRes2.json();
|
||||
console.log("photolinxData2", photolinxData2);
|
||||
const dwUrl = photolinxData2 === null || photolinxData2 === void 0 ? void 0 : photolinxData2.download_url;
|
||||
if (dwUrl) {
|
||||
const streamLinks = [
|
||||
{
|
||||
server: "Photolinx",
|
||||
link: dwUrl,
|
||||
type: "mkv",
|
||||
},
|
||||
];
|
||||
return streamLinks;
|
||||
}
|
||||
}
|
||||
const res = yield axios.get(url, { headers });
|
||||
const html = res.data;
|
||||
const streamLinks = [];
|
||||
let data = { download: "" };
|
||||
try {
|
||||
const key = ((_b = html.match(/formData\.append\('key',\s*'(\d+)'\);/)) === null || _b === void 0 ? void 0 : _b[1]) || "";
|
||||
console.log("key", key);
|
||||
const formData = new FormData();
|
||||
formData.append("key", key);
|
||||
const streamRes = yield fetch(url, {
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
body: formData,
|
||||
});
|
||||
data = yield streamRes.json();
|
||||
}
|
||||
catch (err) {
|
||||
console.log("error in world4uGetStream", err);
|
||||
}
|
||||
// console.log('streamRes', streamRes);
|
||||
let $ = cheerio.load(html);
|
||||
// console.log('data', html);
|
||||
const mediafireUrl = $('h1:contains("Download")').find("a").attr("href") ||
|
||||
$(".input.popsok").attr("href");
|
||||
console.log("mediafireUrl", mediafireUrl);
|
||||
if (mediafireUrl) {
|
||||
const directUrl = yield axios.head(mediafireUrl);
|
||||
const urlContentType = directUrl.headers["content-type"];
|
||||
console.log("mfcontentType", urlContentType);
|
||||
if (urlContentType && urlContentType.includes("video")) {
|
||||
streamLinks.push({
|
||||
server: "Mediafire",
|
||||
link: mediafireUrl,
|
||||
type: "mkv",
|
||||
});
|
||||
return streamLinks;
|
||||
}
|
||||
else {
|
||||
const repairRes = yield axios.get(mediafireUrl, {
|
||||
headers: {
|
||||
Referer: url,
|
||||
},
|
||||
});
|
||||
const repairHtml = repairRes.data;
|
||||
// Regex to match the window.location.href assignment in the script content
|
||||
const hrefRegex = /window\.location\.href\s*=\s*['"]([^'"]+)['"]/;
|
||||
const match = repairHtml.match(hrefRegex);
|
||||
// If a match is found, return the URL; otherwise return null
|
||||
let downloadLInk = match ? match[1] : null;
|
||||
console.log("downloadLInk", downloadLInk);
|
||||
if (downloadLInk) {
|
||||
streamLinks.push({
|
||||
server: "Mediafire",
|
||||
link: downloadLInk,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
}
|
||||
const requireRepairRes = yield axios.head(data.download);
|
||||
const contentType = requireRepairRes.headers["content-type"];
|
||||
console.log("contentType", contentType);
|
||||
if (contentType && contentType.includes("video")) {
|
||||
streamLinks.push({
|
||||
server: "Mediafire",
|
||||
link: data.download,
|
||||
type: "mkv",
|
||||
});
|
||||
return streamLinks;
|
||||
}
|
||||
else {
|
||||
const repairRes = yield axios.get(data.download, {
|
||||
headers: {
|
||||
Referer: url,
|
||||
},
|
||||
});
|
||||
const repairHtml = repairRes.data;
|
||||
const $ = cheerio.load(repairHtml);
|
||||
const repairLink = $("#continue-btn").attr("href");
|
||||
console.log("repairLink", "https://www.mediafire.com" + repairLink);
|
||||
const repairRequireRepairRes = yield axios.get("https://www.mediafire.com" + repairLink);
|
||||
const $$ = cheerio.load(repairRequireRepairRes.data);
|
||||
const repairDownloadLink = $$(".input.popsok").attr("href");
|
||||
console.log("repairDownloadLink", repairDownloadLink);
|
||||
if (repairDownloadLink) {
|
||||
streamLinks.push({
|
||||
server: "Mediafire",
|
||||
link: repairDownloadLink,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,a,o){return new(a||(a=Promise))(function(r,n){function i(e){try{s(o.next(e))}catch(e){n(e)}}function d(e){try{s(o.throw(e))}catch(e){n(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,d)}s((o=o.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(e){return __awaiter(this,arguments,void 0,function*({link:e,type:t,providerContext:a}){var o;const{axios:r,cheerio:n}=a,i={"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-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"};try{if("movie"===t){const t=(yield r.get(e,{headers:i})).data;e=n.load(t)('strong:contains("INSTANT")').parent().attr("href")||e}if(e.includes("fastilinks")){const t=(yield r.get(e,{headers:i})).data,a=n.load(t)('input[name="_csrf_token_645a83a41868941e4692aa31e7235f2"]').attr("value"),o=new FormData;o.append("_csrf_token_645a83a41868941e4692aa31e7235f2",a||"");const d=yield fetch(e,{method:"POST",headers:i,body:o}),s=yield d.text(),c=n.load(s);e=c('a:contains("mediafire")').attr("href")||c('a:contains("photolinx")').attr("href")||e}if(e.includes("photolinx")){const t=(yield r.get(e,{headers:i})).data,a=n.load(t),o=a("#generate_url").attr("data-token"),d={type:"DOWNLOAD_GENERATE",payload:{access_token:o,uid:a("#generate_url").attr("data-uid")}},s=yield fetch("https://photolinx.shop/action",{headers:{"sec-fetch-site":"same-origin","x-requested-with":"xmlhttprequest",cookie:"PHPSESSID=9a8d855c700cf0711831c04960c2e2b4",Referer:"https://photolinx.shop/download/5mPkrBD0D2x","Referrer-Policy":"strict-origin-when-cross-origin"},body:JSON.stringify(d),method:"POST"}),c=yield s.json(),l=null==c?void 0:c.download_url;if(l){return[{server:"Photolinx",link:l,type:"mkv"}]}}const a=(yield r.get(e,{headers:i})).data,d=[];let s={download:""};try{const t=(null===(o=a.match(/formData\.append\('key',\s*'(\d+)'\);/))||void 0===o?void 0:o[1])||"",r=new FormData;r.append("key",t);const n=yield fetch(e,{method:"POST",headers:i,body:r});s=yield n.json()}catch(e){}let c=n.load(a);const l=c('h1:contains("Download")').find("a").attr("href")||c(".input.popsok").attr("href");if(l){const t=(yield r.head(l)).headers["content-type"];if(t&&t.includes("video"))return d.push({server:"Mediafire",link:l,type:"mkv"}),d;{const t=(yield r.get(l,{headers:{Referer:e}})).data,a=/window\.location\.href\s*=\s*['"]([^'"]+)['"]/,o=t.match(a);let n=o?o[1]:null;return n&&d.push({server:"Mediafire",link:n,type:"mkv"}),d}}const h=(yield r.head(s.download)).headers["content-type"];if(h&&h.includes("video"))return d.push({server:"Mediafire",link:s.download,type:"mkv"}),d;{const t=(yield r.get(s.download,{headers:{Referer:e}})).data,a=n.load(t)("#continue-btn").attr("href"),o=yield r.get("https://www.mediafire.com"+a),i=n.load(o.data)(".input.popsok").attr("href");i&&d.push({server:"Mediafire",link:i,type:"mkv"})}return d}catch(e){return[]}})};exports.getStream=getStream;
|
||||
Reference in New Issue
Block a user