// ==UserScript== // @name XSNVShen Image URL Collector // @namespace…
- User
// ==UserScript== // @name XSNVShen Image URL Collector // @namespace http://tampermonkey.net/ // @version 1.4 // @description Collects image URLs and saves them into a text file from XSNVShen // @author Your Name // @match https://www.xsnvshen.com/* // @grant GM_notification // @require https://cdn.jsdelivr.net/npm/file-saver@2.0.5/dist/FileSaver.min.js // ==/UserScript==
(function() { 'use strict';
codedocument.querySelectorAll('li.min-h-imgall').forEach(function(item) { let downloadButton = document.createElement('button'); downloadButton.innerText = 'Save URLs'; downloadButton.style.cssText = ` font-size: 8px; position: absolute; background-color: #336699; border: 1px solid #f92672; border-radius: 3px; padding: 2px; color: white; z-index: 10; cursor: pointer; opacity: 0.9; `; downloadButton.onclick = function() { saveImageUrls(item); }; item.querySelector('div.camLiDes').appendChild(downloadButton); }); function saveImageUrls(item) { let aItemImg = item.querySelector('a.itemimg'); let imgSrc = aItemImg.querySelector('img').getAttribute('data-original'); let baseUrl = "https:" + imgSrc.replace("thumb_205x308/", "").replace("cover.jpg", ""); let title = aItemImg.getAttribute('title').trim(); let totalImg = parseInt(item.querySelector('div.itemset-num .num').innerText, 10); let imageUrls = []; for (let count = 0; count < totalImg; count++) { let formattedCount = count.toString().padStart(3, '0'); imageUrls.push(`${baseUrl}${formattedCount}.jpg`); } createTextFileWithUrls(imageUrls, title); } function createTextFileWithUrls(urls, title) { let blob = new Blob([urls.join('\n')], { type: 'text/plain' }); saveAs(blob, `${title}.txt`); GM_notification(`Image URLs saved successfully as ${title}.txt`, 'Save Complete'); } - Assistant
- User
can you make it to work with img.lazy as well?
- Assistant
- User
I can no longer see the button.
- Assistant
- User
how can I move the button higher?
- Assistant
- User
how do I change the background-color opacity without affecting the font color opacity?
- Assistant