Add MoviezWap provider and update manifest (#1)

Co-authored-by: shaker <your_github_username@users.noreply.github.com>
Co-authored-by: himanshu8443 <sangwanhimanshu8443@gmail.com>
This commit is contained in:
Shaker
2025-06-30 12:04:26 +05:30
committed by GitHub
parent 6b0a4b7484
commit 305e3d2552
6 changed files with 281 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
import { EpisodeLink, ProviderContext } from "../types";
export const getEpisodes = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const { axios, cheerio, getBaseUrl } = providerContext;
try {
const res = await axios.get(url);
const baseUrl = await getBaseUrl("moviezwap");
const html = res.data;
const $ = cheerio.load(html);
const episodeLinks: EpisodeLink[] = [];
$('a[href*="download.php?file="], a[href*="dwload.php?file="]').each(
(i, el) => {
const downloadPage =
$(el).attr("href")?.replace("dwload.php", "download.php") || "";
let text = $(el).text().trim();
if (text.includes("Download page")) {
// Remove "Download" from the text
text = "Play";
}
if (downloadPage && text) {
// Only add links with quality in text
episodeLinks.push({
title: text,
link: baseUrl + downloadPage,
});
}
}
);
return episodeLinks;
} catch (err) {
console.error(err);
return [];
}
};