Soulgen AI Blur Remover

Remove blur paywall for images in Soulgen AI

  1. // ==UserScript==
  2. // @name Soulgen AI Blur Remover
  3. // @namespace soulgen-ai-blur-remover
  4. // @version 1.3
  5. // @description Remove blur paywall for images in Soulgen AI
  6. // @match https://www.soulgen.ai/*
  7. // @match https://www.soulgen.net/*
  8. // @grant none
  9. // @license GPL-2.0-only
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Create a floating button to trigger the delete code
  16. var button = document.createElement('button');
  17. button.innerText = 'Remove Blur';
  18. 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";
  19. button.style.position = 'fixed';
  20. button.style.right = '20px';
  21. button.style.bottom = '20px';
  22. button.style.zIndex = '9999';
  23. document.body.appendChild(button);
  24.  
  25. // Create a floating button to trigger the delete code
  26. var button2 = document.createElement('button');
  27. button2.innerText = 'Download';
  28. 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";
  29. button2.style.position = 'fixed';
  30. button2.style.right = '20px';
  31. button2.style.bottom = '70px';
  32. button2.style.zIndex = '9999';
  33. document.body.appendChild(button2);
  34.  
  35. // Add a click event listener to the button
  36. button.addEventListener('click', function() {
  37. deleteElements();
  38. });
  39.  
  40. // Add a click event listener to the button
  41. button2.addEventListener('click', function() {
  42. download();
  43. });
  44.  
  45. // Function to delete elements with classes that end with "backdrop-filter" or "abs-center"
  46. function deleteElements() {
  47. document.querySelectorAll('[class$="backdrop-filter"]').forEach(function(element) {
  48. element.remove();
  49. });
  50.  
  51. document.querySelectorAll('[class$="modal-close"]').forEach(function(element) {
  52. element.remove();
  53. });
  54.  
  55. document.querySelectorAll('.abs-center').forEach(function(element) {
  56. element.remove();
  57. });
  58. }
  59.  
  60. function download() {
  61. const images = document.querySelectorAll('img[alt="soulgen ai"]');
  62. for (let i = 0; i < images.length; i++) {
  63. const img = images[i];
  64. const link = document.createElement('a');
  65. link.href = img.src;
  66. link.download = 'soulgen-ai-image-' + i + '.' + img.src.split('.').pop();
  67. link.click();
  68. }
  69. }
  70. })();