Skip to content

Commit b956aed

Browse files
author
catpaw
committed
detail likes demo.
1 parent f0c9895 commit b956aed

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Diff for: nodejs/.prettierrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": true,
4+
"tabWidth": 4,
5+
"singleQuote": true,
6+
"printWidth": 10000
7+
}

Diff for: nodejs/src/index.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
},
66
},
77
ffm3u8: {
8-
url: 'https://cj.ffzyapi.com/api.php/provide/vod/',
8+
url: 'https://cj.ffzyapi.com/api.php/provide/vod/from/ffm3u8',
99
categories: ['国产剧', '香港剧', '韩国剧', '欧美剧', '台湾剧', '日本剧', '海外剧', '泰国剧', '短剧', '动作片', '喜剧片', '爱情片', '科幻片', '恐怖片', '剧情片', '战争片', '动漫片', '大陆综艺', '港台综艺', '日韩综艺', '欧美综艺', '国产动漫', '日韩动漫', '欧美动漫', '港台动漫', '海外动漫', '记录片'],
1010
},
1111
alist: [

Diff for: nodejs/src/spider/video/ffm3u8.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ async function init(inReq, _outResp) {
1717
return {};
1818
}
1919

20+
const testSiteLikes = [];
21+
2022
async function home(_inReq, _outResp) {
2123
const data = await request(url);
2224
let classes = [];
@@ -35,6 +37,17 @@ async function home(_inReq, _outResp) {
3537
return categories.indexOf(a.type_name) - categories.indexOf(b.type_name);
3638
});
3739
}
40+
if (data.list) {
41+
const likes = await request(url + `?ac=detail&ids=${data.list.map((v) => v.vod_id).join(',')}`);
42+
for (const vod of likes.list) {
43+
testSiteLikes.push({
44+
vod_id: vod.vod_id.toString(),
45+
vod_name: vod.vod_name.toString(),
46+
vod_pic: vod.vod_pic,
47+
vod_remarks: vod.vod_remarks,
48+
});
49+
}
50+
}
3851
return {
3952
class: classes,
4053
};
@@ -82,6 +95,7 @@ async function detail(inReq, _outResp) {
8295
vod_play_from: data.vod_play_from,
8396
vod_play_url: data.vod_play_url,
8497
};
98+
vod.likes = testSiteLikes;
8599
videos.push(vod);
86100
}
87101
return {
@@ -123,7 +137,9 @@ async function proxy(inReq, outResp) {
123137
const hls = HLS.stringify(plist);
124138
let hlsHeaders = {};
125139
if (resp.headers['content-length']) {
126-
Object.assign(hlsHeaders, resp.headers, { 'content-length': hls.length.toString() });
140+
Object.assign(hlsHeaders, resp.headers, {
141+
'content-length': hls.length.toString(),
142+
});
127143
} else {
128144
Object.assign(hlsHeaders, resp.headers);
129145
}

0 commit comments

Comments
 (0)