fix: 解决微博时间线link相同时被处理成同样的微博 (#4152)
This commit is contained in:
parent
1af0642e49
commit
6fe21dbcb7
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue