From 222322befc12f233d74a08e2baa1803a45f21c33 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 31 Mar 2026 22:44:27 +0800 Subject: [PATCH] fix(routes): fix feed images (#21573) --- lib/routes/jiemian/common.tsx | 7 +++---- lib/routes/kyodonews/index.tsx | 14 ++++++++++++-- lib/routes/sohu/mp.tsx | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/routes/jiemian/common.tsx b/lib/routes/jiemian/common.tsx index 586760366..c81333161 100644 --- a/lib/routes/jiemian/common.tsx +++ b/lib/routes/jiemian/common.tsx @@ -92,8 +92,7 @@ export const handler = async (ctx): Promise => { const title = $('title').text(); const titleSplits = title.split(/_/); - const image = $('div.logo img').prop('src'); - const icon = new URL($('link[rel="icon"]').prop('href'), rootUrl).href; + const image = new URL($('link[rel="icon"]').prop('href'), rootUrl).href; return { item: items, @@ -102,8 +101,8 @@ export const handler = async (ctx): Promise => { description: $('meta[name="description"]').prop('content'), language: $('html').prop('lang'), image, - icon, - logo: icon, + icon: image, + logo: image, subtitle: titleSplits[0], author: titleSplits.pop(), }; diff --git a/lib/routes/kyodonews/index.tsx b/lib/routes/kyodonews/index.tsx index 71ca66a88..1918bfc68 100644 --- a/lib/routes/kyodonews/index.tsx +++ b/lib/routes/kyodonews/index.tsx @@ -24,6 +24,16 @@ export const route: Route = { supportPodcast: false, supportScihub: false, }, + radar: [ + { + source: ['china.kyodonews.net/news/:keyword', 'china.kyodonews.net/'], + target: '/china/:keyword?', + }, + { + source: ['tchina.kyodonews.net/news/:keyword', 'tchina.kyodonews.net/'], + target: '/tchina/:keyword?', + }, + ], name: '最新报道', maintainers: ['Rongronggg9'], handler, @@ -40,7 +50,7 @@ async function handler(ctx) { } const rootUrl = `https://${language}.kyodonews.net`; - const currentUrl = `${rootUrl}/${keyword ? (keyword === 'rss' ? 'rss/news.xml' : `news/${keyword}`) : ''}`; + const currentUrl = `${rootUrl}/${keyword ? (keyword === 'rss' ? 'list/feed/rss4news' : `news/${keyword}`) : ''}`; let response; try { @@ -52,7 +62,7 @@ async function handler(ctx) { const $ = load(response.data, { xmlMode: keyword === 'rss' }); let title, description, image, items; - image = `${rootUrl}/apple-touch-icon-180x180.png`; + image = `https://${language}-kyodo.ismcdn.jp/common/images/apple-touch-icon-180x180.png`; if (keyword === 'rss') { title = $('channel > title').text(); diff --git a/lib/routes/sohu/mp.tsx b/lib/routes/sohu/mp.tsx index a99761c50..45a4ae41e 100644 --- a/lib/routes/sohu/mp.tsx +++ b/lib/routes/sohu/mp.tsx @@ -218,7 +218,7 @@ async function handler(ctx) { title: `搜狐号 - ${globalConst.title}`, description: briefIntroductionCard.column_9_text, link: originalRequest.url, - image: `https:${briefIntroductionCard.column_2_image}`, + image: briefIntroductionCard.column_2_image.startsWith('http') ? briefIntroductionCard.column_2_image.replace('http:', 'https:') : `https:${briefIntroductionCard.column_2_image}`, item: items, }; }