feat: add pinterest support

This commit is contained in:
Snazzah
2023-05-24 12:32:41 -05:00
parent fa4e418e36
commit 40291c4d24
7 changed files with 85 additions and 1 deletions

View File

@@ -72,6 +72,9 @@ export function cleanURL(url, host) {
break;
case "tiktok":
url = url.replace(/@([a-zA-Z]+(\.[a-zA-Z]+)+)/, "@a")
case "pinterest":
// Redirect all TLDs back to .com
url = url.replace(/:\/\/(?:www.)pinterest(?:\.[a-z.]+)/, "://pinterest.com")
default:
url = url.split('?')[0];
if (url.substring(url.length - 1) === "/") url = url.substring(0, url.length - 1);