This commit is contained in:
himanshu8443
2025-07-11 19:45:14 +05:30
parent 13f71510d5
commit 35f1e57a0b
139 changed files with 10578 additions and 139 deletions

View File

@@ -1 +1,43 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(i,r){function a(t){try{d(o.next(t))}catch(t){r(t)}}function s(t){try{d(o.throw(t))}catch(t){r(t)}}function d(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}d((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}){try{const n=e.commonHeaders,{axios:o,cheerio:i}=e,r=(yield o.get(t,{headers:n})).data,a=i.load(r),s=[];return a(".dlink.dl").map((t,e)=>{var n,o;const i=null===(o=null===(n=a(e).find("a").text())||void 0===n?void 0:n.replace("Download",""))||void 0===o?void 0:o.trim(),r=a(e).find("a").attr("href");i&&r&&s.push({title:i,link:r})}),s}catch(t){return[]}})};exports.getEpisodes=getEpisodes;
"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, }) {
try {
const headers = providerContext.commonHeaders;
const { axios, cheerio } = providerContext;
const res = yield axios.get(url, { headers });
const data = res.data;
const $ = cheerio.load(data);
const episodeLinks = [];
$(".dlink.dl").map((i, element) => {
var _a, _b;
const title = (_b = (_a = $(element)
.find("a")
.text()) === null || _a === void 0 ? void 0 : _a.replace("Download", "")) === null || _b === void 0 ? void 0 : _b.trim();
const link = $(element).find("a").attr("href");
if (title && link) {
episodeLinks.push({
title,
link,
});
}
});
return episodeLinks;
}
catch (err) {
console.error("cl episode links", err);
return [];
}
});
};
exports.getEpisodes = getEpisodes;