SauceNao DirectLinks

2/1/2026, 9:08:47 PM

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        SauceNao DirectLinks
// @namespace   Violentmonkey Scripts
// @match       https://saucenao.com/search.php*
// @grant       none
// @version     1.0
// @author      me :3
// @license MIT
// @description 2/1/2026, 9:08:47 PM
// ==/UserScript==
const sitePatterns = [
{
    name: 'nhentai',
    regex: /(?<=nhentai\/)\d+/
},
{
    name:'ehentai',
    regex:/ehentai\/.*?([a-f0-9]{40})/
},
{
    name:'kemono',
    regex:/\/kp\/.*?([a-f0-9]{64})/
}]
const SiteLinks = {kemono:"https://kemono.cr/search_hash?hash=",ehentai:"https://exhentai.org/?f_shash=",nhentai:"https://nhentai.net/g/"}
const ResultNum = document.getElementsByClassName("resultimage");
function AddIcon(Data,targdiv){


  const a = document.createElement("a");
  const img = document.createElement("img");
  img.width = 16;
  img.height = 16;
  img.border = 0;
  img.alt = "";
  const br = document.createElement("br");
  br.style.lineHeight = "2px";

    if(Data.name === "nhentai"){
    img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADc0lEQVRYR+1WWUhUYRT+7iz3zoyCpG22IIk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IyB/4MBw5BRclLHp05h7Y69vD9lx46LYR7cuMSK523t74XsPQf85gbrDlpdxh8egOgJOdosqgAAAABJRU5ErkJggg==" ;
    a.href = Data.link;
    a.appendChild(img);
    targdiv.appendChild(a);
    targdiv.appendChild(br);
    }
    if(Data.name === "ehentai"){
    img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAVElEQVQ4T2NkoBAwUqifAWxAGpvgf3SDZv16DzccJg8TQ+ZT1wBkW5FdRLQLBt4AmLNBLkF2NrZABqkFqcMaiGQbMPBhQLELkOOevimRkgxFcW4EAHGHkBEVa0F8AAAAAElFTkSuQmCC";
    a.href = Data.link;
    a.appendChild(img);
    targdiv.appendChild(a);
    targdiv.appendChild(br);
    }
    if(Data.name === "kemono"){
    const targetLink = targdiv.querySelector('a[href*="kemono.party"]');
    targetLink.href = Data.link;
    }


}
function ProcessLinks(link,ParentDiv)
{
  for (const rule of sitePatterns) {
   const found = link.match(rule.regex);
   const IconDiv = ParentDiv.querySelector(".resultmiscinfo");
   if(found && rule.name === "nhentai"){let Data = {name:rule.name,link:SiteLinks.nhentai+found[0]};
    AddIcon(Data,IconDiv);break;}
   if(found && rule.name === "ehentai"){let Data = {name:rule.name,link:SiteLinks.ehentai+found[1]};
    AddIcon(Data,IconDiv); break;}
   if(found && rule.name === "kemono"){let  Data =  {name:rule.name,link:SiteLinks.kemono+found[1]};
    AddIcon(Data,IconDiv); break;}
    }
}

for (let i = 0; i < ResultNum.length; i++) {
    const imgDiv = document.getElementById("resImage" + i);
    if (!imgDiv) continue;
    const link = imgDiv.getAttribute('data-src') || imgDiv.getAttribute('src');
    if (!link) continue;
    const tr = imgDiv.closest("tr");


    ProcessLinks(link,tr);



}