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:
79
dist/vadapav/meta.js
vendored
79
dist/vadapav/meta.js
vendored
@@ -1 +1,78 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,r){function s(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,a)}c((n=n.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 i,n;try{const{axios:o,cheerio:r}=e,s=null==t?void 0:t.split("/").slice(0,3).join("/"),a=t,c=(yield o.get(a)).data,l=r.load(c),d=(null===(n=null===(i=l(".directory").children().first().text().trim())||void 0===i?void 0:i.split("/").pop())||void 0===n?void 0:n.trim())||"",u=[];l('.directory-entry:not(:contains("Parent Directory"))').map((t,e)=>{const i=l(e).attr("href");i&&u.push({episodesLink:s+i,title:l(e).text()})});const p=[];return l('.file-entry:not(:contains("Parent Directory"))').map((t,e)=>{var i,n;const o=l(e).attr("href");o&&((null===(i=l(e).text())||void 0===i?void 0:i.includes(".mp4"))||(null===(n=l(e).text())||void 0===n?void 0:n.includes(".mkv")))&&p.push({title:t+1+". "+l(e).text(),link:s+o})}),p.length>0&&u.push({title:d+" DL",directLinks:p}),{title:d,synopsis:"",image:"",imdbId:"",type:"movie",linkList:u}}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};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 getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
var _b, _c;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const baseUrl = link === null || link === void 0 ? void 0 : link.split("/").slice(0, 3).join("/");
|
||||
const url = link;
|
||||
const res = yield axios.get(url);
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const title = ((_c = (_b = $(".directory")
|
||||
.children()
|
||||
.first()
|
||||
.text()
|
||||
.trim()) === null || _b === void 0 ? void 0 : _b.split("/").pop()) === null || _c === void 0 ? void 0 : _c.trim()) || "";
|
||||
const links = [];
|
||||
$('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
const link = $(element).attr("href");
|
||||
if (link) {
|
||||
links.push({
|
||||
episodesLink: baseUrl + link,
|
||||
title: $(element).text(),
|
||||
});
|
||||
}
|
||||
});
|
||||
const directLinks = [];
|
||||
$('.file-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
var _a, _b;
|
||||
const link = $(element).attr("href");
|
||||
if (link &&
|
||||
(((_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.includes(".mp4")) ||
|
||||
((_b = $(element).text()) === null || _b === void 0 ? void 0 : _b.includes(".mkv")))) {
|
||||
directLinks.push({
|
||||
title: i + 1 + ". " + $(element).text(),
|
||||
link: baseUrl + link,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLinks.length > 0) {
|
||||
links.push({
|
||||
title: title + " DL",
|
||||
directLinks: directLinks,
|
||||
});
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
|
||||
Reference in New Issue
Block a user