F95Zone Auto Add Notags

Automatically adds your personal blocked tags (notags) into the F95Zone SAM hash URL so you never have to set them manually.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         F95Zone Auto Add Notags
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatically adds your personal blocked tags (notags) into the F95Zone SAM hash URL so you never have to set them manually.
// @author       Nakimor
// @license      MIT
// @match        https://f95zone.to/sam/latest_alpha/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // === CONFIGURATION ===
    // Add here all tag IDs you want to exclude (comma-separated).
    // How to find a tag ID:
    // 1. Go to F95Zone "latest" or "SAM" page.
    // 2. Manually add a tag to the "Excluded tags" filter.
    // 3. Look at the URL — you will see something like: .../notags=522,1707,2265
    // 4. Copy those numbers and paste them here.
    const bannedTags = "522,1707,2265"; // <-- EDIT THIS LINE TO ADD/REMOVE YOUR TAGS

    // Get the current hash (part after "#")
    let hash = window.location.hash;

    // Only modify the URL if it doesn't already contain "notags="
    if (!hash.includes("notags=")) {
        // Split hash into segments (removing the leading "#")
        let segments = hash.slice(1).split("/");
        let newSegments = [];

        // We just rebuild the hash keeping known parts untouched
        segments.forEach(seg => {
            // Pass-through all known segments
            if (
                seg.startsWith("tags=") ||
                seg.startsWith("prefixes=") ||
                seg.startsWith("noprefixes=") ||
                seg.startsWith("cat=") ||
                seg.startsWith("page=") ||
                seg.startsWith("sort=") ||
                seg.startsWith("search=") ||
                seg.startsWith("date=")
            ) {
                newSegments.push(seg);
            } else {
                // Keep any unknown segment as well (safe for future updates)
                newSegments.push(seg);
            }
        });

        // Insert notags after "cat=" or "page=" if found, otherwise just append at the end
        let index = newSegments.findIndex(s => s.startsWith("cat=") || s.startsWith("page="));
        if (index >= 0) index++;
        else index = newSegments.length;

        newSegments.splice(index, 0, "notags=" + bannedTags);

        // Replace the current hash with our new one
        window.location.replace("#/" + newSegments.join("/"));
    }
})();