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

34
dist/vega/getEpisodesLink.js vendored Normal file
View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.vegaGetEpisodeLinks = void 0;
const vegaGetEpisodeLinks = async function ({ url, providerContext, }) {
const { axios, cheerio, commonHeaders: headers } = providerContext;
console.log('getEpisodeLinks', url);
try {
const res = await axios.get(url, { headers });
const $ = cheerio.load(res.data);
const container = $('.entry-content,.entry-inner');
$('.unili-content,.code-block-1').remove();
const episodes = [];
container.find('h4').each((index, element) => {
const el = $(element);
const title = el.text().replaceAll('-', '').replaceAll(':', '');
const link = el
.next('p')
.find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]')
.parent()
.attr('href');
if (title && link) {
episodes.push({ title, link });
}
});
// console.log(episodes);
return episodes;
}
catch (err) {
console.log('getEpisodeLinks error: ');
// console.error(err);
return [];
}
};
exports.vegaGetEpisodeLinks = vegaGetEpisodeLinks;