From 45b8a8571b003a9945de284747e4ff6e5cadae06 Mon Sep 17 00:00:00 2001 From: dzx-dzx Date: Sat, 23 May 2026 21:49:22 +0800 Subject: [PATCH 1/6] fix(route/reuters): Adjust header --- lib/routes/reuters/common.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index f440cf2a011c..78734d1e4279 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -8,6 +8,7 @@ import { ViewType } from '@/types'; import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; +import { PRESETS } from '@/utils/header-generator'; type ReutersContent = { result: { @@ -198,6 +199,7 @@ async function handler(ctx) { Accept: 'application/json, text/plain, */*', 'Accept-Language': 'en-US,en;q=0.9', Referer: 'https://www.reuters.com/', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0', }; try { @@ -213,7 +215,7 @@ async function handler(ctx) { website: 'reuters', }), }, - headers: browserHeaders, + headerGeneratorOptions: PRESETS.MODERN_WINDOWS, }); return { @@ -240,7 +242,7 @@ async function handler(ctx) { : {}), }), }, - headers: browserHeaders, + headerGeneratorOptions: PRESETS.MODERN_WINDOWS, }); return { title: response.result.section.title, From 272d0070183201947e7c02bdeafeb64801302215 Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Mon, 25 May 2026 02:04:31 +0800 Subject: [PATCH 2/6] Update common.tsx --- lib/routes/reuters/common.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index 78734d1e4279..696c4f8e241a 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -195,13 +195,6 @@ async function handler(ctx) { const section_id = `/${category}/${topic ? `${topic}/` : ''}`; - const browserHeaders = { - Accept: 'application/json, text/plain, */*', - 'Accept-Language': 'en-US,en;q=0.9', - Referer: 'https://www.reuters.com/', - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0', - }; - try { const { title, description, rootUrl, response } = await (async () => { if (MUST_FETCH_BY_TOPICS.has(category)) { @@ -270,8 +263,8 @@ async function handler(ctx) { items.map((item) => ctx.req.query('fulltext') === 'true' ? cache.tryGet(item.link, async () => { - const detailResponse = await ofetch(item.link, { - headers: browserHeaders, + const detailResponse = await ofetch(item.link,{ + headerGeneratorOptions: PRESETS.MODERN_WINDOWS, }); const content = load(detailResponse.data); @@ -339,7 +332,7 @@ async function handler(ctx) { const arcUrl = topic ? `https://www.reuters.com/arc/outboundfeeds/v4/mobile/section${section_id}?outputType=json` : `https://www.reuters.com/arc/outboundfeeds/v4/mobile/section/${category}/?outputType=json`; const arcResponse = await ofetch(arcUrl, { - headers: browserHeaders, + headerGeneratorOptions: PRESETS.MODERN_WINDOWS, }); if (arcResponse.wireitems?.length) { const items = arcResponse.wireitems From 7ca99282d42744ff6a009ec295ccb6f1443d8af4 Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Mon, 25 May 2026 02:07:09 +0800 Subject: [PATCH 3/6] Update common.tsx --- lib/routes/reuters/common.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index 696c4f8e241a..7569f87a186c 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -263,7 +263,7 @@ async function handler(ctx) { items.map((item) => ctx.req.query('fulltext') === 'true' ? cache.tryGet(item.link, async () => { - const detailResponse = await ofetch(item.link,{ + const detailResponse = await ofetch(item.link, { headerGeneratorOptions: PRESETS.MODERN_WINDOWS, }); const content = load(detailResponse.data); From 5915aab9b9337fe46ace43e87100f734be11708a Mon Sep 17 00:00:00 2001 From: dzx-dzx Date: Sun, 7 Jun 2026 05:47:37 +0800 Subject: [PATCH 4/6] . --- lib/routes/reuters/common.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index 7569f87a186c..b230a851381f 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -235,7 +235,7 @@ async function handler(ctx) { : {}), }), }, - headerGeneratorOptions: PRESETS.MODERN_WINDOWS, + headerGeneratorOptions: PRESETS.MODERN_WINDOWS_FIREFOX, }); return { title: response.result.section.title, From 40142f73b8483be8853e10af78cbe011fe8a2d81 Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:04:02 +0800 Subject: [PATCH 5/6] Update common.tsx --- lib/routes/reuters/common.tsx | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index a07a7051a0c4..f4f8380d2459 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -244,31 +244,6 @@ async function handler(ctx) { response, }; } - const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-section-alias-or-id-v1'; - const response = await ofetch(rootUrl, { - query: { - query: JSON.stringify({ - offset: 0, - size: limit, - section_id, - website: 'reuters', - ...(useSophi - ? { - fetch_type: 'sophi', - sophi_page: '*', - sophi_widget: 'topic', - } - : {}), - }), - }, - headers: browserHeaders, - }); - return { - title: response.result.section.title, - description: response.result.section.section_about, - rootUrl, - response, - }; })(); let items = response.result.articles.map((e) => ({ From 7dfbc7171a51b6991141762e1073b098178bff9e Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:30:10 +0800 Subject: [PATCH 6/6] Update common.tsx --- lib/routes/reuters/common.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/reuters/common.tsx b/lib/routes/reuters/common.tsx index f4f8380d2459..b1fb256929e3 100644 --- a/lib/routes/reuters/common.tsx +++ b/lib/routes/reuters/common.tsx @@ -6,9 +6,9 @@ import type { JSX } from 'hono/jsx/jsx-runtime'; import type { Route } from '@/types'; import { ViewType } from '@/types'; import cache from '@/utils/cache'; +import { PRESETS } from '@/utils/header-generator'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { PRESETS } from '@/utils/header-generator'; type ReutersContent = { result: {