fix(route): multiple videos in posts of shuiguopai (#12698)
* fix(route): new domain for shuiguopai * fix(route): multiple videos in posts of shuiguopai * update index.js * fix: update new domain for shuiguopai
This commit is contained in:
parent
f32e8588c4
commit
07825f1340
|
|
@ -6,11 +6,13 @@ const { art } = require('@/utils/render');
|
|||
const path = require('path');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const rootUrl = 'http://shuiguopai.com';
|
||||
const rootUrl = 'https://sgp3.fun';
|
||||
const apiRootUrl = 'https://api.cbbee0.com';
|
||||
const listUrl = `${apiRootUrl}/v1_2/homePage`;
|
||||
const filmUrl = `${apiRootUrl}/v1_2/filmInfo`;
|
||||
|
||||
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 50;
|
||||
|
||||
const response = await got({
|
||||
method: 'post',
|
||||
url: listUrl,
|
||||
|
|
@ -18,7 +20,7 @@ module.exports = async (ctx) => {
|
|||
device_id: '',
|
||||
hm: '008-api',
|
||||
last_page: 0,
|
||||
length: 3,
|
||||
length: limit,
|
||||
ltype: 1,
|
||||
page: 1,
|
||||
userToken: '',
|
||||
|
|
@ -48,18 +50,20 @@ module.exports = async (ctx) => {
|
|||
url: filmUrl,
|
||||
json: {
|
||||
device_id: '',
|
||||
film_id: detailResponse.data.match(/film_id:"(\d+)",/)[1],
|
||||
film_id: detailResponse.data.match(/film_id:"([\d,]+)",/)[1],
|
||||
hm: '008-api',
|
||||
userToken: '',
|
||||
},
|
||||
});
|
||||
|
||||
const data = infoResponse.data.data[0];
|
||||
const data = infoResponse.data.data;
|
||||
|
||||
item.author = data.actor;
|
||||
item.category = data.tags.map((t) => t.tag_title);
|
||||
const videos = data.map((d) => d.download_url);
|
||||
|
||||
item.category = data.flatMap((d) => d.tags.map((t) => t.tag_title));
|
||||
item.author = data.map((d) => d.actor).join(' ');
|
||||
item.description = art(path.join(__dirname, 'templates/description.art'), {
|
||||
video: data.download_url,
|
||||
videos,
|
||||
description: content('.content').html(),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{{ if video }}
|
||||
{{ if videos }}
|
||||
{{ each videos video }}
|
||||
<video controls>
|
||||
<source src="{{ video }}" type="video/mp4">
|
||||
</video>
|
||||
{{ /each }}
|
||||
{{ /if }}
|
||||
{{@ description }}
|
||||
Loading…
Reference in New Issue