feat: Rockstar Games Social Club 修改为输出中文结果 (#4431)
This commit is contained in:
parent
a6fee56d88
commit
818f242221
|
|
@ -2,7 +2,7 @@ const gameList = ['GTAV', 'RDR2'];
|
|||
|
||||
module.exports = async (ctx) => {
|
||||
const gameId = gameList.includes(ctx.params.game) ? ctx.params.game : '';
|
||||
const baseUrl = `https://zh.socialclub.rockstargames.com/events/eventlisting?pageId=1&gameId=${gameId}`;
|
||||
const baseUrl = `https://zh-cn.socialclub.rockstargames.com/events/eventlisting?pageId=1&gameId=${gameId}`;
|
||||
// R星的傻逼防爬
|
||||
const browser = await require('@/utils/puppeteer')();
|
||||
const page = await browser.newPage();
|
||||
|
|
@ -14,8 +14,8 @@ module.exports = async (ctx) => {
|
|||
const { events } = JSON.parse(jsonStr);
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'Online Events - Rockstar Games Social Club',
|
||||
link: 'https://zh.socialclub.rockstargames.com/events?gameId=' + gameId,
|
||||
title: '在线活动 - Rockstar Games Social Club',
|
||||
link: 'https://zh-cn.socialclub.rockstargames.com/events?gameId=' + gameId,
|
||||
item:
|
||||
events &&
|
||||
events.map((x) => ({
|
||||
|
|
@ -23,7 +23,7 @@ module.exports = async (ctx) => {
|
|||
category: x.eventType,
|
||||
description: (x.imgUrl ? `<img src="${x.imgUrl}" /><br>` : '') + x.description,
|
||||
pubDate: new Date(x.startDate).getTime() / 1000,
|
||||
link: `https://zh.socialclub.rockstargames.com/events/${x.urlHash}/${x.slug}/1`,
|
||||
link: `https://zh-cn.socialclub.rockstargames.com/events/${x.urlHash}/${x.slug}/1`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue