From b1bbb4f8b5712b0496f0847a5b74873b37b3e1f5 Mon Sep 17 00:00:00 2001 From: himanshu8443 Date: Mon, 30 Jun 2025 12:11:42 +0530 Subject: [PATCH] build --- dist/moviezwap/catalog.js | 22 ++++++++ dist/moviezwap/episodes.js | 46 ++++++++++++++++ dist/moviezwap/meta.js | 106 +++++++++++++++++++++++++++++++++++++ dist/moviezwap/posts.js | 57 ++++++++++++++++++++ dist/moviezwap/stream.js | 35 ++++++++++++ 5 files changed, 266 insertions(+) create mode 100644 dist/moviezwap/catalog.js create mode 100644 dist/moviezwap/episodes.js create mode 100644 dist/moviezwap/meta.js create mode 100644 dist/moviezwap/posts.js create mode 100644 dist/moviezwap/stream.js diff --git a/dist/moviezwap/catalog.js b/dist/moviezwap/catalog.js new file mode 100644 index 0000000..c33f15e --- /dev/null +++ b/dist/moviezwap/catalog.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.genres = exports.catalog = void 0; +exports.catalog = [ + { + title: "Telugu Movies", + filter: "/category/Telugu-(2025)-Movies.html", + }, + { + title: "Tamil Movies", + filter: "/category/Tamil-(2025)-Movies.html", + }, + { + title: "Hollywood Telugu Dubbed", + filter: "/category/Telugu-Dubbed-Hollywood-Movies-Complete-Set.html", + }, + { + title: "Web Series", + filter: "/category/Telugu-Web-Series.html", + }, +]; +exports.genres = []; diff --git a/dist/moviezwap/episodes.js b/dist/moviezwap/episodes.js new file mode 100644 index 0000000..4a86787 --- /dev/null +++ b/dist/moviezwap/episodes.js @@ -0,0 +1,46 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEpisodes = void 0; +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + const { axios, cheerio, getBaseUrl } = providerContext; + try { + const res = yield axios.get(url); + const baseUrl = yield getBaseUrl("moviezwap"); + const html = res.data; + const $ = cheerio.load(html); + const episodeLinks = []; + $('a[href*="download.php?file="], a[href*="dwload.php?file="]').each((i, el) => { + var _a; + const downloadPage = ((_a = $(el).attr("href")) === null || _a === void 0 ? void 0 : _a.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 []; + } + }); +}; +exports.getEpisodes = getEpisodes; diff --git a/dist/moviezwap/meta.js b/dist/moviezwap/meta.js new file mode 100644 index 0000000..fe1ca83 --- /dev/null +++ b/dist/moviezwap/meta.js @@ -0,0 +1,106 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getMeta = void 0; +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const { axios, cheerio, getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("moviezwap"); + const url = link.startsWith("http") ? link : `${baseUrl}${link}`; + const res = yield axios.get(url); + const data = res.data; + const $ = cheerio.load(data); + // 1. Poster image find image with width 260 + let image = $('img[width="260"]').attr("src") || ""; + if (image && !image.startsWith("http")) { + image = baseUrl + image; + } + const tags = $("font[color='steelblue']") + .map((i, el) => $(el).text().trim()) + .get() + .slice(0, 2); + // 2. Title + const title = $("title").text().replace(" - MoviezWap", "").trim() || ""; + // 3. Info table + let synopsis = ""; + let imdbId = ""; + let type = "movie"; + let infoRows = []; + $("td:contains('Movie Information')") + .parent() + .nextAll("tr") + .each((i, el) => { + const tds = $(el).find("td"); + if (tds.length === 2) { + const key = tds.eq(0).text().trim(); + const value = tds.eq(1).text().trim(); + infoRows.push(`${key}: ${value}`); + if (key.toLowerCase().includes("plot")) + synopsis = value; + if (key.toLowerCase().includes("imdb")) + imdbId = value; + } + }); + if (!synopsis) { + // fallback: try to find a

with plot + synopsis = $("p:contains('plot')").text().trim(); + } + // 4. Download links (multiple qualities) + const links = []; + $('a[href*="download.php?file="], a[href*="dwload.php?file="]').each((i, el) => { + var _a; + const downloadPage = ((_a = $(el).attr("href")) === null || _a === void 0 ? void 0 : _a.replace("dwload.php", "download.php")) || ""; + const text = $(el).text().trim(); + if (downloadPage && /\d+p/i.test(text)) { + // Only add links with quality in text + links.push({ + title: text, + directLinks: [{ title: "Movie", link: baseUrl + downloadPage }], + }); + } + }); + $("img[src*='/images/play.png']").each((i, el) => { + const downloadPage = $(el).siblings("a").attr("href"); + const text = $(el).siblings("a").text().trim(); + console.log("Found link:🔥🔥", text, downloadPage); + if (downloadPage && text) { + links.push({ + title: text, + episodesLink: baseUrl + downloadPage, + }); + } + }); + return { + title, + synopsis, + image, + imdbId, + tags, + type, + linkList: links, + //info: infoRows.join("\n"), + }; + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); +}; +exports.getMeta = getMeta; diff --git a/dist/moviezwap/posts.js b/dist/moviezwap/posts.js new file mode 100644 index 0000000..b696579 --- /dev/null +++ b/dist/moviezwap/posts.js @@ -0,0 +1,57 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSearchPosts = exports.getPosts = void 0; +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("moviezwap"); + const url = `${baseUrl}${filter}`; + return posts({ url, signal, cheerio }); + }); +}; +exports.getPosts = getPosts; +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("moviezwap"); + const url = `${baseUrl}/search.php?q=${encodeURIComponent(searchQuery)}`; + return posts({ url, signal, cheerio }); + }); +}; +exports.getSearchPosts = getSearchPosts; +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, cheerio, }) { + try { + const res = yield fetch(url, { signal }); + const data = yield res.text(); + const $ = cheerio.load(data); + const catalog = []; + $('a[href^="/movie/"]').each((i, el) => { + const title = $(el).text().trim(); + const link = $(el).attr("href"); + const image = ""; + if (title && link) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("moviezwapGetPosts error ", err); + return []; + } + }); +} diff --git a/dist/moviezwap/stream.js b/dist/moviezwap/stream.js new file mode 100644 index 0000000..a71a814 --- /dev/null +++ b/dist/moviezwap/stream.js @@ -0,0 +1,35 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStream = getStream; +function getStream(_a) { + return __awaiter(this, arguments, void 0, function* ({ link, signal, providerContext, }) { + const { axios, cheerio, commonHeaders: headers } = providerContext; + const res = yield axios.get(link, { headers, signal }); + const html = res.data; + const $ = cheerio.load(html); + const Streams = []; + // Find the actual .mp4 download link + let downloadLink = null; + $('a:contains("Fast Download Server")').each((i, el) => { + const href = $(el).attr("href"); + if (href && href.toLocaleLowerCase().includes(".mp4")) { + Streams.push({ + link: href, + type: "mp4", + server: "Fast Download", + headers: headers, + }); + } + }); + return Streams; + }); +}