Skip to content

Commit 20e903e

Browse files
authored
fix(route/yahoo/utils): fix yahoo header overflow (#20336)
1 parent e03111c commit 20e903e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/routes/yahoo/news/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { load } from 'cheerio';
33
import { parseDate } from '@/utils/parse-date';
44
import path from 'node:path';
55
import { art } from '@/utils/render';
6+
import { config } from '@/config';
67

78
const getArchive = async (region, limit, tag, providerId?) => {
89
const { data: response } = await got(
@@ -79,7 +80,11 @@ const parseList = (region, response) =>
7980

8081
const parseItem = (item, tryGet) =>
8182
tryGet(item.link, async () => {
82-
const { data: response } = await got(item.link);
83+
const { data: response } = await got(item.link, {
84+
headers: {
85+
'User-Agent': config.trueUA,
86+
},
87+
});
8388
const $ = load(response);
8489

8590
const ldJson = JSON.parse(

0 commit comments

Comments
 (0)