about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAhmet Arda Kavakcı <42360077+dybdeskarphet@users.noreply.github.com>2022-05-13 17:36:11 +0000
committerGitHub <noreply@github.com>2022-05-13 20:36:11 +0300
commitf73e204bd29c98e7603244da216c60be00372bbd (patch)
tree8c4b71a860e28511eba6c705bbadf270b8745a94
parentAdded Piped Instance (#258) (diff)
downloadlibredirect-f73e204bd29c98e7603244da216c60be00372bbd.zip
Fix replace command for IGTV path (#259)
-rw-r--r--src/assets/javascripts/helpers/instagram.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/assets/javascripts/helpers/instagram.js b/src/assets/javascripts/helpers/instagram.js
index 13c4d3d7..ca6097dd 100644
--- a/src/assets/javascripts/helpers/instagram.js
+++ b/src/assets/javascripts/helpers/instagram.js
@@ -79,7 +79,7 @@ function redirect(url, type, initiator) {
   if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1]))
     return `${randomInstance}${url.pathname}${url.search}`;
   if (url.pathname.startsWith("/reel") || url.pathname.startsWith("/tv"))
-    return `${randomInstance}/p${url.pathname.replace('/reel', '')}${url.search}`;
+    return `${randomInstance}/p${url.pathname.replace(/\/reel|\/tv/i, '')}${url.search}`;
   else
     return `${randomInstance}/u${url.pathname}${url.search}`; // Likely a user profile, redirect to '/u/...'
 }