feat: Add new provider implementations for Joya9tv and skyMovieHD

This commit is contained in:
himanshu8443
2025-10-02 14:19:47 +05:30
parent 56713a0be7
commit 0784a88fa7
20 changed files with 992 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import { EpisodeLink, ProviderContext } from "../types";
export const getEpisodes = function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const { axios, cheerio, commonHeaders: headers } = providerContext;
console.log("getEpisodeLinks", url);
return axios
.get(url, { headers })
.then((res) => {
const $ = cheerio.load(res.data);
const container = $(".entry-content, .entry-inner");
// Remove unnecessary elements
$(".unili-content, .code-block-1").remove();
const episodes: EpisodeLink[] = [];
container.find("h4, h3").each((_, element) => {
const el = $(element);
let title = el.text().replace(/[-:]/g, "").trim();
if (!title) return;
// Saare V-Cloud links fetch
el.next("p")
.find("a[href*='vcloud.lol']")
.each((_, a) => {
const anchor = $(a);
const href = anchor.attr("href")?.trim();
if (href) {
episodes.push({ title, link: href });
}
});
});
return episodes;
})
.catch((err) => {
console.log("getEpisodeLinks error:", err);
return [];
});
};