mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
fix showbox
This commit is contained in:
@@ -8,8 +8,9 @@ export const getMeta = async function ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Info> {
|
||||
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: "",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<Stream[]> {
|
||||
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}`;
|
||||
|
||||
Reference in New Issue
Block a user