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, }) {
|
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: "",
|
||||||
|
|||||||
4
dist/showbox/posts.js
vendored
4
dist/showbox/posts.js
vendored
@@ -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) {
|
||||||
|
|||||||
36
dist/showbox/stream.js
vendored
36
dist/showbox/stream.js
vendored
@@ -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}`;
|
||||||
|
|||||||
@@ -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: "",
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user