mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
unminify
This commit is contained in:
40
dist/uhd/catalog.js
vendored
40
dist/uhd/catalog.js
vendored
@@ -1 +1,39 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Latest",filter:""},{title:"Web Series",filter:"/web-series"},{title:"Movies",filter:"/movies"},{title:"4K HDR",filter:"/4k-hdr"}],exports.genres=[{title:"4K HEVC",filter:"/2160p-hevc"},{title:"HD 10bit",filter:"/1080p-10bit"},{title:"English Movies",filter:"/movies/english-movies"},{title:"Dual Audio",filter:"/movies/dual-audio-movies"}];
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Latest",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Web Series",
|
||||
filter: "/web-series",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/movies",
|
||||
},
|
||||
{
|
||||
title: "4K HDR",
|
||||
filter: "/4k-hdr",
|
||||
},
|
||||
];
|
||||
exports.genres = [
|
||||
{
|
||||
title: "4K HEVC",
|
||||
filter: "/2160p-hevc",
|
||||
},
|
||||
{
|
||||
title: "HD 10bit",
|
||||
filter: "/1080p-10bit",
|
||||
},
|
||||
{
|
||||
title: "English Movies",
|
||||
filter: "/movies/english-movies",
|
||||
},
|
||||
{
|
||||
title: "Dual Audio",
|
||||
filter: "/movies/dual-audio-movies",
|
||||
},
|
||||
];
|
||||
|
||||
122
dist/uhd/meta.js
vendored
122
dist/uhd/meta.js
vendored
@@ -1 +1,121 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(a,o){function c(e){try{r(n.next(e))}catch(e){o(e)}}function s(e){try{r(n.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(c,s)}r((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;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":'"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","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"},getMeta=function(e){return __awaiter(this,arguments,void 0,function*({link:e,providerContext:t}){var i;try{const{axios:n,cheerio:a}=t,o=e,c=yield n.get(o,{headers:headers}),s=yield c.data,r=a.load(s),l=r("h2:first").text()||"",h=r("h2").siblings().find("img").attr("src")||"",d=[];return r(".mks_separator,p:contains('mks_separator')").each((e,t)=>{r(t).nextUntil(".mks_separator").each((e,t)=>{const i=r(t).text(),n=[];r(t).next("p").find("a").each((e,t)=>{const i=r(t).text(),a=r(t).attr("href");i&&a&&!i.toLocaleLowerCase().includes("zip")&&n.push({title:i,link:a})}),i&&n.length>0&&d.push({title:i,directLinks:n})})}),r("hr").each((e,t)=>{r(t).nextUntil("hr").each((e,t)=>{const i=r(t).text(),n=[];r(t).next("p").find("a").each((e,t)=>{const i=r(t).text(),a=r(t).attr("href");i&&a&&!i.toLocaleLowerCase().includes("zip")&&n.push({title:i,link:a})}),i&&n.length>0&&d.push({title:i,directLinks:n})})}),{title:l.match(/^Download\s+([^(\[]+)/i)?(null===(i=null==l?void 0:l.match(/^Download\s+([^(\[]+)/i))||void 0===i?void 0:i[1])||"":l.replace("Download","")||"",image:h,imdbId:"",synopsis:l,type:"",linkList:d}}catch(e){return{title:"",image:"",imdbId:"",synopsis:"",linkList:[],type:"uhd"}}})};exports.getMeta=getMeta;
|
||||
"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 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": '"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",
|
||||
"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",
|
||||
};
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
console.log("Fetching metadata from UHD...", link, providerContext);
|
||||
const url = link;
|
||||
const res = yield axios.get(url, { headers });
|
||||
const html = yield res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const title = $("h2:first").text() || "";
|
||||
const image = $("h2").siblings().find("img").attr("src") || "";
|
||||
// const trailer = $('iframe').attr('src') || '';
|
||||
// console.log({ title, image, trailer });
|
||||
// Links
|
||||
const episodes = [];
|
||||
// new structure
|
||||
$(".mks_separator,p:contains('mks_separator')").each((index, element) => {
|
||||
$(element)
|
||||
.nextUntil(".mks_separator")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const episodesList = [];
|
||||
$(element)
|
||||
.next("p")
|
||||
.find("a")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const link = $(element).attr("href");
|
||||
if (title && link && !title.toLocaleLowerCase().includes("zip")) {
|
||||
episodesList.push({ title, link });
|
||||
// console.log({ title, link });
|
||||
}
|
||||
});
|
||||
if (title && episodesList.length > 0) {
|
||||
episodes.push({
|
||||
title,
|
||||
directLinks: episodesList,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
// old structure
|
||||
$("hr").each((index, element) => {
|
||||
$(element)
|
||||
.nextUntil("hr")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const episodesList = [];
|
||||
$(element)
|
||||
.next("p")
|
||||
.find("a")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const link = $(element).attr("href");
|
||||
if (title && link && !title.toLocaleLowerCase().includes("zip")) {
|
||||
episodesList.push({ title, link });
|
||||
// console.log({ title, link });
|
||||
}
|
||||
});
|
||||
if (title && episodesList.length > 0) {
|
||||
episodes.push({
|
||||
title,
|
||||
directLinks: episodesList,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
// console.log(episodes);
|
||||
return {
|
||||
title: title.match(/^Download\s+([^(\[]+)/i)
|
||||
? ((_b = title === null || title === void 0 ? void 0 : title.match(/^Download\s+([^(\[]+)/i)) === null || _b === void 0 ? void 0 : _b[1]) || ""
|
||||
: title.replace("Download", "") || "",
|
||||
image,
|
||||
imdbId: "",
|
||||
synopsis: title,
|
||||
type: "",
|
||||
linkList: episodes,
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
return {
|
||||
title: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
synopsis: "",
|
||||
linkList: [],
|
||||
type: "uhd",
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
|
||||
77
dist/uhd/posts.js
vendored
77
dist/uhd/posts.js
vendored
@@ -1 +1,76 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,o,a){return new(o||(o=Promise))(function(i,n){function s(e){try{c(a.next(e))}catch(e){n(e)}}function r(e){try{c(a.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(s,r)}c((a=a.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;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":'"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","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"},getPosts=e=>__awaiter(void 0,[e],void 0,function*({filter:e,page:t,signal:o,providerContext:a}){const{getBaseUrl:i}=a,n=yield i("UhdMovies");return posts(n,1===t?`${n}/${e}/`:`${n+e}/page/${t}/`,o,a)});exports.getPosts=getPosts;const getSearchPosts=e=>__awaiter(void 0,[e],void 0,function*({searchQuery:e,page:t,signal:o,providerContext:a}){const{getBaseUrl:i}=a,n=yield i("UhdMovies");return posts(n,`${n}/search/${e}/page/${t}/`,o,a)});function posts(e,t,o,a){return __awaiter(this,void 0,void 0,function*(){try{const{axios:e,cheerio:i}=a,n=(yield e.get(t,{headers:headers,signal:o})).data,s=i.load(n),r=[];return s(".gridlove-posts").find(".layout-masonry").each((e,t)=>{const o=s(t).find("a").attr("title"),a=s(t).find("a").attr("href"),i=s(t).find("a").find("img").attr("src");o&&a&&i&&r.push({title:o.replace("Download","").trim(),link:a,image:i})}),r}catch(e){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
"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 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": '"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",
|
||||
"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",
|
||||
};
|
||||
const getPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ filter, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("UhdMovies");
|
||||
const url = page === 1 ? `${baseUrl}/${filter}/` : `${baseUrl + filter}/page/${page}/`;
|
||||
console.log("url", url);
|
||||
return posts(baseUrl, url, signal, providerContext);
|
||||
});
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("UhdMovies");
|
||||
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
|
||||
return posts(baseUrl, url, signal, providerContext);
|
||||
});
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(baseURL, url, signal, providerContext) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const res = yield axios.get(url, { headers, signal });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const uhdCatalog = [];
|
||||
$(".gridlove-posts")
|
||||
.find(".layout-masonry")
|
||||
.each((index, element) => {
|
||||
const title = $(element).find("a").attr("title");
|
||||
const link = $(element).find("a").attr("href");
|
||||
const image = $(element).find("a").find("img").attr("src");
|
||||
if (title && link && image) {
|
||||
uhdCatalog.push({
|
||||
title: title.replace("Download", "").trim(),
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return uhdCatalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("uhd error ", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
207
dist/uhd/stream.js
vendored
207
dist/uhd/stream.js
vendored
@@ -1 +1,206 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(a,o){function n(e){try{s(r.next(e))}catch(e){o(e)}}function c(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(n,c)}s((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;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":'"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","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"},getStream=e=>__awaiter(void 0,[e],void 0,function*({link:e,providerContext:t}){var i,r;try{const{axios:a,cheerio:o}=t;let n=yield modExtractor(e,t);const c=(null===(r=null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.match(/content="0;url=(.*?)"/))||void 0===r?void 0:r[1])||e,s=yield isDriveLink(c),d=[],l=(yield a.get(s,{headers:headers})).data,h=o.load(l);try{const e=h(".btn-danger").attr("href")||"",t=e.split("=")[1],i=new FormData;i.append("keys",t);const r=e.split("/").slice(0,3).join("/")+"/api",a=yield fetch(r,{method:"POST",body:i,headers:{"x-token":r}}),o=yield a.json();if(!1===o.error){const e=o.url;d.push({server:"Gdrive-Instant",link:e,type:"mkv"})}}catch(e){}try{const e=s.replace("/file","/zfile"),t=(yield a.get(e,{headers:headers})).data,i=o.load(t)(".btn-success").attr("href");i&&d.push({server:"ResumeCloud",link:i,type:"mkv"})}catch(e){}try{const e=s.replace("/file","/wfile")+"?type=1",t=(yield a.get(e,{headers:headers})).data,i=o.load(t);i(".btn-success").each((e,t)=>{var i;const r=null===(i=t.attribs)||void 0===i?void 0:i.href;r&&d.push({server:"Cf Worker 1."+e,link:r,type:"mkv"})})}catch(e){}try{const e=s.replace("/file","/wfile")+"?type=2",t=(yield a.get(e,{headers:headers})).data,i=o.load(t);i(".btn-success").each((e,t)=>{var i;const r=null===(i=t.attribs)||void 0===i?void 0:i.href;r&&d.push({server:"Cf Worker 2."+e,link:r,type:"mkv"})})}catch(e){}return d}catch(e){return[]}});exports.getStream=getStream;const isDriveLink=e=>__awaiter(void 0,void 0,void 0,function*(){if(e.includes("drive")){const t=yield fetch(e),i=(yield t.text()).match(/window\.location\.replace\("([^"]+)"\)/),r=null==i?void 0:i[1];return`https://${e.split("/")[2]}${r}`}return e});function modExtractor(e,t){return __awaiter(this,void 0,void 0,function*(){const{axios:i,cheerio:r}=t;try{const t=e.split("sid=")[1];var a=new FormData;a.append("_wp_http",t);const n=yield fetch(e.split("?")[0],{method:"POST",body:a}),c=yield n.text(),s=r.load(c),d=s("input").attr("name","_wp_http2").val();var o=new FormData;o.append("_wp_http2",d);const l=s("form").attr("action")||e.split("?")[0],h=yield fetch(l,{method:"POST",body:o}),p=(yield h.text()).match(/setAttribute\("href",\s*"(.*?)"/)[1],u=p.split("=")[1];return yield i.get(p,{headers:{Referer:l,Cookie:`${u}=${d}`}})}catch(e){}})}
|
||||
"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 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": '"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",
|
||||
"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",
|
||||
};
|
||||
const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: url, providerContext, }) {
|
||||
var _b, _c;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
let downloadLink = yield modExtractor(url, providerContext);
|
||||
// console.log(downloadLink.data);
|
||||
const ddl = ((_c = (_b = downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.data) === null || _b === void 0 ? void 0 : _b.match(/content="0;url=(.*?)"/)) === null || _c === void 0 ? void 0 : _c[1]) || url;
|
||||
console.log("ddl", ddl);
|
||||
// console.log(ddl);
|
||||
const driveLink = yield isDriveLink(ddl);
|
||||
const ServerLinks = [];
|
||||
const driveRes = yield axios.get(driveLink, { headers });
|
||||
const driveHtml = driveRes.data;
|
||||
const $drive = cheerio.load(driveHtml);
|
||||
//instant link
|
||||
try {
|
||||
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";
|
||||
// console.log('videoSeedUrl', videoSeedUrl);
|
||||
const instantLinkRes = yield fetch(videoSeedUrl, {
|
||||
method: "POST",
|
||||
body: InstantFromData,
|
||||
headers: {
|
||||
"x-token": videoSeedUrl,
|
||||
},
|
||||
});
|
||||
const instantLinkData = yield instantLinkRes.json();
|
||||
// console.log('instantLinkData', instantLinkData);
|
||||
if (instantLinkData.error === false) {
|
||||
const instantLink = instantLinkData.url;
|
||||
ServerLinks.push({
|
||||
server: "Gdrive-Instant",
|
||||
link: instantLink,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log("Instant link not found", instantLinkData);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Instant link not found", err);
|
||||
}
|
||||
// resume link
|
||||
try {
|
||||
const resumeDrive = driveLink.replace("/file", "/zfile");
|
||||
// console.log('resumeDrive', resumeDrive);
|
||||
const resumeDriveRes = yield axios.get(resumeDrive, { headers });
|
||||
const resumeDriveHtml = resumeDriveRes.data;
|
||||
const $resumeDrive = cheerio.load(resumeDriveHtml);
|
||||
const resumeLink = $resumeDrive(".btn-success").attr("href");
|
||||
// console.log('resumeLink', resumeLink);
|
||||
if (resumeLink) {
|
||||
ServerLinks.push({
|
||||
server: "ResumeCloud",
|
||||
link: resumeLink,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Resume link not found");
|
||||
}
|
||||
// CF workers type 1
|
||||
try {
|
||||
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
|
||||
const cfWorkersRes = yield axios.get(cfWorkersLink, { headers });
|
||||
const cfWorkersHtml = cfWorkersRes.data;
|
||||
const $cfWorkers = cheerio.load(cfWorkersHtml);
|
||||
const cfWorkersStream = $cfWorkers(".btn-success");
|
||||
cfWorkersStream.each((i, el) => {
|
||||
var _a;
|
||||
const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href;
|
||||
if (link) {
|
||||
ServerLinks.push({
|
||||
server: "Cf Worker 1." + i,
|
||||
link: link,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.log("CF workers link not found", err);
|
||||
}
|
||||
// CF workers type 2
|
||||
try {
|
||||
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2";
|
||||
const cfWorkersRes = yield axios.get(cfWorkersLink, { headers });
|
||||
const cfWorkersHtml = cfWorkersRes.data;
|
||||
const $cfWorkers = cheerio.load(cfWorkersHtml);
|
||||
const cfWorkersStream = $cfWorkers(".btn-success");
|
||||
cfWorkersStream.each((i, el) => {
|
||||
var _a;
|
||||
const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href;
|
||||
if (link) {
|
||||
ServerLinks.push({
|
||||
server: "Cf Worker 2." + i,
|
||||
link: link,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.log("CF workers link not found", err);
|
||||
}
|
||||
console.log("ServerLinks", ServerLinks);
|
||||
return ServerLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.log("getStream error", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
exports.getStream = getStream;
|
||||
const isDriveLink = (ddl) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
if (ddl.includes("drive")) {
|
||||
const driveLeach = yield fetch(ddl);
|
||||
const driveLeachData = yield driveLeach.text();
|
||||
const pathMatch = driveLeachData.match(/window\.location\.replace\("([^"]+)"\)/);
|
||||
const path = pathMatch === null || pathMatch === void 0 ? void 0 : pathMatch[1];
|
||||
const mainUrl = ddl.split("/")[2];
|
||||
console.log(`driveUrl = https://${mainUrl}${path}`);
|
||||
return `https://${mainUrl}${path}`;
|
||||
}
|
||||
else {
|
||||
return ddl;
|
||||
}
|
||||
});
|
||||
function modExtractor(url, providerContext) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const wpHttp = url.split("sid=")[1];
|
||||
var bodyFormData0 = new FormData();
|
||||
bodyFormData0.append("_wp_http", wpHttp);
|
||||
const res = yield fetch(url.split("?")[0], {
|
||||
method: "POST",
|
||||
body: bodyFormData0,
|
||||
});
|
||||
const data = yield res.text();
|
||||
// console.log('', data);
|
||||
const html = data;
|
||||
const $ = cheerio.load(html);
|
||||
// find input with name="_wp_http2"
|
||||
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];
|
||||
const res2 = yield fetch(formUrl, {
|
||||
method: "POST",
|
||||
body: bodyFormData,
|
||||
});
|
||||
const html2 = yield res2.text();
|
||||
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
|
||||
console.log(link);
|
||||
const cookie = link.split("=")[1];
|
||||
console.log("cookie", cookie);
|
||||
const downloadLink = yield axios.get(link, {
|
||||
headers: {
|
||||
Referer: formUrl,
|
||||
Cookie: `${cookie}=${wpHttp2}`,
|
||||
},
|
||||
});
|
||||
return downloadLink;
|
||||
}
|
||||
catch (err) {
|
||||
console.log("modGetStream error", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user