mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-21 12:49:53 +08:00
fix(route): /163/dy2/:id pic shows correctly (#14955)
This commit is contained in:
@@ -11,7 +11,7 @@ export const route: Route = {
|
||||
path: '/dy2/:id',
|
||||
categories: ['new-media'],
|
||||
example: '/163/dy2/T1555591616739',
|
||||
parameters: { id: 'id,该网易号主页网址最后一项html的文件名' },
|
||||
parameters: { id: 'id,该网易号主页网址最后一项 html 的文件名' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
@@ -21,7 +21,7 @@ export const route: Route = {
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '网易号(通用)',
|
||||
maintainers: ['mjysci'],
|
||||
maintainers: ['mjysci', 'lyqluis'],
|
||||
handler,
|
||||
description: `优先使用方法一,若是网易号搜索页面搜不到的小众网易号(文章页面不含\`data-wemediaid\`)则可使用此法。
|
||||
触发反爬会只抓取到标题,建议自建。`,
|
||||
@@ -43,11 +43,12 @@ async function handler(ctx) {
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const itemImg = item.find('a.img img');
|
||||
return {
|
||||
title: item.find('h4 a').text(),
|
||||
link: item.find('a').first().attr('href'),
|
||||
pubDate: timezone(parseDate(item.find('.time').text()), 8),
|
||||
imgsrc: item.find('a img').attr('src'),
|
||||
imgsrc: itemImg.attr('src') ?? itemImg.attr('_src'),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ const parseDyArticle = (charset, item, tryGet) =>
|
||||
}
|
||||
});
|
||||
|
||||
const imgUrl = new URL(item.imgsrc);
|
||||
item.description = art(path.join(__dirname, 'templates/dy.art'), {
|
||||
imgsrc: item.imgsrc?.split('?')[0],
|
||||
imgsrc: imgUrl.searchParams.get('url'),
|
||||
postBody: $('.post_body').html(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user