mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
minify
This commit is contained in:
55
dist/showbox/episodes.js
vendored
55
dist/showbox/episodes.js
vendored
@@ -1,54 +1 @@
|
||||
"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;
|
||||
}
|
||||
}
|
||||
"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;
|
||||
Reference in New Issue
Block a user