ATKingdom Images

Access to full size content and download buttons

  1. // ==UserScript==
  2. // @name ATKingdom Images
  3. // @namespace https://greasyfork.org/en/users/1384264-atman
  4. // @version 2024-11-24
  5. // @description Access to full size content and download buttons
  6. // @author atman
  7. // @match https://*.amkingdom.com/tour/photo/*
  8. // @match https://*.atkpetites.com/tour/photo/*
  9. // @match https://*.atkpremium.com/tour/photo/*
  10. // @match https://*.atkexotics.com/tour/photo/*
  11. // @match https://*.atkhairy.com/tour/photo/*
  12. // @match https://*.atkarchives.com/tour/photo/*
  13. // @grant none
  14. // @license GPL-3.0
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19.  
  20. const galleryBlock = document.querySelector('.content-header');
  21. const photoHolders = document.querySelectorAll('.photo_holder img');
  22.  
  23. if (photoHolders) {
  24. photoHolders.forEach(img => {
  25. let originalSrc = img.src;
  26. let modifiedSrc = originalSrc.replace(/cdn\d{2}/, 'content').replace('thumbs', '3000');
  27.  
  28. // Set the link
  29. let joinLink = img.closest('.photo_holder').parentElement;
  30. joinLink.href = modifiedSrc;
  31. joinLink.target = '_blank';
  32. });
  33.  
  34. const srcUrl = photoHolders[1].src.split('.jpg')[0].slice(0, -3) + "_3000_all.zip";
  35. const downloadUrl = srcUrl.replace(/cdn\d{2}/, 'content').replace('thumbs', '3000');
  36.  
  37. // Create a single download button
  38. if (downloadUrl) {
  39. const joinNow = document.querySelector('.left .member');
  40. const downloadButton = document.createElement('a');
  41. downloadButton.href = downloadUrl;
  42. downloadButton.textContent = 'Download ZIP';
  43. downloadButton.style.cssText = `
  44. display: block;
  45. margin-bottom: 10px;
  46. padding: 5px 10px;
  47. background: linear-gradient(90deg, #00d478, #297d58);
  48. color: #FFFFFF;
  49. text-decoration: none;
  50. border-radius: 5px;
  51. text-align: center;
  52. transition: background 0.5s linear;
  53. `;
  54.  
  55. if (joinNow) {
  56. let joinNow = document.querySelector('.left .member');
  57. joinNow.innerText = '';
  58. joinNow.appendChild(downloadButton);
  59. document.querySelector('.login_section').remove();
  60. document.querySelector('.join_bottom').remove();
  61. }
  62. else {
  63. galleryBlock.insertBefore(downloadButton, galleryBlock.firstChild);
  64. document.querySelector('.pull-left').remove();
  65. document.querySelector('.pull-right').remove();
  66. }
  67. }
  68. }
  69. })();