mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
build
This commit is contained in:
37
dist/world4u/episodes.js
vendored
37
dist/world4u/episodes.js
vendored
@@ -1,37 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = 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.getEpisodes = getEpisodes;
|
||||
Reference in New Issue
Block a user