[Instagram] 修复使用path.join导致的URL不正确的BUG

This commit is contained in:
lifegpc
2021-01-11 20:33:33 +08:00
parent 3e93529df1
commit b7b107111c
+3 -3
View File
@@ -55,7 +55,7 @@ module.exports = async (ctx) => {
logo = userInfo.hd_profile_pic_url_info.url;
const fullName = userInfo.full_name;
title = `${fullName} (@${username}) - Instagram`;
link = path.join('https://www.instagram.com', username);
link = `https://www.instagram.com/${username}`;
itemsRaw = await ig.feed.user(id).items();
break;
@@ -64,7 +64,7 @@ module.exports = async (ctx) => {
const tag = nameOrId;
title = `#${tag}) - Instagram`;
link = path.join('https://www.instagram.com', 'explore', 'tags', tag);
link = `https://www.instagram.com/explore/tags/${tag}`;
itemsRaw = await (await ig.feed.tags(tag).items()).slice(1); // the 0 item is undefined for unknown reason
break;
@@ -89,7 +89,7 @@ module.exports = async (ctx) => {
}
// Metadata
const url = path.join('https://www.instagram.com', 'p', item.code);
const url = `https://www.instagram.com/p/${item.code}`;
const pubDate = new Date(item.taken_at * 1000).toUTCString();
const title = summary.split('\n')[0];