diff --git a/lib/v2/douban/maintainer.js b/lib/v2/douban/maintainer.js index 2ada88758..9d992aacd 100644 --- a/lib/v2/douban/maintainer.js +++ b/lib/v2/douban/maintainer.js @@ -6,7 +6,7 @@ module.exports = { '/channel/:id/:nav?': ['umm233'], '/channel/:id/subject/:nav': ['umm233'], '/commercialpress/latest': ['xyqfer'], - '/doulist/:id': ['LogicJake'], + '/doulist/:id': ['LogicJake', 'honue'], '/event/hot/:locationId': ['xyqfer'], '/explore': ['clarkzsd'], '/explore_column/:id': ['LogicJake'], diff --git a/lib/v2/douban/other/doulist.js b/lib/v2/douban/other/doulist.js index bedfd0d2b..c2c6d59d0 100644 --- a/lib/v2/douban/other/doulist.js +++ b/lib/v2/douban/other/doulist.js @@ -1,20 +1,22 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const url = require('url'); - -const host = 'https://www.douban.com/doulist/'; module.exports = async (ctx) => { const id = ctx.params.id; - const link = url.resolve(host, id); - const response = await got.get(link); + const url = `https://www.douban.com/doulist/${id}`; + const response = await got({ + method: 'get', + url, + headers: { + Referer: `https://www.douban.com/doulist/${id}`, + }, + }); const $ = cheerio.load(response.data); const title = $('#content h1').text().trim(); const description = $('div.doulist-about').text().trim(); const out = $('div.doulist-item') - .slice(0, 10) .map(function () { const type = $(this).find('div.source').text().trim(); @@ -56,7 +58,7 @@ module.exports = async (ctx) => { ctx.state.data = { title, - link, + link: url, description, item: out, }; diff --git a/website/docs/routes/social-media.md b/website/docs/routes/social-media.md index 2f4d63a2b..cd4440622 100644 --- a/website/docs/routes/social-media.md +++ b/website/docs/routes/social-media.md @@ -1299,7 +1299,7 @@ Country Code -### 豆列 {#dou-ban-dou-lie} +### 豆瓣豆列 {#dou-ban-dou-ban-dou-lie}