fix showbox

This commit is contained in:
himanshu8443
2025-06-23 21:13:22 +05:30
parent f9906e1964
commit dcf40b6f74
6 changed files with 14 additions and 45 deletions

View File

@@ -14,8 +14,9 @@ const getMeta = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
var _b, _c, _d, _e, _f, _g, _h, _j, _k; var _b, _c, _d, _e, _f, _g, _h, _j, _k;
try { try {
const { axios, cheerio } = providerContext; const { axios, cheerio, getBaseUrl } = providerContext;
const url = link; const baseUrlShowbox = yield getBaseUrl("showbox");
const url = baseUrlShowbox + link;
const res = yield axios.get(url); const res = yield axios.get(url);
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
@@ -59,6 +60,7 @@ const getMeta = function (_a) {
}; };
} }
catch (err) { catch (err) {
console.error("Error fetching metadata:", err);
return { return {
title: "", title: "",
rating: "", rating: "",

View File

@@ -41,8 +41,8 @@ function posts(_a) {
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog = []; const catalog = [];
$(".movie-item").map((i, element) => { $(".movie-item,.flw-item").map((i, element) => {
const title = $(element).find(".movie-title").text(); const title = $(element).find(".film-name").text().trim();
const link = $(element).find("a").attr("href"); const link = $(element).find("a").attr("href");
const image = $(element).find("img").attr("src"); const image = $(element).find("img").attr("src");
if (title && link && image) { if (title && link && image) {

View File

@@ -1,37 +1,4 @@
"use strict"; "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) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { 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 }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getStream = void 0; exports.getStream = void 0;
const cheerio = __importStar(require("cheerio"));
const getStream = function (_a) { const getStream = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link: id, return __awaiter(this, arguments, void 0, function* ({ link: id,
// type, // type,
signal, providerContext, }) { signal, providerContext, }) {
try { try {
const { axios } = providerContext; const { axios, cheerio } = providerContext;
const stream = []; const stream = [];
const [, epId] = id.split("&"); const [, epId] = id.split("&");
const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`; const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`;

View File

@@ -8,8 +8,9 @@ export const getMeta = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Info> { }): Promise<Info> {
try { try {
const { axios, cheerio } = providerContext; const { axios, cheerio, getBaseUrl } = providerContext;
const url = link; const baseUrlShowbox = await getBaseUrl("showbox");
const url = baseUrlShowbox + link;
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
@@ -59,6 +60,7 @@ export const getMeta = async function ({
linkList: links, linkList: links,
}; };
} catch (err) { } catch (err) {
console.error("Error fetching metadata:", err);
return { return {
title: "", title: "",
rating: "", rating: "",

View File

@@ -56,8 +56,8 @@ async function posts({
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$(".movie-item").map((i, element) => { $(".movie-item,.flw-item").map((i, element) => {
const title = $(element).find(".movie-title").text(); const title = $(element).find(".film-name").text().trim();
const link = $(element).find("a").attr("href"); const link = $(element).find("a").attr("href");
const image = $(element).find("img").attr("src"); const image = $(element).find("img").attr("src");
if (title && link && image) { if (title && link && image) {

View File

@@ -1,5 +1,4 @@
import { Stream, ProviderContext } from "../types"; import { Stream, ProviderContext } from "../types";
import * as cheerio from "cheerio";
export const getStream = async function ({ export const getStream = async function ({
link: id, link: id,
@@ -13,7 +12,7 @@ export const getStream = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Stream[]> { }): Promise<Stream[]> {
try { try {
const { axios } = providerContext; const { axios, cheerio } = providerContext;
const stream: Stream[] = []; const stream: Stream[] = [];
const [, epId] = id.split("&"); const [, epId] = id.split("&");
const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`; const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`;