Skip to content

Commit 24c5045

Browse files
authored
fix(route/rss): Manually set RSS version when parsing (#16973)
1 parent 8ec9235 commit 24c5045

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/routes/nikkei/cn/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ import got from '@/utils/got';
55
import { load } from 'cheerio';
66
import timezone from '@/utils/timezone';
77
import { parseDate } from '@/utils/parse-date';
8-
import parser from '@/utils/rss-parser';
8+
import { config } from '@/config';
9+
import Parser from 'rss-parser';
10+
11+
const parser = new Parser({
12+
customFields: {
13+
item: ['magnet'],
14+
},
15+
headers: {
16+
'User-Agent': config.ua,
17+
},
18+
defaultRSS: 0.9,
19+
});
920

1021
export const route: Route = {
1122
path: '/cn/*',

0 commit comments

Comments
 (0)