diff --git a/docs/new-media.md b/docs/new-media.md index fd811137f..665f1e7b1 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1406,8 +1406,8 @@ column 为 third 时可选的 category: 1. 在[网易号搜索页面](https://dy.163.com/v2/media/tosearch.html) 搜索想要订阅的网易号。 -2. 打开网易号文章页面。 -3. 通过浏览器控制台执行 `$('#contain').dataset.wemediaid`,返回的即为网易号 ID。 +2. 打开网易号的任意文章。 +3. 查看源代码,搜索 `data-wemediaid`,查看紧随其后的引号内的属性值(类似 `W1966190042455428950`)即为网易号 ID。 diff --git a/lib/routes/netease/dy.js b/lib/routes/netease/dy.js index 8443ef73f..51364c675 100644 --- a/lib/routes/netease/dy.js +++ b/lib/routes/netease/dy.js @@ -19,19 +19,19 @@ module.exports = async (ctx) => { author = e.source ? e.source : ''; - const response = await ctx.cache.tryGet( - e.link, - async () => + const html = await ctx.cache.tryGet(e.link, async () => + iconv.decode( ( await got.get(e.link, { responseType: 'buffer', }) - ).data + ).data, + 'gbk' + ) ); - const html = iconv.decode(response, 'gbk'); const $ = cheerio.load(html, { decodeEntities: false }); - const article = $('div.article_box > div.content'); + const article = $('.post_body'); const single = { title: e.title,