Fix replace command for IGTV path (#259)

This commit is contained in:
Ahmet Arda Kavakcı 2022-05-13 17:36:11 +00:00 committed by GitHub
parent e2ec5d14e6
commit f73e204bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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/...'
} }