fix: 解决微博时间线link相同时被处理成同样的微博 (#4152)

This commit is contained in:
zytomorrow 2020-03-03 00:48:34 +08:00 committed by GitHub
parent 1af0642e49
commit 6fe21dbcb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 16 deletions

View File

@ -96,27 +96,12 @@ module.exports = async (ctx) => {
} else {
title = `${item.user.name}--原创微博`;
}
let link = 'https://weibo.com';
try {
await got.get(`http://api.weibo.com/2/statuses/go?access_token=${token}&id=${item.id}&uid=${item.user.id}`, {
hooks: {
beforeRedirect: [
(options) => {
options.followRedirect = false;
link = options.href;
},
],
},
});
} catch (error) {
// nothing
}
return {
title: title,
content: content,
author: item.user.name,
date: item.created_at,
link: link,
link: `https://m.weibo.cn/detail/${item.id}`,
pic_urls: picUrlList,
videoList,
};