Soulgen AI Blur Remover

Remove blur paywall for images in Soulgen AI

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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();
        }
  }
})();