Skip to content

Commit 56419bf

Browse files
author
Taois
committed
fix: 修复错误
1 parent 02dc7d1 commit 56419bf

File tree

9 files changed

+73
-3
lines changed

9 files changed

+73
-3
lines changed

controllers/api.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import * as drpyS from '../libs/drpyS.js';
88
import * as drpy2 from '../libs/drpy2.js';
99
import * as hipy from '../libs/hipy.js';
1010
import * as xbpq from '../libs/xbpq.js';
11+
import * as catvod from '../libs/catvod.js';
1112

1213
const ENGINES = {
1314
drpyS,
1415
drpy2,
1516
hipy,
1617
xbpq,
18+
catvod,
1719
};
1820

1921
export default (fastify, options, done) => {

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const jsonDir = path.join(__dirname, 'json');
1919
const jsDir = path.join(__dirname, 'spider/js');
2020
const dr2Dir = path.join(__dirname, 'spider/js_dr2');
2121
const pyDir = path.join(__dirname, 'spider/py');
22+
const catDir = path.join(__dirname, 'spider/catvod');
23+
const xbpqDir = path.join(__dirname, 'spider/xbpq');
2224

2325
// 静态资源
2426
fastify.register(fastifyStatic, {
@@ -100,6 +102,8 @@ registerRoutes(fastify, {
100102
jsDir: jsDir,
101103
dr2Dir: dr2Dir,
102104
pyDir: pyDir,
105+
catDir: catDir,
106+
xbpqDir: xbpqDir,
103107
viewsDir: path.join(__dirname, 'views'),
104108
configDir: path.join(__dirname, 'config'),
105109
PORT,

libs/catvod.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
const getRule = async function () {
2+
3+
}
4+
5+
const init = async function () {
6+
7+
}
8+
9+
const home = async function () {
10+
11+
}
12+
13+
const homeVod = async function () {
14+
15+
}
16+
17+
18+
const cate = async function () {
19+
20+
}
21+
22+
const detail = async function () {
23+
24+
}
25+
26+
27+
const search = async function () {
28+
29+
}
30+
31+
const play = async function () {
32+
33+
}
34+
35+
36+
const proxy = async function () {
37+
38+
}
39+
40+
const action = async function () {
41+
42+
}
43+
44+
export default {
45+
getRule,
46+
init,
47+
home,
48+
homeVod,
49+
cate,
50+
detail,
51+
search,
52+
play,
53+
proxy,
54+
action,
55+
}

libs/drpy2.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//在线解析py源,能力有限,暂时不会
21
const getRule = async function () {
32

43
}

libs/hipy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//在线解析py源,能力有限,暂时不会
21
const getRule = async function () {
32

43
}

libs/xbpq.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//在线解析py源,能力有限,暂时不会
21
const getRule = async function () {
32

43
}

spider/catvod/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {}

spider/xbpq/test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

utils/api_helper.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ export function getApiEngine(engines, moduleName, query, options) {
4949
moduleDir = options.pyDir;
5050
_ext = '.py';
5151
break;
52+
case 'cat':
53+
apiEngine = engines.catvod;
54+
moduleDir = options.catDir;
55+
_ext = '.js';
56+
break;
57+
case 'xbpq':
58+
apiEngine = engines.xbpq;
59+
moduleDir = options.xbpqDir;
60+
_ext = '.json';
61+
break;
5262
default:
5363
apiEngine = engines.drpyS;
5464
moduleDir = options.jsDir;

0 commit comments

Comments
 (0)