fix(route): beijing/kw handling external links (#9123)

This commit is contained in:
Fatpandac 2022-02-17 00:30:39 +08:00 committed by GitHub
parent dae6cb757f
commit 0b832b38d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ module.exports = async (ctx) => {
const result = item.match(/urls\[i]='(.*?)';headers\[i]="(.*?)";year\[i]='(\d+)';month\[i]='(\d+)';day\[i]='(\d+)';/);
return {
title: cheerio.load(result[2])('a').attr('title') || result[2],
link: `${rootUrl}${result[1]}`,
link: new URL(result[1], rootUrl).href,
pubDate: parseDate(`${result[3]}-${result[4]}-${result[5]}`, 'YYYY-MM-DD'),
};
});