From 6ad33ad7447bcb7ac0c4f45803fbb9d028ea4cc6 Mon Sep 17 00:00:00 2001 From: QieSen <44719497+vlcheng@users.noreply.github.com> Date: Wed, 2 Feb 2022 22:19:51 +0800 Subject: [PATCH] fix(route): leiphone bugs (#8939) --- docs/new-media.md | 2 +- lib/v2/leiphone/index.js | 2 +- lib/v2/leiphone/newsflash.js | 2 +- lib/v2/leiphone/radar.js | 2 +- lib/v2/leiphone/router.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/new-media.md b/docs/new-media.md index aa9188b5b..133d77a32 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -2107,7 +2107,7 @@ column 为 third 时可选的 category: ### 栏目 - + - 主栏目 diff --git a/lib/v2/leiphone/index.js b/lib/v2/leiphone/index.js index bc9bd20c1..627c37b0b 100644 --- a/lib/v2/leiphone/index.js +++ b/lib/v2/leiphone/index.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const todo = ctx.params.do ?? ''; const keyword = ctx.params.keyword ?? ''; const rootUrl = 'https://www.leiphone.com'; - const url = `${rootUrl}${todo}${keyword}`; + const url = `${rootUrl}/${todo}/${keyword}`; const res = await got.get(url); const $ = cheerio.load(res.data); diff --git a/lib/v2/leiphone/newsflash.js b/lib/v2/leiphone/newsflash.js index 340b2df97..e7c9baa24 100644 --- a/lib/v2/leiphone/newsflash.js +++ b/lib/v2/leiphone/newsflash.js @@ -7,7 +7,7 @@ module.exports = async (ctx) => { const res = await got.get(url); const article = (res.data || {}).article || []; - const list = article.map((item) => item.url); + const list = article.map((item) => (item.url)); const items = await utils.ProcessFeed(list, ctx.cache); ctx.state.data = { diff --git a/lib/v2/leiphone/radar.js b/lib/v2/leiphone/radar.js index b6a64c80f..7e2b02157 100644 --- a/lib/v2/leiphone/radar.js +++ b/lib/v2/leiphone/radar.js @@ -11,7 +11,7 @@ module.exports = { { title: '栏目', docs: 'https://docs.rsshub.app/new-media.html#lei-feng-wang-lan-mu', - source: ['/:catename'], + source: ['/category/:catename'], target: '/leiphone/category/:catname', }, { diff --git a/lib/v2/leiphone/router.js b/lib/v2/leiphone/router.js index e28c14fcf..8cf29384e 100644 --- a/lib/v2/leiphone/router.js +++ b/lib/v2/leiphone/router.js @@ -1,4 +1,4 @@ module.exports = function (router) { - router.get('/:do?/:keyword?', require('./index')); router.get('/newsflash', require('./newsflash')); + router.get('/:do?/:keyword?', require('./index')); };