diff --git a/dist/showbox/meta.js b/dist/showbox/meta.js index 4bfb71d..36dca77 100644 --- a/dist/showbox/meta.js +++ b/dist/showbox/meta.js @@ -14,8 +14,9 @@ const getMeta = function (_a) { return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { var _b, _c, _d, _e, _f, _g, _h, _j, _k; try { - const { axios, cheerio } = providerContext; - const url = link; + const { axios, cheerio, getBaseUrl } = providerContext; + const baseUrlShowbox = yield getBaseUrl("showbox"); + const url = baseUrlShowbox + link; const res = yield axios.get(url); const data = res.data; const $ = cheerio.load(data); @@ -59,6 +60,7 @@ const getMeta = function (_a) { }; } catch (err) { + console.error("Error fetching metadata:", err); return { title: "", rating: "", diff --git a/dist/showbox/posts.js b/dist/showbox/posts.js index 18790b8..71f82e1 100644 --- a/dist/showbox/posts.js +++ b/dist/showbox/posts.js @@ -41,8 +41,8 @@ function posts(_a) { const data = res.data; const $ = cheerio.load(data); const catalog = []; - $(".movie-item").map((i, element) => { - const title = $(element).find(".movie-title").text(); + $(".movie-item,.flw-item").map((i, element) => { + const title = $(element).find(".film-name").text().trim(); const link = $(element).find("a").attr("href"); const image = $(element).find("img").attr("src"); if (title && link && image) { diff --git a/dist/showbox/stream.js b/dist/showbox/stream.js index 679c388..d7f2258 100644 --- a/dist/showbox/stream.js +++ b/dist/showbox/stream.js @@ -1,37 +1,4 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); 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) { @@ -43,13 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStream = void 0; -const cheerio = __importStar(require("cheerio")); const getStream = function (_a) { return __awaiter(this, arguments, void 0, function* ({ link: id, // type, signal, providerContext, }) { try { - const { axios } = providerContext; + const { axios, cheerio } = providerContext; const stream = []; const [, epId] = id.split("&"); const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`; diff --git a/providers/showbox/meta.ts b/providers/showbox/meta.ts index be08111..96a8b12 100644 --- a/providers/showbox/meta.ts +++ b/providers/showbox/meta.ts @@ -8,8 +8,9 @@ export const getMeta = async function ({ providerContext: ProviderContext; }): Promise { try { - const { axios, cheerio } = providerContext; - const url = link; + const { axios, cheerio, getBaseUrl } = providerContext; + const baseUrlShowbox = await getBaseUrl("showbox"); + const url = baseUrlShowbox + link; const res = await axios.get(url); const data = res.data; const $ = cheerio.load(data); @@ -59,6 +60,7 @@ export const getMeta = async function ({ linkList: links, }; } catch (err) { + console.error("Error fetching metadata:", err); return { title: "", rating: "", diff --git a/providers/showbox/posts.ts b/providers/showbox/posts.ts index 30a26c4..cd17cc3 100644 --- a/providers/showbox/posts.ts +++ b/providers/showbox/posts.ts @@ -56,8 +56,8 @@ async function posts({ const data = res.data; const $ = cheerio.load(data); const catalog: Post[] = []; - $(".movie-item").map((i, element) => { - const title = $(element).find(".movie-title").text(); + $(".movie-item,.flw-item").map((i, element) => { + const title = $(element).find(".film-name").text().trim(); const link = $(element).find("a").attr("href"); const image = $(element).find("img").attr("src"); if (title && link && image) { diff --git a/providers/showbox/stream.ts b/providers/showbox/stream.ts index 138ea89..b40efc8 100644 --- a/providers/showbox/stream.ts +++ b/providers/showbox/stream.ts @@ -1,5 +1,4 @@ import { Stream, ProviderContext } from "../types"; -import * as cheerio from "cheerio"; export const getStream = async function ({ link: id, @@ -13,7 +12,7 @@ export const getStream = async function ({ providerContext: ProviderContext; }): Promise { try { - const { axios } = providerContext; + const { axios, cheerio } = providerContext; const stream: Stream[] = []; const [, epId] = id.split("&"); const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`;