mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
unminify
This commit is contained in:
19
dist/showbox/catalog.js
vendored
19
dist/showbox/catalog.js
vendored
@@ -1 +1,18 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Home",filter:""},{title:"Movies",filter:"/movie"},{title:"TV Shows",filter:"/tv"}],exports.genres=[];
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Home",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/movie",
|
||||
},
|
||||
{
|
||||
title: "TV Shows",
|
||||
filter: "/tv",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
|
||||
55
dist/showbox/episodes.js
vendored
55
dist/showbox/episodes.js
vendored
@@ -1 +1,54 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(s,o){function r(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(t){return __awaiter(this,arguments,void 0,function*({url:t,providerContext:e}){const{axios:i}=e;try{const[e,n]=t.split("&"),s=n?`https://www.febbox.com/file/file_share_list?share_key=${e}&pwd=&parent_id=${n}&is_html=0`:`https://www.febbox.com/file/file_share_list?share_key=${e}&pwd=&is_html=0`,o=yield i.get(s),r=o.data.data.file_list,a=[];return null==r||r.map(t=>{const i=formatEpisodeName(t.file_name),n=null==t?void 0:t.fid;!t.is_dir&&i&&n&&a.push({title:i,link:`${e}&${n}`})}),a}catch(t){return[]}})};function formatEpisodeName(t){const e=t.match(/[sS](\d+)\s*[eE](\d+)/);if(e){return`Season${e[1].padStart(2,"0")} Episode${e[2].padStart(2,"0")}`}return t}exports.getEpisodes=getEpisodes;
|
||||
"use strict";
|
||||
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) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url: id, providerContext, }) {
|
||||
const { axios } = providerContext;
|
||||
try {
|
||||
const [fileId, febboxId] = id.split("&");
|
||||
const febLink = febboxId
|
||||
? `https://www.febbox.com/file/file_share_list?share_key=${fileId}&pwd=&parent_id=${febboxId}&is_html=0`
|
||||
: `https://www.febbox.com/file/file_share_list?share_key=${fileId}&pwd=&is_html=0`;
|
||||
const res = yield axios.get(febLink);
|
||||
const data = res.data;
|
||||
const fileList = data.data.file_list;
|
||||
const episodeLinks = [];
|
||||
fileList === null || fileList === void 0 ? void 0 : fileList.map((file) => {
|
||||
const fileName = formatEpisodeName(file.file_name);
|
||||
const epId = file === null || file === void 0 ? void 0 : file.fid;
|
||||
if (!file.is_dir && fileName && epId) {
|
||||
episodeLinks.push({
|
||||
title: fileName,
|
||||
link: `${fileId}&${epId}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
function formatEpisodeName(title) {
|
||||
const regex = /[sS](\d+)\s*[eE](\d+)/;
|
||||
const match = title.match(regex);
|
||||
if (match) {
|
||||
const season = match[1].padStart(2, "0");
|
||||
const episode = match[2].padStart(2, "0");
|
||||
return `Season${season} Episode${episode}`;
|
||||
}
|
||||
else {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
||||
77
dist/showbox/meta.js
vendored
77
dist/showbox/meta.js
vendored
@@ -1 +1,76 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,l){function a(i){try{s(n.next(i))}catch(i){l(i)}}function d(i){try{s(n.throw(i))}catch(i){l(i)}}function s(i){var t;i.done?o(i.value):(t=i.value,t instanceof e?t:new e(function(i){i(t)})).then(a,d)}s((n=n.apply(i,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(i){return __awaiter(this,arguments,void 0,function*({link:i,providerContext:t}){var e,n,o,l,a,d,s,r,v;try{const{axios:u,cheerio:c,getBaseUrl:p}=t,f=(yield p("showbox"))+i,h=(yield u.get(f)).data,_=c.load(h),g=f.includes("tv")?"series":"movie",m="",y=_(".heading-name").text(),x=(null===(n=null===(e=_(".btn-imdb").text())||void 0===e?void 0:e.match(/\d+(\.\d+)?/g))||void 0===n?void 0:n[0])||"",w=(null===(l=null===(o=_(".cover_follow").attr("style"))||void 0===o?void 0:o.split("url(")[1])||void 0===l?void 0:l.split(")")[0])||"",$=null===(d=null===(a=_(".description").text())||void 0===a?void 0:a.replace(/[\n\t]/g,""))||void 0===d?void 0:d.trim(),b=null===(r=null===(s=_(".heading-name").find("a").attr("href"))||void 0===s?void 0:s.split("/"))||void 0===r?void 0:r.pop(),k=`${f.split("/").slice(0,3).join("/")}/index/share_link?id=${b}&type=${"movie"===g?"1":"2"}`,M=yield u.get(k),L=M.data.data.link.split("/").pop(),j=`https://www.febbox.com/file/file_share_list?share_key=${L}&is_html=0`,I=(yield u.get(j)).data,P=null===(v=null==I?void 0:I.data)||void 0===v?void 0:v.file_list,z=[];return P&&P.map(i=>{const t=`${i.file_name} (${i.file_size})`,e=i.fid;z.push({title:t,episodesLink:i.is_dir?`${L}&${e}`:`${L}&`})}),{title:y,rating:x,synopsis:$,image:w,imdbId:m,type:g,linkList:z}}catch(i){return{title:"",rating:"",synopsis:"",image:"",imdbId:"",type:"",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
"use strict";
|
||||
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) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
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, 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);
|
||||
const type = url.includes("tv") ? "series" : "movie";
|
||||
const imdbId = "";
|
||||
const title = $(".heading-name").text();
|
||||
const rating = ((_c = (_b = $(".btn-imdb")
|
||||
.text()) === null || _b === void 0 ? void 0 : _b.match(/\d+(\.\d+)?/g)) === null || _c === void 0 ? void 0 : _c[0]) || "";
|
||||
const image = ((_e = (_d = $(".cover_follow").attr("style")) === null || _d === void 0 ? void 0 : _d.split("url(")[1]) === null || _e === void 0 ? void 0 : _e.split(")")[0]) || "";
|
||||
const synopsis = (_g = (_f = $(".description")
|
||||
.text()) === null || _f === void 0 ? void 0 : _f.replace(/[\n\t]/g, "")) === null || _g === void 0 ? void 0 : _g.trim();
|
||||
const febID = (_j = (_h = $(".heading-name").find("a").attr("href")) === null || _h === void 0 ? void 0 : _h.split("/")) === null || _j === void 0 ? void 0 : _j.pop();
|
||||
const baseUrl = url.split("/").slice(0, 3).join("/");
|
||||
const indexUrl = `${baseUrl}/index/share_link?id=${febID}&type=${type === "movie" ? "1" : "2"}`;
|
||||
const indexRes = yield axios.get(indexUrl);
|
||||
const indexData = indexRes.data;
|
||||
const febKey = indexData.data.link.split("/").pop();
|
||||
const febLink = `https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`;
|
||||
const febRes = yield axios.get(febLink);
|
||||
const febData = febRes.data;
|
||||
const fileList = (_k = febData === null || febData === void 0 ? void 0 : febData.data) === null || _k === void 0 ? void 0 : _k.file_list;
|
||||
const links = [];
|
||||
if (fileList) {
|
||||
fileList.map((file) => {
|
||||
const fileName = `${file.file_name} (${file.file_size})`;
|
||||
const fileId = file.fid;
|
||||
links.push({
|
||||
title: fileName,
|
||||
episodesLink: file.is_dir ? `${febKey}&${fileId}` : `${febKey}&`,
|
||||
});
|
||||
});
|
||||
}
|
||||
return {
|
||||
title,
|
||||
rating,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error("Error fetching metadata:", err);
|
||||
return {
|
||||
title: "",
|
||||
rating: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
|
||||
63
dist/showbox/posts.js
vendored
63
dist/showbox/posts.js
vendored
@@ -1 +1,62 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,o){return new(r||(r=Promise))(function(i,s){function n(t){try{c(o.next(t))}catch(t){s(t)}}function a(t){try{c(o.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(n,a)}c((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,page:e,signal:r,providerContext:o}){const{getBaseUrl:i,axios:s,cheerio:n}=o,a=yield i("showbox");return posts({url:`${a+t}?page=${e}/`,signal:r,baseUrl:a,axios:s,cheerio:n})})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:r,providerContext:o}){const{getBaseUrl:i,axios:s,cheerio:n}=o,a=yield i("showbox");return posts({url:`${a}/search?keyword=${t}&page=${e}`,signal:r,baseUrl:a,axios:s,cheerio:n})})};function posts(t){return __awaiter(this,arguments,void 0,function*({url:t,signal:e,axios:r,cheerio:o}){try{const i=(yield r.get(t,{signal:e})).data,s=o.load(i),n=[];return s(".movie-item,.flw-item").map((t,e)=>{const r=s(e).find(".film-name").text().trim(),o=s(e).find("a").attr("href"),i=s(e).find("img").attr("src");r&&o&&i&&n.push({title:r,link:o,image:i})}),n}catch(t){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
"use strict";
|
||||
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) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("showbox");
|
||||
const url = `${baseUrl + filter}?page=${page}/`;
|
||||
return posts({ url, signal, baseUrl, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("showbox");
|
||||
const url = `${baseUrl}/search?keyword=${searchQuery}&page=${page}`;
|
||||
return posts({ url, signal, baseUrl, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, signal,
|
||||
// baseUrl,
|
||||
axios, cheerio, }) {
|
||||
try {
|
||||
const res = yield axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".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) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
48
dist/showbox/stream.js
vendored
48
dist/showbox/stream.js
vendored
@@ -1 +1,47 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,a){function o(t){try{s(i.next(t))}catch(t){a(t)}}function c(t){try{s(i.throw(t))}catch(t){a(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,c)}s((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(t){return __awaiter(this,arguments,void 0,function*({link:t,signal:e,providerContext:n}){try{const{axios:i,cheerio:r}=n,a=[],[,o]=t.split("&"),c=`https://febbox.vercel.app/api/video-quality?fid=${o}`,s=(yield i.get(c,{signal:e})).data,u=r.load(s.html);return u(".file_quality").each((t,e)=>{const n=u(e).find("p.name").text()+" - "+u(e).find("p.size").text()+" - "+u(e).find("p.speed").text(),i=u(e).attr("data-url");i&&a.push({server:n,type:"mkv",link:i})}),a}catch(t){return[]}})};exports.getStream=getStream;
|
||||
"use strict";
|
||||
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) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link: id,
|
||||
// type,
|
||||
signal, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const stream = [];
|
||||
const [, epId] = id.split("&");
|
||||
const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`;
|
||||
const res = yield axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data.html);
|
||||
$(".file_quality").each((i, el) => {
|
||||
const server = $(el).find("p.name").text() +
|
||||
" - " +
|
||||
$(el).find("p.size").text() +
|
||||
" - " +
|
||||
$(el).find("p.speed").text();
|
||||
const link = $(el).attr("data-url");
|
||||
if (link) {
|
||||
stream.push({
|
||||
server: server,
|
||||
type: "mkv",
|
||||
link: link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return stream;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
|
||||
Reference in New Issue
Block a user