From ae200a567dbff81a62fcd6480a298c599b384dc0 Mon Sep 17 00:00:00 2001 From: Trojan Yao Date: Thu, 2 Apr 2020 20:54:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=B1=86=E7=93=A3?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=92=8C=E5=8F=82=E6=95=B0=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=20(#4315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/social-media.md | 2 +- lib/routes/douban/celebrity.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/social-media.md b/docs/social-media.md index bd2fc3344..64961adbd 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -522,7 +522,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 ### 豆瓣电影人 - + ### 豆瓣小组 diff --git a/lib/routes/douban/celebrity.js b/lib/routes/douban/celebrity.js index c533fab4f..207a0c5ca 100644 --- a/lib/routes/douban/celebrity.js +++ b/lib/routes/douban/celebrity.js @@ -15,10 +15,14 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML const list = $('div.grid_view > ul li'); // 使用 cheerio 选择器 + + const person = $('#content > h1') + .text() + .replace(/的全部作品(\d{1,})/, ''); let itemPicUrl; ctx.state.data = { - title: '豆瓣电影-电影人作品', + title: `豆瓣电影人 - ${person}`, link: `https://movie.douban.com/celebrity/${id}/movies?sortby=${sort}`, item: list &&