This commit is contained in:
himanshu8443
2025-06-15 21:29:40 +05:30
commit 3f3e12f5df
299 changed files with 18729 additions and 0 deletions

37
dist/world4u/world4uGetEpisodeLinks.js vendored Normal file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.world4uGetEpisodeLinks = void 0;
const world4uGetEpisodeLinks = async function ({ url, providerContext, }) {
const { axios, cheerio } = providerContext;
try {
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
const episodeLinks = [];
$('strong:contains("Episode"),strong:contains("1080"),strong:contains("720"),strong:contains("480")').map((i, element) => {
const title = $(element).text();
const link = $(element)
.parent()
.parent()
.next('h4')
.find('a')
.attr('href');
if (link && !title.includes('zip')) {
episodeLinks.push({
title: title,
link,
});
}
});
return episodeLinks;
}
catch (err) {
return [
{
title: 'Server 1',
link: url,
},
];
}
};
exports.world4uGetEpisodeLinks = world4uGetEpisodeLinks;