diff --git a/lib/routes/tencent/factcheck/index.js b/lib/routes/tencent/factcheck/index.js index bd05b00cba890e..8f3a4903b3724e 100644 --- a/lib/routes/tencent/factcheck/index.js +++ b/lib/routes/tencent/factcheck/index.js @@ -1,10 +1,19 @@ const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); const cheerio = require('cheerio'); +const CryptoJS = require('crypto-js'); + +const getRequestToken = () => { + const t = 'jzhotdata', + e = 'sgn51n6r6q97o6g3', + n = CryptoJS.DES.encrypt(Date.now().toString() + '-' + e, t).toString(); + return encodeURIComponent(n); +}; module.exports = async (ctx) => { const response = await got({ method: 'get', - url: 'https://vp.fact.qq.com/loadmore?artnum=0&page=0', + url: `https://vp.fact.qq.com/loadmore?artnum=0&page=0&token=${getRequestToken()}`, headers: { Referer: 'https://vp.fact.qq.com/home', }, @@ -18,8 +27,8 @@ module.exports = async (ctx) => { const simple = { title: `【${item.explain}】${item.title}`, description: `${item.abstract}`, - pubDate: new Date(item.date).toUTCString(), - author: `${item.author}${item.author !== item.authordesc ? '-' + item.authordesc : ''}`, + pubDate: parseDate(item.date, 'YYYY-MM-DD'), + author: item.author, link: link, };