NSFW-Profile Auto Redirector

Redirects OnlyFans and Fansly to Coomer search pages, Patreon and Boosty to Kemono search pages, using the username from the URL.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name         NSFW-Profile Auto Redirector
// @name:en      NSFW-Profile Auto Redirector
// @namespace    https://greasyfork.org/en/users/1373266-godinraider
// @version      1.1
// @description  Redirects OnlyFans and Fansly to Coomer search pages, Patreon and Boosty to Kemono search pages, using the username from the URL.
// @description:en Redirects OnlyFans and Fansly to Coomer search pages, Patreon and Boosty to Kemono search pages, using the username from the URL.
// @author       Inspired by GodinRaider
// @match        *://*.onlyfans.com/*
// @match        *://*.patreon.com/*
// @match        *://*.fansly.com/*
// @match        *://*.boosty.to/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // Function to extract username from URL
    function getUsername() {
        const path = window.location.pathname.replace(/^\/+|\/+$/g, ''); // Remove leading/trailing slashes
        return path.split('/')[0]; // Get the first part of the path (username)
    }

    // Function to perform the redirect
    function redirectToSearchOrProfile() {
        const username = getUsername();

        // If no username is found, do nothing
        if (!username) return;

        // Determine the current site and redirect accordingly
        const isPatreon = window.location.hostname.includes('patreon.com');
        const isBoosty = window.location.hostname.includes('boosty.to');
        const isFansly = window.location.hostname.includes('fansly.com');
        const isOnlyFans = window.location.hostname.includes('onlyfans.com');

        let redirectUrl = '';

        if (isPatreon) {
            redirectUrl = `https://kemono.cr/artists?q=${username}&service=patreon&sort_by=favorited&order=desc`;
        } else if (isBoosty) {
            redirectUrl = `https://kemono.cr/artists?q=${username}&service=boosty&sort_by=favorited&order=desc`;
        } else if (isFansly) {
            redirectUrl = `https://coomer.st/artists?q=${username}&service=fansly&sort_by=favorited&order=desc`;
        } else if (isOnlyFans) {
            redirectUrl = `https://coomer.st/artists?q=${username}&service=onlyfans&sort_by=favorited&order=desc`;
        }

        // Perform the redirect if a URL is set
        if (redirectUrl) {
            window.location.href = redirectUrl;
        }
    }

    // Execute the redirect
    redirectToSearchOrProfile();
})();