Fix replace command for IGTV path (#259)
This commit is contained in:
parent
e2ec5d14e6
commit
f73e204bd2
|
@ -79,7 +79,7 @@ function redirect(url, type, initiator) {
|
||||||
if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1]))
|
if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1]))
|
||||||
return `${randomInstance}${url.pathname}${url.search}`;
|
return `${randomInstance}${url.pathname}${url.search}`;
|
||||||
if (url.pathname.startsWith("/reel") || url.pathname.startsWith("/tv"))
|
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
|
else
|
||||||
return `${randomInstance}/u${url.pathname}${url.search}`; // Likely a user profile, redirect to '/u/...'
|
return `${randomInstance}/u${url.pathname}${url.search}`; // Likely a user profile, redirect to '/u/...'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue