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:
76
dist/mod/meta.js
vendored
76
dist/mod/meta.js
vendored
@@ -1 +1,75 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,a){function r(t){try{d(n.next(t))}catch(t){a(t)}}function s(t){try{d(n.throw(t))}catch(t){a(t)}}function d(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,s)}d((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;try{const{axios:n,cheerio:o}=e,a=t,r=(yield n.get(a)).data,s=o.load(r),d={title:s(".imdbwp__title").text(),synopsis:s(".imdbwp__teaser").text(),image:s(".imdbwp__thumb").find("img").attr("src")||"",imdbId:(null===(i=s(".imdbwp__link").attr("href"))||void 0===i?void 0:i.split("/")[4])||"",type:s(".thecontent").text().toLocaleLowerCase().includes("season")?"series":"movie"},l=[];return s("h3,h4").map((t,e)=>{var i;const n=s(e).text(),o=s(e).next("p").find(".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download").attr("href"),a=s(e).next("p").find(".maxbutton-download-links").attr("href");(a||o&&"javascript:void(0);"!==o)&&l.push({title:n.replace("Download ","").trim()||"Download",episodesLink:o||"",directLinks:a?[{link:a,title:"Movie",type:"movie"}]:[],quality:(null===(i=null==n?void 0:n.match(/\d+p\b/))||void 0===i?void 0:i[0])||""})}),Object.assign(Object.assign({},d),{linkList:l})}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;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = yield 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: ((_b = $(".imdbwp__link").attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "",
|
||||
type: $(".thecontent").text().toLocaleLowerCase().includes("season")
|
||||
? "series"
|
||||
: "movie",
|
||||
};
|
||||
const links = [];
|
||||
$("h3,h4").map((i, element) => {
|
||||
var _a;
|
||||
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: ((_a = seriesTitle === null || seriesTitle === void 0 ? void 0 : seriesTitle.match(/\d+p\b/)) === null || _a === void 0 ? void 0 : _a[0]) || "",
|
||||
});
|
||||
}
|
||||
});
|
||||
// console.log('mod meta', links);
|
||||
return Object.assign(Object.assign({}, meta), { linkList: links });
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
|
||||
Reference in New Issue
Block a user