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:
Ethan Shen 2023-06-29 00:48:28 +08:00 committed by GitHub
parent f32e8588c4
commit 07825f1340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -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(),
});

View File

@ -1,6 +1,8 @@
{{ if video }}
{{ if videos }}
{{ each videos video }}
<video controls>
<source src="{{ video }}" type="video/mp4">
</video>
{{ /each }}
{{ /if }}
{{@ description }}