Soulgen AI Blur Remover

Remove blur paywall for images in Soulgen AI

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo 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         Soulgen AI Blur Remover
// @namespace    soulgen-ai-blur-remover
// @version      1.3
// @description  Remove blur paywall for images in Soulgen AI
// @match        https://www.soulgen.ai/*
// @match        https://www.soulgen.net/*
// @grant        none
// @license      GPL-2.0-only
// ==/UserScript==

(function() {
  'use strict';

  // Create a floating button to trigger the delete code
  var button = document.createElement('button');
  button.innerText = 'Remove Blur';
  button.className = "flex-1 xl:min-w-[128px] relative ml-2 xl:ml-4 btn h-10 min-h-[40px] bg-colorful rounded-full px-4 tracking-[0.4px] whitespace-nowrap";
  button.style.position = 'fixed';
  button.style.right = '20px';
  button.style.bottom = '20px';
  button.style.zIndex = '9999';
  document.body.appendChild(button);

  // Create a floating button to trigger the delete code
  var button2 = document.createElement('button');
  button2.innerText = 'Download';
  button2.className = "flex-1 xl:min-w-[128px] relative ml-2 xl:ml-4 btn h-10 min-h-[40px] bg-colorful rounded-full px-4 tracking-[0.4px] whitespace-nowrap";
  button2.style.position = 'fixed';
  button2.style.right = '20px';
  button2.style.bottom = '70px';
  button2.style.zIndex = '9999';
  document.body.appendChild(button2);

  // Add a click event listener to the button
  button.addEventListener('click', function() {
    deleteElements();
  });

  // Add a click event listener to the button
  button2.addEventListener('click', function() {
    download();
  });

  // Function to delete elements with classes that end with "backdrop-filter" or "abs-center"
  function deleteElements() {
    document.querySelectorAll('[class$="backdrop-filter"]').forEach(function(element) {
      element.remove();
    });

    document.querySelectorAll('[class$="modal-close"]').forEach(function(element) {
      element.remove();
    });

    document.querySelectorAll('.abs-center').forEach(function(element) {
      element.remove();
    });
  }

  function download() {
        const images = document.querySelectorAll('img[alt="soulgen ai"]');
        for (let i = 0; i < images.length; i++) {
            const img = images[i];
            const link = document.createElement('a');
            link.href = img.src;
            link.download = 'soulgen-ai-image-' + i + '.' + img.src.split('.').pop();
            link.click();
        }
  }
})();