This commit is contained in:
himanshu8443
2025-07-11 19:17:23 +05:30
parent 6ca69cf93b
commit 13f71510d5
139 changed files with 139 additions and 10578 deletions

View File

@@ -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 baseUrl = link.split("/").slice(0, 3).join("/");
const res = yield axios.get(url);
const html = yield res.data;
const $ = cheerio.load(html);
const imdbId = ((_b = $(".movie_info")
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
.attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "";
const type = $(".show_season").html() ? "series" : "movie";
const linkList = [];
$(".show_season").each((i, element) => {
const seasonTitle = "Season " + $(element).attr("data-id");
const episodes = [];
$(element)
.children()
.each((i, element2) => {
const episodeTitle = $(element2)
.find("a")
.children()
.remove()
.end()
.text()
.trim()
.replace("E", "Epiosode ");
const episodeLink = baseUrl + $(element2).find("a").attr("href");
if (episodeTitle && episodeLink) {
episodes.push({
title: episodeTitle,
link: episodeLink,
});
}
});
linkList.push({
title: seasonTitle,
directLinks: episodes,
});
});
if (type === "movie") {
linkList.push({
title: "Movie",
directLinks: [
{
link: link,
title: "Movie",
type: "movie",
},
],
});
}
return {
title: "",
image: "",
imdbId: imdbId,
synopsis: "",
type: type,
linkList: linkList,
};
}
catch (error) {
console.error(error);
return {
title: "",
image: "",
imdbId: "",
synopsis: "",
linkList: [],
type: "uhd",
};
}
});
};
exports.getMeta = getMeta;
"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;try{const{axios:n,cheerio:o}=e,r=t,s=t.split("/").slice(0,3).join("/"),a=yield n.get(r),c=yield a.data,d=o.load(c),l=(null===(i=d(".movie_info").find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])').attr("href"))||void 0===i?void 0:i.split("/")[4])||"",h=d(".show_season").html()?"series":"movie",u=[];return d(".show_season").each((t,e)=>{const i="Season "+d(e).attr("data-id"),n=[];d(e).children().each((t,e)=>{const i=d(e).find("a").children().remove().end().text().trim().replace("E","Epiosode "),o=s+d(e).find("a").attr("href");i&&o&&n.push({title:i,link:o})}),u.push({title:i,directLinks:n})}),"movie"===h&&u.push({title:"Movie",directLinks:[{link:t,title:"Movie",type:"movie"}]}),{title:"",image:"",imdbId:l,synopsis:"",type:h,linkList:u}}catch(t){return{title:"",image:"",imdbId:"",synopsis:"",linkList:[],type:"uhd"}}})};exports.getMeta=getMeta;