mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix showbox
This commit is contained in:
6
dist/showbox/meta.js
vendored
6
dist/showbox/meta.js
vendored
@@ -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: "",
|
||||
|
||||
4
dist/showbox/posts.js
vendored
4
dist/showbox/posts.js
vendored
@@ -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) {
|
||||
|
||||
36
dist/showbox/stream.js
vendored
36
dist/showbox/stream.js
vendored
@@ -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}`;
|
||||
|
||||
@@ -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