From 49207cb1df6dff7b56e70c6c87acabb4c2c92974 Mon Sep 17 00:00:00 2001 From: ToddMoriaty Date: Sat, 17 Apr 2021 21:19:55 +0800 Subject: [PATCH] Update userVideo.js --- lib/routes/ixigua/userVideo.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/routes/ixigua/userVideo.js b/lib/routes/ixigua/userVideo.js index 95390c962068b4..45bada1f6a89b6 100644 --- a/lib/routes/ixigua/userVideo.js +++ b/lib/routes/ixigua/userVideo.js @@ -4,28 +4,28 @@ module.exports = async (ctx) => { const uid = ctx.params.uid; const disableEmbed = ctx.params.disableEmbed; const homeUrl = 'https://www.ixigua.com'; - const videoApiUrl = `${homeUrl}/api/videov2/author/video?&author_id=${uid}&type=video&max_time=0`; + const videoApiUrl = `${homeUrl}/api/videov2/author/new_video_list?&to_user_id=${uid}&offset=0&limit=20&order=new`; const resp = await got(videoApiUrl, { headers: { referer: homeUrl } }); const jsonData = resp.data; if (jsonData.code !== 200) { - throw Error(`xigua video API: code = ${jsonData.code}, message = ${jsonData.data.message}`); + throw Error(`xigua video API: code = ${jsonData.data.code}, message = ${jsonData.data.message}`); } - if (jsonData.data.data.length === 0) { - throw Error('xigua video API: data is empty'); + if (jsonData.data.videoList.length === 0) { + throw Error('xigua video API: videoList is empty'); } - const videoInfos = jsonData.data.data; + const videoInfos = jsonData.data.videoList; const userInfo = videoInfos[0].user_info; ctx.state.data = { title: `${userInfo.name} 的西瓜视频`, link: `${homeUrl}/home/${uid}`, - description: userInfo.author_desc, + description: userInfo.description, item: videoInfos.map((i) => ({ title: i.title, description: - (disableEmbed ? '' : `
`) + + (disableEmbed ? '' : `
`) + `

${i.abstract}

`, link: `${homeUrl}/${i.gid}`, pubDate: i.publish_time * 1000,