Skip to content

Commit

Permalink
[Instagram] 修复使用path.join导致的URL不正确的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Jan 11, 2021
1 parent 3e93529 commit b7b1071
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/routes/instagram/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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];

Expand Down

0 comments on commit b7b1071

Please sign in to comment.