diff --git a/lib/v2/hupu/bbs.js b/lib/v2/hupu/bbs.js
index 334ea0cca..929c04813 100644
--- a/lib/v2/hupu/bbs.js
+++ b/lib/v2/hupu/bbs.js
@@ -2,12 +2,15 @@ const got = require('@/utils/got');
const cheerio = require('cheerio');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
module.exports = async (ctx) => {
const id = ctx.params.id ?? '34';
const order = ctx.params.order ?? '1';
const rootUrl = 'https://bbs.hupu.com';
+ const apiRootUrl = 'https://games.mobileapi.hupu.com';
const currentUrl = `${rootUrl}/${id}${order === '1' ? `-postdate` : ''}`;
const response = await got({
@@ -35,7 +38,7 @@ module.exports = async (ctx) => {
items.map((item) =>
ctx.cache.tryGet(item.link, async () => {
try {
- const detailResponse = await got({
+ let detailResponse = await got({
method: 'get',
url: item.link,
});
@@ -46,6 +49,24 @@ module.exports = async (ctx) => {
item.author = content('.post-user-comp-info-top-name').first().text();
item.description = content('.main-thread').first().html();
+
+ const matches = detailResponse.data.match(/matchId=(\d+)-BATTLE_REPORT/);
+
+ if (matches) {
+ detailResponse = await got({
+ method: 'get',
+ url: `${apiRootUrl}/1/7.5.36/basketballapi/news/battleReport?relationId=${matches[1]}&relationType=BATTLE_REPORT`,
+ });
+
+ const result = detailResponse.data.result;
+
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
+ image: result.img,
+ description: result.beginContent,
+ keyEvent: result.keyEvent,
+ playerImage: result.playerScoreImg,
+ });
+ }
} catch (e) {
// no-empty
}
diff --git a/lib/v2/hupu/templates/description.art b/lib/v2/hupu/templates/description.art
new file mode 100644
index 000000000..3d417ad52
--- /dev/null
+++ b/lib/v2/hupu/templates/description.art
@@ -0,0 +1,22 @@
+{{ if image }}
+
+{{ /if }}
+
+{{ if description }}
+
{{ description }}
+{{ /if }} + +{{ if keyEvent }} +{{ event.title }}
+{{ each event.gifImgs gif }} +