Upload 206 files
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +6 -0
- ImageNinja HD/_metadata/generated_indexed_rulesets/_ruleset1 +0 -0
- ImageNinja HD/assets/icons/icon.svg +6 -0
- ImageNinja HD/baa2d01c-243a-46ba-8e3e-26825045023b.txt +3 -0
- ImageNinja HD/manifest.json +37 -0
- ImageNinja HD/rules.json +36 -0
- ImageNinja HD/src/background/background.js +178 -0
- ImageNinja HD/src/popup/modules/downloader.js +110 -0
- ImageNinja HD/src/popup/modules/filters.js +82 -0
- ImageNinja HD/src/popup/modules/scrapers.js +881 -0
- ImageNinja HD/src/popup/modules/settings.js +55 -0
- ImageNinja HD/src/popup/modules/state.js +51 -0
- ImageNinja HD/src/popup/popup.css +634 -0
- ImageNinja HD/src/popup/popup.html +197 -0
- ImageNinja HD/src/popup/popup.js +813 -0
- buscador hls/manifest.json +23 -0
- buscador hls/popup.css +643 -0
- buscador hls/popup.html +184 -0
- buscador hls/popup.js +709 -0
- detector de enlaces - copia/background.js +351 -0
- detector de enlaces - copia/host/__pycache__/kemono_host.cpython-311.pyc +0 -0
- detector de enlaces - copia/host/com.linkdetector.kemono.json +9 -0
- detector de enlaces - copia/host/kemono_host.bat +6 -0
- detector de enlaces - copia/host/kemono_host.py +285 -0
- detector de enlaces - copia/inject.py +135 -0
- detector de enlaces - copia/instalar_python_host.bat +46 -0
- detector de enlaces - copia/manifest.json +41 -0
- detector de enlaces - copia/popup.html +866 -0
- detector de enlaces - copia/popup.js +0 -0
- detector de enlaces - copia/src/eporner/selector.js +276 -0
- detector de enlaces - copia/src/erome/quick_scan.js +36 -0
- detector de enlaces - copia/src/erome/quick_scan_images.js +60 -0
- detector de enlaces - copia/src/facebook/selector.js +328 -0
- detector de enlaces - copia/src/instagram/selector.js +520 -0
- detector de enlaces - copia/src/ixxx/selector.js +370 -0
- detector de enlaces - copia/src/jav/selector.js +526 -0
- detector de enlaces - copia/src/kemono/downloads.js +544 -0
- detector de enlaces - copia/src/kemono/images.js +546 -0
- detector de enlaces - copia/src/kemono/selector.js +267 -0
- detector de enlaces - copia/src/ladys/quick_scan.js +82 -0
- detector de enlaces - copia/src/leakgallery/quick_scan.js +30 -0
- detector de enlaces - copia/src/pornhub/selector.js +372 -0
- detector de enlaces - copia/src/tiktok/selector.js +358 -0
- detector de enlaces - copia/src/twpornstars/quick_scan.js +50 -0
- detector de enlaces - copia/src/x/auto_extractor.js +198 -0
- detector de enlaces - copia/src/x/quick_scan.js +55 -0
- detector de enlaces - copia/src/x/selector.js +330 -0
- detector de enlaces - copia/src/xhamster/selector.js +361 -0
- detector de enlaces - copia/src/xhand/selector.js +358 -0
- detector de enlaces - copia/src/xvideos/quick_scan.js +78 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
ImageNinja[[:space:]]HD/baa2d01c-243a-46ba-8e3e-26825045023b.txt filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
local-video-downloader[[:space:]]-[[:space:]]copia[[:space:]](2)[[:space:]]-[[:space:]]copia/host/bin/AtomicParsley.exe filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
local-video-downloader[[:space:]]-[[:space:]]copia[[:space:]](2)[[:space:]]-[[:space:]]copia/host/bin/ffmpeg.exe filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
local-video-downloader[[:space:]]-[[:space:]]copia[[:space:]](2)[[:space:]]-[[:space:]]copia/host/bin/ffprobe.exe filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
local-video-downloader[[:space:]]-[[:space:]]copia[[:space:]](2)[[:space:]]-[[:space:]]copia/host/bin/N_m3u8DL-RE.exe filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
local-video-downloader[[:space:]]-[[:space:]]copia[[:space:]](2)[[:space:]]-[[:space:]]copia/host/bin/yt-dlp.exe filter=lfs diff=lfs merge=lfs -text
|
ImageNinja HD/_metadata/generated_indexed_rulesets/_ruleset1
ADDED
|
Binary file (971 Bytes). View file
|
|
|
ImageNinja HD/assets/icons/icon.svg
ADDED
|
|
ImageNinja HD/baa2d01c-243a-46ba-8e3e-26825045023b.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35f993dd108bc169dca769c0d527f26c9f0dba70ae17566af81646811b237d83
|
| 3 |
+
size 146940
|
ImageNinja HD/manifest.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"manifest_version": 3,
|
| 3 |
+
"name": "Descargador de Imágenes",
|
| 4 |
+
"version": "1.0",
|
| 5 |
+
"description": "Descarga todas las imágenes de la página web donde te encuentres.",
|
| 6 |
+
"icons": {
|
| 7 |
+
"128": "assets/icons/icon.svg"
|
| 8 |
+
},
|
| 9 |
+
"permissions": [
|
| 10 |
+
"activeTab",
|
| 11 |
+
"scripting",
|
| 12 |
+
"downloads",
|
| 13 |
+
"storage",
|
| 14 |
+
"declarativeNetRequest",
|
| 15 |
+
"declarativeNetRequestWithHostAccess"
|
| 16 |
+
],
|
| 17 |
+
"background": {
|
| 18 |
+
"service_worker": "src/background/background.js"
|
| 19 |
+
},
|
| 20 |
+
"host_permissions": [
|
| 21 |
+
"<all_urls>"
|
| 22 |
+
],
|
| 23 |
+
"declarative_net_request": {
|
| 24 |
+
"rule_resources": [
|
| 25 |
+
{
|
| 26 |
+
"id": "ruleset_1",
|
| 27 |
+
"enabled": true,
|
| 28 |
+
"path": "rules.json"
|
| 29 |
+
}
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
"action": {
|
| 33 |
+
"default_popup": "src/popup/popup.html",
|
| 34 |
+
"default_title": "Descargar Imágenes",
|
| 35 |
+
"default_icon": "assets/icons/icon.svg"
|
| 36 |
+
}
|
| 37 |
+
}
|
ImageNinja HD/rules.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"id": 1,
|
| 4 |
+
"priority": 1,
|
| 5 |
+
"action": {
|
| 6 |
+
"type": "modifyHeaders",
|
| 7 |
+
"requestHeaders": [
|
| 8 |
+
{
|
| 9 |
+
"header": "Referer",
|
| 10 |
+
"operation": "set",
|
| 11 |
+
"value": "https://www.poringa.net/"
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"header": "Origin",
|
| 15 |
+
"operation": "set",
|
| 16 |
+
"value": "https://www.poringa.net"
|
| 17 |
+
}
|
| 18 |
+
],
|
| 19 |
+
"responseHeaders": [
|
| 20 |
+
{
|
| 21 |
+
"header": "Cross-Origin-Resource-Policy",
|
| 22 |
+
"operation": "remove"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"header": "Access-Control-Allow-Origin",
|
| 26 |
+
"operation": "set",
|
| 27 |
+
"value": "*"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
},
|
| 31 |
+
"condition": {
|
| 32 |
+
"urlFilter": "poringa.net",
|
| 33 |
+
"resourceTypes": ["main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", "other"]
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
]
|
ImageNinja HD/src/background/background.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const downloadMap = new Map();
|
| 2 |
+
const activeSessions = new Map();
|
| 3 |
+
|
| 4 |
+
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
| 5 |
+
if (request.action === 'registerDownload') {
|
| 6 |
+
downloadMap.set(request.url, request.filename);
|
| 7 |
+
sendResponse({ success: true });
|
| 8 |
+
return true;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
if (request.action === 'startBackgroundDownloads') {
|
| 12 |
+
startBackgroundQueue(request);
|
| 13 |
+
sendResponse({ success: true });
|
| 14 |
+
return true;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
if (request.action === 'getDownloadProgress') {
|
| 18 |
+
const session = activeSessions.get(request.comicUrl);
|
| 19 |
+
if (session) {
|
| 20 |
+
sendResponse(session);
|
| 21 |
+
} else {
|
| 22 |
+
sendResponse({ downloading: false });
|
| 23 |
+
}
|
| 24 |
+
return true;
|
| 25 |
+
}
|
| 26 |
+
});
|
| 27 |
+
|
| 28 |
+
chrome.downloads.onDeterminingFilename.addListener((item, suggest) => {
|
| 29 |
+
if (downloadMap.has(item.url)) {
|
| 30 |
+
suggest({ filename: downloadMap.get(item.url), conflictAction: 'uniquify' });
|
| 31 |
+
} else {
|
| 32 |
+
suggest();
|
| 33 |
+
}
|
| 34 |
+
});
|
| 35 |
+
|
| 36 |
+
function arrayBufferToBase64(buffer) {
|
| 37 |
+
let binary = '';
|
| 38 |
+
const bytes = new Uint8Array(buffer);
|
| 39 |
+
const len = bytes.byteLength;
|
| 40 |
+
for (let i = 0; i < len; i++) {
|
| 41 |
+
binary += String.fromCharCode(bytes[i]);
|
| 42 |
+
}
|
| 43 |
+
return btoa(binary);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
function getExtension(url) {
|
| 47 |
+
const cleanUrl = url.split(/[#?]/)[0];
|
| 48 |
+
const parts = cleanUrl.split('.');
|
| 49 |
+
if (parts.length > 1) {
|
| 50 |
+
const ext = parts.pop().toLowerCase();
|
| 51 |
+
if (['jpg', 'jpeg', 'png', 'webp', 'gif', 'svg', 'avif', 'bmp', 'tiff', 'tif', 'ico', 'heic', 'heif', 'jxl'].includes(ext)) {
|
| 52 |
+
return ext;
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
return 'jpg';
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
function getQualityFolder(width, height) {
|
| 59 |
+
const max = Math.max(width, height);
|
| 60 |
+
const min = Math.min(width, height);
|
| 61 |
+
if (min >= 2160 || max >= 3840) return '4K';
|
| 62 |
+
if (min >= 1440 || max >= 2560) return '2K';
|
| 63 |
+
if (min >= 1080 || max >= 1920) return '1080p';
|
| 64 |
+
if (min >= 720 || max >= 1280) return '720p';
|
| 65 |
+
return 'Normal';
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
async function startBackgroundQueue({ toDownload, baseSf, uniqueSf, is3Hentai, isForcePNG, separateQuality, renameSequential, comicUrl }) {
|
| 69 |
+
const finalComicUrl = comicUrl || (toDownload[0]?.src || toDownload[0] || 'default');
|
| 70 |
+
const session = {
|
| 71 |
+
downloading: true,
|
| 72 |
+
completed: 0,
|
| 73 |
+
total: toDownload.length
|
| 74 |
+
};
|
| 75 |
+
activeSessions.set(finalComicUrl, session);
|
| 76 |
+
|
| 77 |
+
const total = toDownload.length;
|
| 78 |
+
let completed = 0;
|
| 79 |
+
|
| 80 |
+
const limit = is3Hentai ? 3 : total;
|
| 81 |
+
let active = 0;
|
| 82 |
+
let i = 0;
|
| 83 |
+
|
| 84 |
+
const broadcastProgress = () => {
|
| 85 |
+
chrome.runtime.sendMessage({
|
| 86 |
+
action: 'downloadProgress',
|
| 87 |
+
comicUrl: finalComicUrl,
|
| 88 |
+
completed: completed,
|
| 89 |
+
total: total,
|
| 90 |
+
downloading: true
|
| 91 |
+
}).catch(() => {
|
| 92 |
+
// Ignore error when popup is closed
|
| 93 |
+
});
|
| 94 |
+
session.completed = completed;
|
| 95 |
+
session.total = total;
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
const runNext = async () => {
|
| 99 |
+
if (i >= total) {
|
| 100 |
+
if (completed === total) {
|
| 101 |
+
activeSessions.delete(finalComicUrl);
|
| 102 |
+
chrome.runtime.sendMessage({
|
| 103 |
+
action: 'downloadProgress',
|
| 104 |
+
comicUrl: finalComicUrl,
|
| 105 |
+
completed: completed,
|
| 106 |
+
total: total,
|
| 107 |
+
downloading: false
|
| 108 |
+
}).catch(() => {});
|
| 109 |
+
}
|
| 110 |
+
return;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
const idx = i++;
|
| 114 |
+
const img = toDownload[idx];
|
| 115 |
+
active++;
|
| 116 |
+
|
| 117 |
+
try {
|
| 118 |
+
const url = img.src || img;
|
| 119 |
+
const width = img.width || 0;
|
| 120 |
+
const height = img.height || 0;
|
| 121 |
+
const ext = isForcePNG ? 'png' : getExtension(url);
|
| 122 |
+
|
| 123 |
+
let sf = uniqueSf || baseSf || 'comics_completos';
|
| 124 |
+
if (separateQuality && width > 0 && height > 0) {
|
| 125 |
+
const quality = getQualityFolder(width, height);
|
| 126 |
+
sf = `${sf}/${quality}`;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
let name = url.split('/').pop().split(/[#?]/)[0].slice(0, 50) || `img_${idx + 1}`;
|
| 130 |
+
if (renameSequential) {
|
| 131 |
+
const padLength = Math.max(2, String(total).length);
|
| 132 |
+
name = `pag_${String(idx + 1).padStart(padLength, '0')}`;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
const filename = `${sf}/${name}.${ext}`;
|
| 136 |
+
const requiresBlobFetch = url.includes('poringa.') || url.includes('chochox.') || url.includes('gold-usergeneratedcontent.net') || url.includes('nhentaimg.com') || url.includes('sexkomix') || url.includes('3hentai.xyz') || url.includes('3hentai.net') || url.includes('vercomicsporno.com') || url.includes('lectorhentai.com') || url.includes('hentaimode.com') || url.includes('giolandscaping.com') || isForcePNG;
|
| 137 |
+
|
| 138 |
+
if (requiresBlobFetch) {
|
| 139 |
+
try {
|
| 140 |
+
const resp = await fetch(url);
|
| 141 |
+
if (!resp.ok) throw new Error('Fetch failed');
|
| 142 |
+
const blob = await resp.blob();
|
| 143 |
+
|
| 144 |
+
const buffer = await blob.arrayBuffer();
|
| 145 |
+
const base64 = arrayBufferToBase64(buffer);
|
| 146 |
+
const dataUrl = `data:${blob.type};base64,${base64}`;
|
| 147 |
+
|
| 148 |
+
await new Promise((resolve) => {
|
| 149 |
+
downloadMap.set(dataUrl, filename);
|
| 150 |
+
chrome.downloads.download({ url: dataUrl, filename: filename, saveAs: false }, () => resolve());
|
| 151 |
+
});
|
| 152 |
+
} catch (e) {
|
| 153 |
+
console.warn("Background fetch failed, falling back to direct download", e);
|
| 154 |
+
await new Promise((resolve) => {
|
| 155 |
+
downloadMap.set(url, filename);
|
| 156 |
+
chrome.downloads.download({ url: url, filename: filename, saveAs: false }, () => resolve());
|
| 157 |
+
});
|
| 158 |
+
}
|
| 159 |
+
} else {
|
| 160 |
+
await new Promise((resolve) => {
|
| 161 |
+
downloadMap.set(url, filename);
|
| 162 |
+
chrome.downloads.download({ url: url, filename: filename, saveAs: false }, () => resolve());
|
| 163 |
+
});
|
| 164 |
+
}
|
| 165 |
+
} catch (err) {
|
| 166 |
+
console.error("Background download error:", err);
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
active--;
|
| 170 |
+
completed++;
|
| 171 |
+
broadcastProgress();
|
| 172 |
+
runNext();
|
| 173 |
+
};
|
| 174 |
+
|
| 175 |
+
for (let j = 0; j < Math.min(limit, total); j++) {
|
| 176 |
+
runNext();
|
| 177 |
+
}
|
| 178 |
+
}
|
ImageNinja HD/src/popup/modules/downloader.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { DOM } from './state.js';
|
| 2 |
+
import { getExtension } from './filters.js';
|
| 3 |
+
|
| 4 |
+
export function getQualityFolder(width, height) {
|
| 5 |
+
const max = Math.max(width, height);
|
| 6 |
+
const min = Math.min(width, height);
|
| 7 |
+
if (min >= 2160 || max >= 3840) return '4K';
|
| 8 |
+
if (min >= 1440 || max >= 2560) return '2K';
|
| 9 |
+
if (min >= 1080 || max >= 1920) return '1080p';
|
| 10 |
+
if (min >= 720 || max >= 1280) return '720p';
|
| 11 |
+
return 'Normal';
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
export function convertWebpToPng(blob) {
|
| 15 |
+
return new Promise((resolve, reject) => {
|
| 16 |
+
const img = new Image();
|
| 17 |
+
const url = URL.createObjectURL(blob);
|
| 18 |
+
img.onload = () => {
|
| 19 |
+
URL.revokeObjectURL(url);
|
| 20 |
+
const canvas = document.createElement('canvas');
|
| 21 |
+
canvas.width = img.naturalWidth;
|
| 22 |
+
canvas.height = img.naturalHeight;
|
| 23 |
+
const ctx = canvas.getContext('2d');
|
| 24 |
+
ctx.drawImage(img, 0, 0);
|
| 25 |
+
canvas.toBlob((pngBlob) => {
|
| 26 |
+
if (pngBlob) {
|
| 27 |
+
resolve(pngBlob);
|
| 28 |
+
} else {
|
| 29 |
+
reject(new Error('Canvas conversion to PNG failed'));
|
| 30 |
+
}
|
| 31 |
+
}, 'image/png');
|
| 32 |
+
};
|
| 33 |
+
img.onerror = (e) => {
|
| 34 |
+
URL.revokeObjectURL(url);
|
| 35 |
+
reject(e);
|
| 36 |
+
};
|
| 37 |
+
img.src = url;
|
| 38 |
+
});
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
export async function getUniqueSubfolder(baseFolder) {
|
| 42 |
+
return baseFolder || 'comics_completos';
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
export async function downloadImage(img, idx = 0, totalItems = 1, uniqueSf = null) {
|
| 46 |
+
const url = img.src || img; // Fallback
|
| 47 |
+
const width = img.width || 0;
|
| 48 |
+
const height = img.height || 0;
|
| 49 |
+
|
| 50 |
+
const isForcePNG = DOM.forcePNG && DOM.forcePNG.checked;
|
| 51 |
+
const ext = isForcePNG ? 'png' : (getExtension(url) === 'desconocido' ? 'jpg' : getExtension(url));
|
| 52 |
+
|
| 53 |
+
let sf = uniqueSf;
|
| 54 |
+
if (!sf) {
|
| 55 |
+
sf = DOM.subfolderInput.value.trim().replace(/[\\:*?"<>|]/g, "") || 'comics_completos';
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
if (DOM.separateQuality && DOM.separateQuality.checked && width > 0 && height > 0) {
|
| 59 |
+
const quality = getQualityFolder(width, height);
|
| 60 |
+
sf = `${sf}/${quality}`;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
let name = url.split('/').pop().split(/[#?]/)[0].slice(0, 50) || `img_${idx + 1}`;
|
| 64 |
+
|
| 65 |
+
if (DOM.renameSequential && DOM.renameSequential.checked) {
|
| 66 |
+
const padLength = Math.max(2, String(totalItems).length);
|
| 67 |
+
name = `pag_${String(idx + 1).padStart(padLength, '0')}`;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
const filename = `${sf}/${name}.${ext}`;
|
| 71 |
+
|
| 72 |
+
const requiresBlobFetch = url.includes('poringa.') || url.includes('chochox.') || url.includes('gold-usergeneratedcontent.net') || url.includes('nhentaimg.com') || url.includes('sexkomix') || url.includes('3hentai.xyz') || url.includes('3hentai.net') || url.includes('vercomicsporno.com') || url.includes('lectorhentai.com') || url.includes('hentaimode.com') || url.includes('giolandscaping.com') || isForcePNG;
|
| 73 |
+
|
| 74 |
+
if (requiresBlobFetch) {
|
| 75 |
+
return new Promise((resolve) => {
|
| 76 |
+
fetch(url)
|
| 77 |
+
.then(r => { if(!r.ok) throw new Error('Fetch failed'); return r.blob(); })
|
| 78 |
+
.then(async (blob) => {
|
| 79 |
+
let finalBlob = blob;
|
| 80 |
+
if (isForcePNG && blob.type !== 'image/png') {
|
| 81 |
+
try {
|
| 82 |
+
finalBlob = await convertWebpToPng(blob);
|
| 83 |
+
} catch (e) {
|
| 84 |
+
console.warn("PNG conversion failed, falling back to original blob", e);
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
const reader = new FileReader();
|
| 88 |
+
reader.onloadend = () => {
|
| 89 |
+
const dataUrl = reader.result;
|
| 90 |
+
chrome.runtime.sendMessage({ action: 'registerDownload', url: dataUrl, filename: filename }, () => {
|
| 91 |
+
chrome.downloads.download({ url: dataUrl, filename: filename, saveAs: false }, () => resolve());
|
| 92 |
+
});
|
| 93 |
+
};
|
| 94 |
+
reader.readAsDataURL(finalBlob);
|
| 95 |
+
})
|
| 96 |
+
.catch(e => {
|
| 97 |
+
console.warn("Blob fetch failed, falling back to direct download", e);
|
| 98 |
+
chrome.runtime.sendMessage({ action: 'registerDownload', url: url, filename: filename }, () => {
|
| 99 |
+
chrome.downloads.download({ url, filename: filename, saveAs: false }, () => resolve());
|
| 100 |
+
});
|
| 101 |
+
});
|
| 102 |
+
});
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
return new Promise((resolve) => {
|
| 106 |
+
chrome.runtime.sendMessage({ action: 'registerDownload', url: url, filename: filename }, () => {
|
| 107 |
+
chrome.downloads.download({ url, filename: filename, saveAs: false }, () => resolve());
|
| 108 |
+
});
|
| 109 |
+
});
|
| 110 |
+
}
|
ImageNinja HD/src/popup/modules/filters.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { state, DOM } from './state.js';
|
| 2 |
+
import { render } from '../popup.js';
|
| 3 |
+
|
| 4 |
+
export function getExtension(url) {
|
| 5 |
+
let e = url.split('.').pop().split(/[#?]/)[0].toLowerCase();
|
| 6 |
+
return ['jpg','jpeg','png','webp','gif','svg','avif','bmp','tiff','tif','ico','heic','heif','jxl'].includes(e) ? e : 'desconocido';
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export function applyFilters() {
|
| 10 |
+
const w = parseInt(DOM.minWidth.value) || 0;
|
| 11 |
+
const h = parseInt(DOM.minHeight.value) || 0;
|
| 12 |
+
const text = DOM.filterUrl.value.toLowerCase();
|
| 13 |
+
const ext = DOM.filterExt.value;
|
| 14 |
+
|
| 15 |
+
state.filteredImages = state.allImages.filter(img => {
|
| 16 |
+
if (DOM.cleanBrokenToggle && DOM.cleanBrokenToggle.checked && img.isBroken) return false;
|
| 17 |
+
|
| 18 |
+
// Exempt direct links, kemono thumbs, and actively searching HD images from size filtering initially
|
| 19 |
+
const isExempt = img.hdSearching || (!img.hdFound && (img.isDirectLink || img.isKemonoThumb));
|
| 20 |
+
if (!isExempt && (img.width < w || img.height < h)) return false;
|
| 21 |
+
if (ext !== 'all' && getExtension(img.src) !== ext) return false;
|
| 22 |
+
if (text && !img.src.toLowerCase().includes(text)) return false;
|
| 23 |
+
return true;
|
| 24 |
+
});
|
| 25 |
+
|
| 26 |
+
if (DOM.smartComic && DOM.smartComic.checked && state.filteredImages.length > 0) {
|
| 27 |
+
const dirInfo = {};
|
| 28 |
+
state.filteredImages.forEach(img => {
|
| 29 |
+
if (img.hdSearching || (!img.hdFound && (img.isDirectLink || img.isKemonoThumb))) return;
|
| 30 |
+
try {
|
| 31 |
+
const url = img.originalSrc || img.src;
|
| 32 |
+
if (!url.startsWith('http')) return;
|
| 33 |
+
const urlObj = new URL(url);
|
| 34 |
+
const pathStr = urlObj.pathname;
|
| 35 |
+
const dirPath = urlObj.origin + pathStr.substring(0, pathStr.lastIndexOf('/'));
|
| 36 |
+
|
| 37 |
+
if (!dirInfo[dirPath]) dirInfo[dirPath] = 0;
|
| 38 |
+
if (img.width >= 300 && img.height >= 300) {
|
| 39 |
+
dirInfo[dirPath] += 2;
|
| 40 |
+
} else {
|
| 41 |
+
dirInfo[dirPath] += 1;
|
| 42 |
+
}
|
| 43 |
+
} catch(e) {}
|
| 44 |
+
});
|
| 45 |
+
|
| 46 |
+
let mainDir = '';
|
| 47 |
+
let maxScore = 0;
|
| 48 |
+
for (const [dir, score] of Object.entries(dirInfo)) {
|
| 49 |
+
if (score > maxScore) {
|
| 50 |
+
maxScore = score;
|
| 51 |
+
mainDir = dir;
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
state.filteredImages = state.filteredImages.filter(img => {
|
| 56 |
+
if (img.hdSearching || (!img.hdFound && (img.isDirectLink || img.isKemonoThumb))) return true;
|
| 57 |
+
|
| 58 |
+
try {
|
| 59 |
+
const url = img.originalSrc || img.src;
|
| 60 |
+
const urlObj = new URL(url);
|
| 61 |
+
const pathStr = urlObj.pathname;
|
| 62 |
+
const dirPath = urlObj.origin + pathStr.substring(0, pathStr.lastIndexOf('/'));
|
| 63 |
+
|
| 64 |
+
if (maxScore >= 4) {
|
| 65 |
+
return dirPath === mainDir && img.width >= 300 && img.height >= 300;
|
| 66 |
+
} else {
|
| 67 |
+
return img.width >= 300 && img.height >= 300;
|
| 68 |
+
}
|
| 69 |
+
} catch {
|
| 70 |
+
return true;
|
| 71 |
+
}
|
| 72 |
+
});
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
// Limpiar selección de lo que ya no es visible
|
| 76 |
+
const visibleSrcs = new Set(state.filteredImages.map(i => i.src));
|
| 77 |
+
state.selectedImages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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export async function getImagesFromPageDOM() {
|
| 2 |
+
const isHentaiMode = window.location.hostname.includes('hentaimode.com');
|
| 3 |
+
if (isHentaiMode) {
|
| 4 |
+
try {
|
| 5 |
+
if (typeof window.ts_reader !== 'undefined') {
|
| 6 |
+
let images = null;
|
| 7 |
+
if (window.ts_reader.sources && window.ts_reader.sources[0] && window.ts_reader.sources[0].images) {
|
| 8 |
+
images = window.ts_reader.sources[0].images;
|
| 9 |
+
} else if (window.ts_reader.params && window.ts_reader.params.sources && window.ts_reader.params.sources[0] && window.ts_reader.params.sources[0].images) {
|
| 10 |
+
images = window.ts_reader.params.sources[0].images;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
if (images && images.length > 0) {
|
| 14 |
+
return images.map(src => {
|
| 15 |
+
let finalSrc = src;
|
| 16 |
+
try {
|
| 17 |
+
finalSrc = new URL(finalSrc, window.location.href).href;
|
| 18 |
+
} catch (e) {}
|
| 19 |
+
return {
|
| 20 |
+
src: finalSrc,
|
| 21 |
+
width: 0,
|
| 22 |
+
height: 0,
|
| 23 |
+
inLink: false,
|
| 24 |
+
linkHref: null,
|
| 25 |
+
isKemonoThumb: false,
|
| 26 |
+
isDirectLink: true
|
| 27 |
+
};
|
| 28 |
+
});
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
const isMangaDetailsPage = !window.location.pathname.includes('/leer/');
|
| 33 |
+
|
| 34 |
+
if (isMangaDetailsPage) {
|
| 35 |
+
const title = document.querySelector('h1, .post-title h1, .manga-title h1')?.textContent?.trim() || document.title;
|
| 36 |
+
const coverEl = document.querySelector('.summary_image img, .manga-cover img, .summary-image img, .manga-info img, img.cover');
|
| 37 |
+
const cover = coverEl ? (coverEl.getAttribute('data-src') || coverEl.getAttribute('data-lazy-src') || coverEl.getAttribute('src') || '') : '';
|
| 38 |
+
|
| 39 |
+
const chapters = [];
|
| 40 |
+
const seenChapters = new Set();
|
| 41 |
+
const chapterLinks = document.querySelectorAll('a[href*="/leer/"]');
|
| 42 |
+
chapterLinks.forEach(a => {
|
| 43 |
+
let href = a.href;
|
| 44 |
+
if (href) {
|
| 45 |
+
try {
|
| 46 |
+
href = new URL(href, window.location.href).href;
|
| 47 |
+
} catch(e) {}
|
| 48 |
+
if (!seenChapters.has(href)) {
|
| 49 |
+
seenChapters.add(href);
|
| 50 |
+
chapters.push(href);
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
});
|
| 54 |
+
|
| 55 |
+
if (chapters.length > 0) {
|
| 56 |
+
chapters.reverse();
|
| 57 |
+
const results = [];
|
| 58 |
+
const seenImages = new Set();
|
| 59 |
+
|
| 60 |
+
for (const url of chapters) {
|
| 61 |
+
try {
|
| 62 |
+
const resp = await fetch(url);
|
| 63 |
+
if (resp.ok) {
|
| 64 |
+
const html = await resp.text();
|
| 65 |
+
|
| 66 |
+
const match = html.match(/ts_reader\s*=\s*({[\s\S]*?});/);
|
| 67 |
+
if (match) {
|
| 68 |
+
try {
|
| 69 |
+
const data = JSON.parse(match[1]);
|
| 70 |
+
let images = null;
|
| 71 |
+
if (data.sources && data.sources[0] && data.sources[0].images) {
|
| 72 |
+
images = data.sources[0].images;
|
| 73 |
+
} else if (data.params && data.params.sources && data.params.sources[0] && data.params.sources[0].images) {
|
| 74 |
+
images = data.params.sources[0].images;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
if (images && images.length > 0) {
|
| 78 |
+
images.forEach(src => {
|
| 79 |
+
let finalSrc = src;
|
| 80 |
+
try {
|
| 81 |
+
finalSrc = new URL(finalSrc, url).href;
|
| 82 |
+
} catch (e) {}
|
| 83 |
+
if (finalSrc.startsWith('http') && !seenImages.has(finalSrc)) {
|
| 84 |
+
seenImages.add(finalSrc);
|
| 85 |
+
results.push({
|
| 86 |
+
src: finalSrc,
|
| 87 |
+
width: 0,
|
| 88 |
+
height: 0,
|
| 89 |
+
inLink: false,
|
| 90 |
+
linkHref: null,
|
| 91 |
+
isKemonoThumb: false,
|
| 92 |
+
isDirectLink: true
|
| 93 |
+
});
|
| 94 |
+
}
|
| 95 |
+
});
|
| 96 |
+
continue;
|
| 97 |
+
}
|
| 98 |
+
} catch(e) {}
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
| 102 |
+
const selectors = [
|
| 103 |
+
'.reading-content img',
|
| 104 |
+
'.wp-manga-chapter-img img',
|
| 105 |
+
'.wp-manga-chapter-img',
|
| 106 |
+
'.page-break img',
|
| 107 |
+
'.viewer-pages img',
|
| 108 |
+
'#viewer img',
|
| 109 |
+
'#viewer-container img',
|
| 110 |
+
'.chapter-images img',
|
| 111 |
+
'.reader-images img',
|
| 112 |
+
'#reader img',
|
| 113 |
+
'.reader img',
|
| 114 |
+
'#readerarea img'
|
| 115 |
+
];
|
| 116 |
+
|
| 117 |
+
doc.querySelectorAll(selectors.join(', ')).forEach(img => {
|
| 118 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('src');
|
| 119 |
+
if (src && !src.includes('readerarea.svg')) {
|
| 120 |
+
try {
|
| 121 |
+
src = new URL(src, url).href;
|
| 122 |
+
} catch(e) {}
|
| 123 |
+
if (src.startsWith('http') && !seenImages.has(src)) {
|
| 124 |
+
seenImages.add(src);
|
| 125 |
+
results.push({
|
| 126 |
+
src: src,
|
| 127 |
+
width: img.naturalWidth || img.width || 0,
|
| 128 |
+
height: img.naturalHeight || img.height || 0,
|
| 129 |
+
inLink: false,
|
| 130 |
+
linkHref: null,
|
| 131 |
+
isKemonoThumb: false,
|
| 132 |
+
isDirectLink: true
|
| 133 |
+
});
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
});
|
| 137 |
+
}
|
| 138 |
+
} catch(err) {}
|
| 139 |
+
}
|
| 140 |
+
if (results.length > 0) {
|
| 141 |
+
return results;
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
const results = [];
|
| 147 |
+
const seen = new Set();
|
| 148 |
+
const selectors = [
|
| 149 |
+
'.reading-content img',
|
| 150 |
+
'.wp-manga-chapter-img img',
|
| 151 |
+
'.wp-manga-chapter-img',
|
| 152 |
+
'.page-break img',
|
| 153 |
+
'.viewer-pages img',
|
| 154 |
+
'#viewer img',
|
| 155 |
+
'#viewer-container img',
|
| 156 |
+
'.chapter-images img',
|
| 157 |
+
'.reader-images img',
|
| 158 |
+
'#reader img',
|
| 159 |
+
'.reader img',
|
| 160 |
+
'#readerarea img'
|
| 161 |
+
];
|
| 162 |
+
|
| 163 |
+
document.querySelectorAll(selectors.join(', ')).forEach(img => {
|
| 164 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('src');
|
| 165 |
+
if (src && !src.includes('readerarea.svg')) {
|
| 166 |
+
try {
|
| 167 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 168 |
+
src = new URL(src, window.location.href).href;
|
| 169 |
+
}
|
| 170 |
+
} catch(e) {}
|
| 171 |
+
if (src.startsWith('http') && !seen.has(src)) {
|
| 172 |
+
seen.add(src);
|
| 173 |
+
results.push({
|
| 174 |
+
src: src,
|
| 175 |
+
width: img.naturalWidth || img.width || 0,
|
| 176 |
+
height: img.naturalHeight || img.height || 0,
|
| 177 |
+
inLink: false,
|
| 178 |
+
linkHref: null,
|
| 179 |
+
isKemonoThumb: false,
|
| 180 |
+
isDirectLink: true
|
| 181 |
+
});
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
});
|
| 185 |
+
|
| 186 |
+
if (results.length < 3) {
|
| 187 |
+
try {
|
| 188 |
+
const resp = await fetch(window.location.href);
|
| 189 |
+
if (resp.ok) {
|
| 190 |
+
const html = await resp.text();
|
| 191 |
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
| 192 |
+
doc.querySelectorAll(selectors.join(', ')).forEach(img => {
|
| 193 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('src');
|
| 194 |
+
if (src && !src.includes('readerarea.svg')) {
|
| 195 |
+
try {
|
| 196 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 197 |
+
src = new URL(src, window.location.href).href;
|
| 198 |
+
}
|
| 199 |
+
} catch(e) {}
|
| 200 |
+
if (src.startsWith('http') && !seen.has(src)) {
|
| 201 |
+
seen.add(src);
|
| 202 |
+
results.push({
|
| 203 |
+
src: src,
|
| 204 |
+
width: img.naturalWidth || img.width || 0,
|
| 205 |
+
height: img.naturalHeight || img.height || 0,
|
| 206 |
+
inLink: false,
|
| 207 |
+
linkHref: null,
|
| 208 |
+
isKemonoThumb: false,
|
| 209 |
+
isDirectLink: true
|
| 210 |
+
});
|
| 211 |
+
}
|
| 212 |
+
}
|
| 213 |
+
});
|
| 214 |
+
}
|
| 215 |
+
} catch(err) {}
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
if (results.length === 0) {
|
| 219 |
+
document.querySelectorAll('img').forEach(img => {
|
| 220 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('data-opt-src') || img.src;
|
| 221 |
+
if (src && !src.includes('readerarea.svg')) {
|
| 222 |
+
try {
|
| 223 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 224 |
+
src = new URL(src, window.location.href).href;
|
| 225 |
+
}
|
| 226 |
+
} catch(e) {}
|
| 227 |
+
if (src.startsWith('http') && !src.includes('logo') && !src.includes('banner') && !seen.has(src)) {
|
| 228 |
+
seen.add(src);
|
| 229 |
+
results.push({
|
| 230 |
+
src: src,
|
| 231 |
+
width: img.naturalWidth || img.width || 0,
|
| 232 |
+
height: img.naturalHeight || img.height || 0,
|
| 233 |
+
inLink: false,
|
| 234 |
+
linkHref: null,
|
| 235 |
+
isKemonoThumb: false,
|
| 236 |
+
isDirectLink: true
|
| 237 |
+
});
|
| 238 |
+
}
|
| 239 |
+
}
|
| 240 |
+
});
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
if (results.length > 0) {
|
| 244 |
+
return results;
|
| 245 |
+
}
|
| 246 |
+
} catch (e) {
|
| 247 |
+
console.error("HentaiMode parser error:", e);
|
| 248 |
+
}
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
const isLectorHentai = window.location.hostname.includes('lectorhentai.com');
|
| 252 |
+
if (isLectorHentai) {
|
| 253 |
+
try {
|
| 254 |
+
if (typeof window.ts_reader !== 'undefined') {
|
| 255 |
+
let images = null;
|
| 256 |
+
if (window.ts_reader.sources && window.ts_reader.sources[0] && window.ts_reader.sources[0].images) {
|
| 257 |
+
images = window.ts_reader.sources[0].images;
|
| 258 |
+
} else if (window.ts_reader.params && window.ts_reader.params.sources && window.ts_reader.params.sources[0] && window.ts_reader.params.sources[0].images) {
|
| 259 |
+
images = window.ts_reader.params.sources[0].images;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
if (images && images.length > 0) {
|
| 263 |
+
return images.map(src => {
|
| 264 |
+
let finalSrc = src;
|
| 265 |
+
try {
|
| 266 |
+
finalSrc = new URL(finalSrc, window.location.href).href;
|
| 267 |
+
} catch (e) {}
|
| 268 |
+
return {
|
| 269 |
+
src: finalSrc,
|
| 270 |
+
width: 0,
|
| 271 |
+
height: 0,
|
| 272 |
+
inLink: false,
|
| 273 |
+
linkHref: null,
|
| 274 |
+
isKemonoThumb: false,
|
| 275 |
+
isDirectLink: true
|
| 276 |
+
};
|
| 277 |
+
});
|
| 278 |
+
}
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
const isMangaDetailsPage = window.location.pathname.includes('/manga/') &&
|
| 282 |
+
!window.location.pathname.includes('/capitulo') &&
|
| 283 |
+
!window.location.pathname.includes('/chapter') &&
|
| 284 |
+
!window.location.pathname.includes('/read/') &&
|
| 285 |
+
!window.location.pathname.includes('/lector/');
|
| 286 |
+
const hasReaderElement = document.querySelector('.reading-content, .wp-manga-chapter-img, .page-break, #viewer, .chapter-images, #readerarea');
|
| 287 |
+
|
| 288 |
+
if (isMangaDetailsPage && !hasReaderElement) {
|
| 289 |
+
const title = document.querySelector('h1, .post-title h1, .manga-title h1')?.textContent?.trim() || document.title;
|
| 290 |
+
const coverEl = document.querySelector('.summary_image img, .manga-cover img, .summary-image img, .manga-info img');
|
| 291 |
+
const cover = coverEl ? (coverEl.getAttribute('data-src') || coverEl.getAttribute('data-lazy-src') || coverEl.getAttribute('src') || '') : '';
|
| 292 |
+
|
| 293 |
+
const chapters = [];
|
| 294 |
+
const seenChapters = new Set();
|
| 295 |
+
const chapterLinks = document.querySelectorAll('.wp-manga-chapter a, .listing-chapters_wrap a, a[href*="/capitulo-"], a[href*="/chapter-"], a[href*="/read/"], a[href*="/lector/"]');
|
| 296 |
+
chapterLinks.forEach(a => {
|
| 297 |
+
let href = a.href;
|
| 298 |
+
if (href) {
|
| 299 |
+
try {
|
| 300 |
+
href = new URL(href, window.location.href).href;
|
| 301 |
+
} catch(e) {}
|
| 302 |
+
if (!seenChapters.has(href)) {
|
| 303 |
+
seenChapters.add(href);
|
| 304 |
+
chapters.push(href);
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
});
|
| 308 |
+
|
| 309 |
+
if (chapters.length === 0) {
|
| 310 |
+
document.querySelectorAll('a').forEach(a => {
|
| 311 |
+
let href = a.href;
|
| 312 |
+
if (href && (href.includes('/capitulo-') || href.includes('/chapter-') || href.includes('/read/') || href.includes('/lector/') || a.textContent.toLowerCase().includes('capítulo') || a.textContent.toLowerCase().includes('cap.') || a.textContent.toLowerCase().includes('chapter') || a.textContent.toLowerCase().includes('ch.'))) {
|
| 313 |
+
try {
|
| 314 |
+
href = new URL(href, window.location.href).href;
|
| 315 |
+
} catch(e) {}
|
| 316 |
+
if (!seenChapters.has(href)) {
|
| 317 |
+
seenChapters.add(href);
|
| 318 |
+
chapters.push(href);
|
| 319 |
+
}
|
| 320 |
+
}
|
| 321 |
+
});
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
if (chapters.length > 0) {
|
| 325 |
+
chapters.reverse();
|
| 326 |
+
|
| 327 |
+
const results = [];
|
| 328 |
+
const seenImages = new Set();
|
| 329 |
+
const selectors = [
|
| 330 |
+
'.reading-content img',
|
| 331 |
+
'.wp-manga-chapter-img img',
|
| 332 |
+
'.wp-manga-chapter-img',
|
| 333 |
+
'.page-break img',
|
| 334 |
+
'.viewer-pages img',
|
| 335 |
+
'#viewer img',
|
| 336 |
+
'.chapter-images img',
|
| 337 |
+
'#readerarea img'
|
| 338 |
+
];
|
| 339 |
+
|
| 340 |
+
for (const url of chapters) {
|
| 341 |
+
try {
|
| 342 |
+
const resp = await fetch(url);
|
| 343 |
+
if (resp.ok) {
|
| 344 |
+
const html = await resp.text();
|
| 345 |
+
|
| 346 |
+
const match = html.match(/ts_reader\s*=\s*({[\s\S]*?});/);
|
| 347 |
+
if (match) {
|
| 348 |
+
try {
|
| 349 |
+
const data = JSON.parse(match[1]);
|
| 350 |
+
let images = null;
|
| 351 |
+
if (data.sources && data.sources[0] && data.sources[0].images) {
|
| 352 |
+
images = data.sources[0].images;
|
| 353 |
+
} else if (data.params && data.params.sources && data.params.sources[0] && data.params.sources[0].images) {
|
| 354 |
+
images = data.params.sources[0].images;
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
if (images && images.length > 0) {
|
| 358 |
+
images.forEach(src => {
|
| 359 |
+
let finalSrc = src;
|
| 360 |
+
try {
|
| 361 |
+
finalSrc = new URL(finalSrc, url).href;
|
| 362 |
+
} catch (e) {}
|
| 363 |
+
if (finalSrc.startsWith('http') && !seenImages.has(finalSrc)) {
|
| 364 |
+
seenImages.add(finalSrc);
|
| 365 |
+
results.push({
|
| 366 |
+
src: finalSrc,
|
| 367 |
+
width: 0,
|
| 368 |
+
height: 0,
|
| 369 |
+
inLink: false,
|
| 370 |
+
linkHref: null,
|
| 371 |
+
isKemonoThumb: false,
|
| 372 |
+
isDirectLink: true
|
| 373 |
+
});
|
| 374 |
+
}
|
| 375 |
+
});
|
| 376 |
+
continue;
|
| 377 |
+
}
|
| 378 |
+
} catch(e) {}
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
| 382 |
+
|
| 383 |
+
doc.querySelectorAll(selectors.join(', ')).forEach(img => {
|
| 384 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('src');
|
| 385 |
+
if (src && !src.includes('readerarea.svg')) {
|
| 386 |
+
try {
|
| 387 |
+
src = new URL(src, url).href;
|
| 388 |
+
} catch(e) {}
|
| 389 |
+
if (src.startsWith('http') && !seenImages.has(src)) {
|
| 390 |
+
seenImages.add(src);
|
| 391 |
+
results.push({
|
| 392 |
+
src: src,
|
| 393 |
+
width: img.naturalWidth || img.width || 0,
|
| 394 |
+
height: img.naturalHeight || img.height || 0,
|
| 395 |
+
inLink: false,
|
| 396 |
+
linkHref: null,
|
| 397 |
+
isKemonoThumb: false,
|
| 398 |
+
isDirectLink: true
|
| 399 |
+
});
|
| 400 |
+
}
|
| 401 |
+
}
|
| 402 |
+
});
|
| 403 |
+
|
| 404 |
+
if (results.length === 0) {
|
| 405 |
+
doc.querySelectorAll('img').forEach(img => {
|
| 406 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('data-opt-src') || img.src;
|
| 407 |
+
if (src && !src.includes('readerarea.svg')) {
|
| 408 |
+
try {
|
| 409 |
+
src = new URL(src, url).href;
|
| 410 |
+
} catch(e) {}
|
| 411 |
+
if (src.startsWith('http') && !src.includes('logo') && !src.includes('banner') && !seenImages.has(src)) {
|
| 412 |
+
seenImages.add(src);
|
| 413 |
+
results.push({
|
| 414 |
+
src: src,
|
| 415 |
+
width: img.naturalWidth || img.width || 0,
|
| 416 |
+
height: img.naturalHeight || img.height || 0,
|
| 417 |
+
inLink: false,
|
| 418 |
+
linkHref: null,
|
| 419 |
+
isKemonoThumb: false,
|
| 420 |
+
isDirectLink: true
|
| 421 |
+
});
|
| 422 |
+
}
|
| 423 |
+
}
|
| 424 |
+
});
|
| 425 |
+
}
|
| 426 |
+
}
|
| 427 |
+
} catch(err) {}
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
if (results.length > 0) {
|
| 431 |
+
return results;
|
| 432 |
+
}
|
| 433 |
+
}
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
const results = [];
|
| 437 |
+
const seen = new Set();
|
| 438 |
+
const selectors = [
|
| 439 |
+
'.reading-content img',
|
| 440 |
+
'.wp-manga-chapter-img img',
|
| 441 |
+
'.wp-manga-chapter-img',
|
| 442 |
+
'.page-break img',
|
| 443 |
+
'.viewer-pages img',
|
| 444 |
+
'#viewer img',
|
| 445 |
+
'.chapter-images img',
|
| 446 |
+
'#readerarea img'
|
| 447 |
+
];
|
| 448 |
+
|
| 449 |
+
document.querySelectorAll(selectors.join(', ')).forEach(img => {
|
| 450 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('src');
|
| 451 |
+
if (src) {
|
| 452 |
+
try {
|
| 453 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 454 |
+
src = new URL(src, window.location.href).href;
|
| 455 |
+
}
|
| 456 |
+
} catch(e) {}
|
| 457 |
+
if (src.startsWith('http') && !seen.has(src)) {
|
| 458 |
+
seen.add(src);
|
| 459 |
+
results.push({
|
| 460 |
+
src: src,
|
| 461 |
+
width: img.naturalWidth || img.width || 0,
|
| 462 |
+
height: img.naturalHeight || img.height || 0,
|
| 463 |
+
inLink: false,
|
| 464 |
+
linkHref: null,
|
| 465 |
+
isKemonoThumb: false,
|
| 466 |
+
isDirectLink: true
|
| 467 |
+
});
|
| 468 |
+
}
|
| 469 |
+
}
|
| 470 |
+
});
|
| 471 |
+
|
| 472 |
+
if (results.length < 3) {
|
| 473 |
+
try {
|
| 474 |
+
const resp = await fetch(window.location.href);
|
| 475 |
+
if (resp.ok) {
|
| 476 |
+
const html = await resp.text();
|
| 477 |
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
| 478 |
+
doc.querySelectorAll(selectors.join(', ')).forEach(img => {
|
| 479 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('src');
|
| 480 |
+
if (src) {
|
| 481 |
+
try {
|
| 482 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 483 |
+
src = new URL(src, window.location.href).href;
|
| 484 |
+
}
|
| 485 |
+
} catch(e) {}
|
| 486 |
+
if (src.startsWith('http') && !seen.has(src)) {
|
| 487 |
+
seen.add(src);
|
| 488 |
+
results.push({
|
| 489 |
+
src: src,
|
| 490 |
+
width: img.naturalWidth || img.width || 0,
|
| 491 |
+
height: img.naturalHeight || img.height || 0,
|
| 492 |
+
inLink: false,
|
| 493 |
+
linkHref: null,
|
| 494 |
+
isKemonoThumb: false,
|
| 495 |
+
isDirectLink: true
|
| 496 |
+
});
|
| 497 |
+
}
|
| 498 |
+
}
|
| 499 |
+
});
|
| 500 |
+
}
|
| 501 |
+
} catch(err) {}
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
if (results.length === 0) {
|
| 505 |
+
document.querySelectorAll('img').forEach(img => {
|
| 506 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-original') || img.getAttribute('data-opt-src') || img.src;
|
| 507 |
+
if (src) {
|
| 508 |
+
try {
|
| 509 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 510 |
+
src = new URL(src, window.location.href).href;
|
| 511 |
+
}
|
| 512 |
+
} catch(e) {}
|
| 513 |
+
if (src.startsWith('http') && !src.includes('logo') && !src.includes('banner') && !seen.has(src)) {
|
| 514 |
+
seen.add(src);
|
| 515 |
+
results.push({
|
| 516 |
+
src: src,
|
| 517 |
+
width: img.naturalWidth || img.width || 0,
|
| 518 |
+
height: img.naturalHeight || img.height || 0,
|
| 519 |
+
inLink: false,
|
| 520 |
+
linkHref: null,
|
| 521 |
+
isKemonoThumb: false,
|
| 522 |
+
isDirectLink: true
|
| 523 |
+
});
|
| 524 |
+
}
|
| 525 |
+
}
|
| 526 |
+
});
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
if (results.length > 0) {
|
| 530 |
+
return results;
|
| 531 |
+
}
|
| 532 |
+
} catch (e) {
|
| 533 |
+
console.error("LectorHentai parser error:", e);
|
| 534 |
+
}
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
const isVerComicsPorno = window.location.hostname.includes('vercomicsporno.com');
|
| 538 |
+
if (isVerComicsPorno) {
|
| 539 |
+
try {
|
| 540 |
+
const results = [];
|
| 541 |
+
const seen = new Set();
|
| 542 |
+
document.querySelectorAll('.wp-content img, .posts img').forEach(img => {
|
| 543 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('src');
|
| 544 |
+
if (src) {
|
| 545 |
+
try {
|
| 546 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 547 |
+
src = new URL(src, window.location.href).href;
|
| 548 |
+
}
|
| 549 |
+
} catch(e) {}
|
| 550 |
+
if (
|
| 551 |
+
src.startsWith('http') &&
|
| 552 |
+
src.includes('/wp-content/uploads/') &&
|
| 553 |
+
!src.includes('avatar.jpg') &&
|
| 554 |
+
!src.includes('/avatar') &&
|
| 555 |
+
!src.match(/-\d+x\d+\.(jpg|jpeg|png|webp|gif)$/i) &&
|
| 556 |
+
!seen.has(src)
|
| 557 |
+
) {
|
| 558 |
+
seen.add(src);
|
| 559 |
+
results.push({
|
| 560 |
+
src: src,
|
| 561 |
+
width: img.naturalWidth || img.width || 0,
|
| 562 |
+
height: img.naturalHeight || img.height || 0,
|
| 563 |
+
inLink: false,
|
| 564 |
+
linkHref: null,
|
| 565 |
+
isKemonoThumb: false,
|
| 566 |
+
isDirectLink: true
|
| 567 |
+
});
|
| 568 |
+
}
|
| 569 |
+
}
|
| 570 |
+
});
|
| 571 |
+
if (results.length > 0) {
|
| 572 |
+
return results;
|
| 573 |
+
}
|
| 574 |
+
} catch (e) {
|
| 575 |
+
console.error("vercomicsporno parser error:", e);
|
| 576 |
+
}
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
const isSexkomix = window.location.hostname.includes('sexkomix');
|
| 580 |
+
if (isSexkomix) {
|
| 581 |
+
try {
|
| 582 |
+
const results = [];
|
| 583 |
+
const seen = new Set();
|
| 584 |
+
document.querySelectorAll('ul#comix_pages_ul > li img').forEach(img => {
|
| 585 |
+
let src = img.getAttribute('data-src') || img.getAttribute('src');
|
| 586 |
+
if (src) {
|
| 587 |
+
try {
|
| 588 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 589 |
+
src = new URL(src, window.location.href).href;
|
| 590 |
+
}
|
| 591 |
+
} catch(e) {}
|
| 592 |
+
if (src.startsWith('http') && !seen.has(src)) {
|
| 593 |
+
seen.add(src);
|
| 594 |
+
results.push({
|
| 595 |
+
src: src,
|
| 596 |
+
width: img.naturalWidth || img.width || 0,
|
| 597 |
+
height: img.naturalHeight || img.height || 0,
|
| 598 |
+
inLink: false,
|
| 599 |
+
linkHref: null,
|
| 600 |
+
isKemonoThumb: false,
|
| 601 |
+
isDirectLink: true
|
| 602 |
+
});
|
| 603 |
+
}
|
| 604 |
+
}
|
| 605 |
+
});
|
| 606 |
+
if (results.length > 0) {
|
| 607 |
+
return results;
|
| 608 |
+
}
|
| 609 |
+
} catch (e) {
|
| 610 |
+
console.error("sexkomix parser error:", e);
|
| 611 |
+
}
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
const isNHentai = window.location.hostname.includes('nhentai.xxx') || window.location.hostname.includes('nhentai.net') || window.location.hostname.includes('nhentai.to');
|
| 615 |
+
if (isNHentai) {
|
| 616 |
+
try {
|
| 617 |
+
const g_th = window.g_th;
|
| 618 |
+
if (g_th) {
|
| 619 |
+
const g_th_fl = g_th.fl || g_th;
|
| 620 |
+
let baseUrl = '';
|
| 621 |
+
const mediaServer = window.media_server;
|
| 622 |
+
const imageDir = document.getElementById('image_dir')?.value;
|
| 623 |
+
const galleryId = document.getElementById('gallery_id')?.value;
|
| 624 |
+
if (mediaServer && imageDir && galleryId) {
|
| 625 |
+
baseUrl = `https://${mediaServer}/${imageDir}/${galleryId}`;
|
| 626 |
+
}
|
| 627 |
+
if (!baseUrl) {
|
| 628 |
+
const mainImg = document.querySelector('.fw_img img');
|
| 629 |
+
const mainSrc = mainImg ? (mainImg.getAttribute('data-src') || mainImg.getAttribute('src')) : null;
|
| 630 |
+
if (mainSrc && mainSrc.startsWith('http')) {
|
| 631 |
+
const lastSlash = mainSrc.lastIndexOf('/');
|
| 632 |
+
baseUrl = mainSrc.substring(0, lastSlash);
|
| 633 |
+
}
|
| 634 |
+
}
|
| 635 |
+
if (!baseUrl) {
|
| 636 |
+
const thumbImg = document.querySelector('.gallery_thumbs img, .gt_th img, #thumbs_append img');
|
| 637 |
+
const thumbSrc = thumbImg ? (thumbImg.getAttribute('data-src') || thumbImg.getAttribute('src')) : null;
|
| 638 |
+
if (thumbSrc && thumbSrc.startsWith('http')) {
|
| 639 |
+
const lastSlash = thumbSrc.lastIndexOf('/');
|
| 640 |
+
baseUrl = thumbSrc.substring(0, lastSlash);
|
| 641 |
+
}
|
| 642 |
+
}
|
| 643 |
+
if (baseUrl) {
|
| 644 |
+
const totalPages = Object.keys(g_th_fl).length;
|
| 645 |
+
const results = [];
|
| 646 |
+
for (let i = 1; i <= totalPages; i++) {
|
| 647 |
+
const pageData = g_th_fl[String(i)];
|
| 648 |
+
if (pageData) {
|
| 649 |
+
const parts = pageData.split(',');
|
| 650 |
+
const code = parts[0];
|
| 651 |
+
const w = parseInt(parts[1]) || 0;
|
| 652 |
+
const h = parseInt(parts[2]) || 0;
|
| 653 |
+
let ext = 'jpg';
|
| 654 |
+
if (code === 'w') ext = 'webp';
|
| 655 |
+
else if (code === 'p') ext = 'png';
|
| 656 |
+
else if (code === 'j') ext = 'jpg';
|
| 657 |
+
|
| 658 |
+
const src = `${baseUrl}/${i}.${ext}`;
|
| 659 |
+
results.push({
|
| 660 |
+
src: src,
|
| 661 |
+
width: w,
|
| 662 |
+
height: h,
|
| 663 |
+
inLink: false,
|
| 664 |
+
linkHref: null,
|
| 665 |
+
isKemonoThumb: false
|
| 666 |
+
});
|
| 667 |
+
}
|
| 668 |
+
}
|
| 669 |
+
if (results.length > 0) {
|
| 670 |
+
return results;
|
| 671 |
+
}
|
| 672 |
+
}
|
| 673 |
+
}
|
| 674 |
+
} catch (e) {
|
| 675 |
+
console.error("nhentai parser error:", e);
|
| 676 |
+
}
|
| 677 |
+
}
|
| 678 |
+
|
| 679 |
+
const is3Hentai = window.location.hostname.includes('3hentai.net');
|
| 680 |
+
if (is3Hentai) {
|
| 681 |
+
try {
|
| 682 |
+
const results = [];
|
| 683 |
+
const seen = new Set();
|
| 684 |
+
|
| 685 |
+
const readerPages = window.readerPages;
|
| 686 |
+
if (readerPages && readerPages.pages && readerPages.baseUriImg) {
|
| 687 |
+
const baseUriImg = readerPages.baseUriImg;
|
| 688 |
+
const totalPages = readerPages.lastPage || Object.keys(readerPages.pages).length;
|
| 689 |
+
|
| 690 |
+
for (let i = 1; i <= totalPages; i++) {
|
| 691 |
+
const pageData = readerPages.pages[String(i)];
|
| 692 |
+
if (pageData && pageData.f) {
|
| 693 |
+
const src = baseUriImg.replace('%s', pageData.f);
|
| 694 |
+
if (!seen.has(src)) {
|
| 695 |
+
seen.add(src);
|
| 696 |
+
results.push({
|
| 697 |
+
src: src,
|
| 698 |
+
width: pageData.w || 0,
|
| 699 |
+
height: pageData.h || 0,
|
| 700 |
+
inLink: false,
|
| 701 |
+
linkHref: null,
|
| 702 |
+
isKemonoThumb: false
|
| 703 |
+
});
|
| 704 |
+
}
|
| 705 |
+
}
|
| 706 |
+
}
|
| 707 |
+
}
|
| 708 |
+
|
| 709 |
+
if (results.length === 0) {
|
| 710 |
+
const thumbs = document.querySelectorAll('#thumbnail-gallery img, .single-thumb img, .single-thumb-col img');
|
| 711 |
+
thumbs.forEach(img => {
|
| 712 |
+
let src = img.getAttribute('data-src') || img.getAttribute('src');
|
| 713 |
+
if (src) {
|
| 714 |
+
try {
|
| 715 |
+
if (!src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 716 |
+
src = new URL(src, window.location.href).href;
|
| 717 |
+
}
|
| 718 |
+
} catch(e) {}
|
| 719 |
+
|
| 720 |
+
const match = src.match(/^(.*\/)(\d+)t\.(jpg|png|webp|jpeg|gif)$/i);
|
| 721 |
+
if (match) {
|
| 722 |
+
const base = match[1];
|
| 723 |
+
const pageNum = match[2];
|
| 724 |
+
const ext = match[3];
|
| 725 |
+
const fullSrc = `${base}${pageNum}.${ext}`;
|
| 726 |
+
|
| 727 |
+
if (!seen.has(fullSrc)) {
|
| 728 |
+
seen.add(fullSrc);
|
| 729 |
+
results.push({
|
| 730 |
+
src: fullSrc,
|
| 731 |
+
width: img.naturalWidth || img.width || 0,
|
| 732 |
+
height: img.naturalHeight || img.height || 0,
|
| 733 |
+
inLink: false,
|
| 734 |
+
linkHref: null,
|
| 735 |
+
isKemonoThumb: false
|
| 736 |
+
});
|
| 737 |
+
}
|
| 738 |
+
}
|
| 739 |
+
}
|
| 740 |
+
});
|
| 741 |
+
}
|
| 742 |
+
|
| 743 |
+
if (results.length > 0) {
|
| 744 |
+
return results;
|
| 745 |
+
}
|
| 746 |
+
} catch (e) {
|
| 747 |
+
console.error("3hentai parser error:", e);
|
| 748 |
+
}
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
+
const isHentaiera = window.location.hostname.includes('hentaiera.com') && window.location.pathname.includes('/view/');
|
| 752 |
+
if (isHentaiera) {
|
| 753 |
+
try {
|
| 754 |
+
const pagesInput = document.getElementById('pages');
|
| 755 |
+
const gimg = document.getElementById('gimg');
|
| 756 |
+
const g_th = window.g_th;
|
| 757 |
+
if (pagesInput && gimg && g_th) {
|
| 758 |
+
const totalPages = parseInt(pagesInput.value) || 0;
|
| 759 |
+
const firstImgSrc = gimg.src || gimg.getAttribute('data-src');
|
| 760 |
+
if (firstImgSrc && totalPages > 0) {
|
| 761 |
+
const lastSlashIdx = firstImgSrc.lastIndexOf('/');
|
| 762 |
+
const baseUrl = firstImgSrc.substring(0, lastSlashIdx);
|
| 763 |
+
const results = [];
|
| 764 |
+
for (let i = 1; i <= totalPages; i++) {
|
| 765 |
+
const pageData = g_th[String(i)];
|
| 766 |
+
if (pageData) {
|
| 767 |
+
const parts = pageData.split(',');
|
| 768 |
+
const code = parts[0];
|
| 769 |
+
const w = parseInt(parts[1]) || 0;
|
| 770 |
+
const h = parseInt(parts[2]) || 0;
|
| 771 |
+
let ext = 'jpg';
|
| 772 |
+
if (code === 'w') ext = 'webp';
|
| 773 |
+
else if (code === 'p') ext = 'png';
|
| 774 |
+
else if (code === 'j') ext = 'jpg';
|
| 775 |
+
|
| 776 |
+
const src = `${baseUrl}/${i}.${ext}`;
|
| 777 |
+
results.push({
|
| 778 |
+
src: src,
|
| 779 |
+
width: w,
|
| 780 |
+
height: h,
|
| 781 |
+
inLink: false,
|
| 782 |
+
linkHref: null,
|
| 783 |
+
isKemonoThumb: false
|
| 784 |
+
});
|
| 785 |
+
}
|
| 786 |
+
}
|
| 787 |
+
if (results.length > 0) {
|
| 788 |
+
return results;
|
| 789 |
+
}
|
| 790 |
+
}
|
| 791 |
+
}
|
| 792 |
+
} catch (e) {
|
| 793 |
+
console.error("Hentaiera parser error:", e);
|
| 794 |
+
}
|
| 795 |
+
}
|
| 796 |
+
|
| 797 |
+
const isHitomi = window.location.hostname.includes('hitomi.la');
|
| 798 |
+
if (isHitomi) {
|
| 799 |
+
try {
|
| 800 |
+
const match = window.location.href.match(/([0-9]+)\.html/);
|
| 801 |
+
if (match) {
|
| 802 |
+
const galleryId = match[1];
|
| 803 |
+
|
| 804 |
+
const loadScript = (src) => {
|
| 805 |
+
return new Promise((resolve, reject) => {
|
| 806 |
+
const script = document.createElement('script');
|
| 807 |
+
script.src = src;
|
| 808 |
+
script.onload = resolve;
|
| 809 |
+
script.onerror = () => reject(new Error(`Failed to load ${src}`));
|
| 810 |
+
(document.head || document.documentElement).appendChild(script);
|
| 811 |
+
});
|
| 812 |
+
};
|
| 813 |
+
|
| 814 |
+
if (typeof window.galleryinfo === 'undefined' || !window.galleryinfo || !window.galleryinfo.files) {
|
| 815 |
+
await loadScript(`https://ltn.hitomi.la/galleries/${galleryId}.js`);
|
| 816 |
+
}
|
| 817 |
+
if (typeof window.url_from_url_from_hash === 'undefined') {
|
| 818 |
+
await loadScript('https://ltn.hitomi.la/common.js');
|
| 819 |
+
}
|
| 820 |
+
if (typeof window.gg === 'undefined' || !window.gg || !window.gg.m || !window.gg.s || !window.gg.b) {
|
| 821 |
+
await loadScript('https://ltn.hitomi.la/gg.js');
|
| 822 |
+
}
|
| 823 |
+
|
| 824 |
+
if (window.galleryinfo && window.galleryinfo.files) {
|
| 825 |
+
const results = [];
|
| 826 |
+
window.galleryinfo.files.forEach((file) => {
|
| 827 |
+
let src = '';
|
| 828 |
+
try {
|
| 829 |
+
src = window.url_from_url_from_hash(galleryId, file, 'webp', undefined, undefined);
|
| 830 |
+
} catch (e) {
|
| 831 |
+
console.error("url_from_url_from_hash failed", e);
|
| 832 |
+
}
|
| 833 |
+
if (src) {
|
| 834 |
+
results.push({
|
| 835 |
+
src: src,
|
| 836 |
+
width: file.width || 0,
|
| 837 |
+
height: file.height || 0,
|
| 838 |
+
inLink: false,
|
| 839 |
+
linkHref: null,
|
| 840 |
+
isKemonoThumb: false
|
| 841 |
+
});
|
| 842 |
+
}
|
| 843 |
+
});
|
| 844 |
+
if (results.length > 0) {
|
| 845 |
+
return results;
|
| 846 |
+
}
|
| 847 |
+
}
|
| 848 |
+
}
|
| 849 |
+
} catch (e) {
|
| 850 |
+
console.error("Hitomi parser error:", e);
|
| 851 |
+
}
|
| 852 |
+
}
|
| 853 |
+
|
| 854 |
+
const results = [];
|
| 855 |
+
document.querySelectorAll('img').forEach(img => {
|
| 856 |
+
let p = img.parentElement, inLink = false, linkHref = null;
|
| 857 |
+
while(p && p.tagName !== 'BODY') {
|
| 858 |
+
if (p.tagName === 'A') { inLink = true; linkHref = p.href; break; }
|
| 859 |
+
p = p.parentElement;
|
| 860 |
+
}
|
| 861 |
+
let src = img.getAttribute('data-src') || img.getAttribute('data-lazy-src') || img.getAttribute('data-opt-src') || img.src;
|
| 862 |
+
|
| 863 |
+
try {
|
| 864 |
+
if (src && !src.startsWith('data:') && !src.startsWith('blob:')) {
|
| 865 |
+
src = new URL(src, window.location.href).href;
|
| 866 |
+
}
|
| 867 |
+
} catch(e) {}
|
| 868 |
+
|
| 869 |
+
if (src?.startsWith('http')) {
|
| 870 |
+
const isKemonoThumb = src.includes('kemono.') && src.includes('/thumbnail/data/');
|
| 871 |
+
results.push({ src, width: img.naturalWidth || 0, height: img.naturalHeight || 0, inLink, linkHref, isKemonoThumb });
|
| 872 |
+
}
|
| 873 |
+
});
|
| 874 |
+
|
| 875 |
+
document.querySelectorAll('.post__files a, .post__file a, .fileThumb, a[href*="kemono."]').forEach(a => {
|
| 876 |
+
if (a.href.match(/\.(jpg|jpeg|png|webp|gif|svg|avif|bmp|tiff|tif|ico|heic|heif|jxl)$/i)) {
|
| 877 |
+
results.push({ src: a.href, width: 0, height: 0, inLink: true, linkHref: a.href, isDirectLink: true });
|
| 878 |
+
}
|
| 879 |
+
});
|
| 880 |
+
return results;
|
| 881 |
+
}
|
ImageNinja HD/src/popup/modules/settings.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { DOM } from './state.js';
|
| 2 |
+
|
| 3 |
+
export function saveSettings() {
|
| 4 |
+
if (typeof chrome === 'undefined' || !chrome.storage) return;
|
| 5 |
+
const settings = {
|
| 6 |
+
filterUrl: DOM.filterUrl.value,
|
| 7 |
+
filterExt: DOM.filterExt.value,
|
| 8 |
+
minWidth: DOM.minWidth.value,
|
| 9 |
+
minHeight: DOM.minHeight.value,
|
| 10 |
+
forceHD: DOM.forceHD.checked,
|
| 11 |
+
separateQuality: DOM.separateQuality.checked,
|
| 12 |
+
renameSequential: DOM.renameSequential.checked,
|
| 13 |
+
smartComic: DOM.smartComic.checked,
|
| 14 |
+
forcePNG: DOM.forcePNG.checked,
|
| 15 |
+
subfolder: DOM.subfolderInput.value,
|
| 16 |
+
selectAll: DOM.selectAll.checked,
|
| 17 |
+
cleanBroken: DOM.cleanBrokenToggle ? DOM.cleanBrokenToggle.checked : false,
|
| 18 |
+
filtersCollapsed: DOM.collapsibleFilters ? DOM.collapsibleFilters.classList.contains('collapsed') : false
|
| 19 |
+
};
|
| 20 |
+
chrome.storage.local.set({ extensionSettings: settings });
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
export async function loadSettings() {
|
| 24 |
+
return new Promise((resolve) => {
|
| 25 |
+
if (typeof chrome === 'undefined' || !chrome.storage) return resolve();
|
| 26 |
+
chrome.storage.local.get(['extensionSettings'], (res) => {
|
| 27 |
+
const s = res.extensionSettings;
|
| 28 |
+
if (s) {
|
| 29 |
+
DOM.filterUrl.value = s.filterUrl || '';
|
| 30 |
+
DOM.filterExt.value = s.filterExt || 'all';
|
| 31 |
+
DOM.minWidth.value = s.minWidth ?? 0;
|
| 32 |
+
DOM.minWidthVal.value = s.minWidth ?? 0;
|
| 33 |
+
DOM.minHeight.value = s.minHeight ?? 0;
|
| 34 |
+
DOM.minHeightVal.value = s.minHeight ?? 0;
|
| 35 |
+
DOM.forceHD.checked = !!s.forceHD;
|
| 36 |
+
DOM.separateQuality.checked = !!s.separateQuality;
|
| 37 |
+
DOM.renameSequential.checked = s.renameSequential !== false; // Activo por defecto
|
| 38 |
+
DOM.smartComic.checked = s.smartComic !== false;
|
| 39 |
+
DOM.forcePNG.checked = !!s.forcePNG;
|
| 40 |
+
DOM.subfolderInput.value = s.subfolder || '';
|
| 41 |
+
DOM.selectAll.checked = !!s.selectAll;
|
| 42 |
+
if (DOM.cleanBrokenToggle) {
|
| 43 |
+
DOM.cleanBrokenToggle.checked = !!s.cleanBroken;
|
| 44 |
+
}
|
| 45 |
+
if (DOM.collapsibleFilters && s.filtersCollapsed) {
|
| 46 |
+
DOM.collapsibleFilters.classList.add('collapsed');
|
| 47 |
+
if (DOM.toggleFiltersBtn) {
|
| 48 |
+
DOM.toggleFiltersBtn.classList.add('collapsed');
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
resolve();
|
| 53 |
+
});
|
| 54 |
+
});
|
| 55 |
+
}
|
ImageNinja HD/src/popup/modules/state.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// --- ESTADO GLOBAL ---
|
| 2 |
+
export const state = {
|
| 3 |
+
allImages: [],
|
| 4 |
+
filteredImages: [],
|
| 5 |
+
selectedImages: new Set(),
|
| 6 |
+
lastSelectedIdx: -1,
|
| 7 |
+
isHDSearching: false,
|
| 8 |
+
downloadMap: new Map(),
|
| 9 |
+
isDragging: false,
|
| 10 |
+
dragMode: true,
|
| 11 |
+
dragStartIdx: -1,
|
| 12 |
+
dragSavedSelection: new Set()
|
| 13 |
+
};
|
| 14 |
+
|
| 15 |
+
// --- ELEMENTOS DEL DOM ---
|
| 16 |
+
export const DOM = {
|
| 17 |
+
grid: document.getElementById('imageGrid'),
|
| 18 |
+
filterUrl: document.getElementById('filterUrl'),
|
| 19 |
+
filterExt: document.getElementById('filterExt'),
|
| 20 |
+
minWidth: document.getElementById('minWidth'),
|
| 21 |
+
minWidthVal: document.getElementById('minWidthVal'),
|
| 22 |
+
minHeight: document.getElementById('minHeight'),
|
| 23 |
+
minHeightVal: document.getElementById('minHeightVal'),
|
| 24 |
+
forceHD: document.getElementById('forceHD'),
|
| 25 |
+
separateQuality: document.getElementById('separateQuality'),
|
| 26 |
+
renameSequential: document.getElementById('renameSequential'),
|
| 27 |
+
smartComic: document.getElementById('smartComic'),
|
| 28 |
+
forcePNG: document.getElementById('forcePNG'),
|
| 29 |
+
selectAll: document.getElementById('selectAll'),
|
| 30 |
+
selectedCount: document.getElementById('selectedCount'),
|
| 31 |
+
totalCount: document.getElementById('totalCount'),
|
| 32 |
+
downloadBtn: document.getElementById('downloadBtn'),
|
| 33 |
+
btnCounter: document.getElementById('btnCounter'),
|
| 34 |
+
fullscreenBtn: document.getElementById('fullscreenBtn'),
|
| 35 |
+
subfolderInput: document.getElementById('subfolder'),
|
| 36 |
+
cleanBrokenToggle: document.getElementById('cleanBrokenToggle'),
|
| 37 |
+
// Búsqueda Secuencial
|
| 38 |
+
toggleSeqBtn: document.getElementById('toggleSeqBtn'),
|
| 39 |
+
seqPanel: document.getElementById('seqPanel'),
|
| 40 |
+
seqUrlPattern: document.getElementById('seqUrlPattern'),
|
| 41 |
+
seqStart: document.getElementById('seqStart'),
|
| 42 |
+
seqEnd: document.getElementById('seqEnd'),
|
| 43 |
+
seqSelector: document.getElementById('seqSelector'),
|
| 44 |
+
seqStartBtn: document.getElementById('seqStartBtn'),
|
| 45 |
+
seqProgress: document.getElementById('seqProgress'),
|
| 46 |
+
seqProgressText: document.getElementById('seqProgressText'),
|
| 47 |
+
seqProgressStatus: document.getElementById('seqProgressStatus'),
|
| 48 |
+
seqProgressBar: document.getElementById('seqProgressBar'),
|
| 49 |
+
collapsibleFilters: document.getElementById('collapsibleFilters'),
|
| 50 |
+
toggleFiltersBtn: document.getElementById('toggleFiltersBtn')
|
| 51 |
+
};
|
ImageNinja HD/src/popup/popup.css
ADDED
|
@@ -0,0 +1,634 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
:root {
|
| 2 |
+
--bg-color: #0b0c10;
|
| 3 |
+
--surface-color: #12141a;
|
| 4 |
+
--border-color: #272a33;
|
| 5 |
+
--text-color: #c9d1d9;
|
| 6 |
+
--text-muted: #8b949e;
|
| 7 |
+
--accent-color: #e11d48; /* Rojo Carmesí */
|
| 8 |
+
--accent-hover: #be123c; /* Rojo Oscuro */
|
| 9 |
+
--danger-color: #f85149;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
min-width: 800px;
|
| 14 |
+
min-height: 560px;
|
| 15 |
+
width: 100vw;
|
| 16 |
+
height: 100vh;
|
| 17 |
+
margin: 0;
|
| 18 |
+
/* removed fixed sizes */
|
| 19 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
| 20 |
+
background-color: var(--bg-color);
|
| 21 |
+
color: var(--text-color);
|
| 22 |
+
display: flex;
|
| 23 |
+
flex-direction: column;
|
| 24 |
+
overflow: hidden;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
::-webkit-scrollbar { width: 8px; height: 8px; }
|
| 28 |
+
::-webkit-scrollbar-track { background: var(--bg-color); }
|
| 29 |
+
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
|
| 30 |
+
::-webkit-scrollbar-thumb:hover { background: #555; }
|
| 31 |
+
|
| 32 |
+
.header-panel {
|
| 33 |
+
padding: 10px 14px;
|
| 34 |
+
background: linear-gradient(180deg, var(--surface-color) 0%, var(--bg-color) 100%);
|
| 35 |
+
border-bottom: 1px solid var(--border-color);
|
| 36 |
+
display: flex;
|
| 37 |
+
flex-direction: column;
|
| 38 |
+
gap: 10px;
|
| 39 |
+
flex-shrink: 0;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.header-row {
|
| 43 |
+
display: grid;
|
| 44 |
+
grid-template-columns: 1fr 1fr;
|
| 45 |
+
gap: 14px;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.group-title {
|
| 49 |
+
font-size: 10px;
|
| 50 |
+
text-transform: uppercase;
|
| 51 |
+
letter-spacing: 0.5px;
|
| 52 |
+
color: var(--text-muted);
|
| 53 |
+
font-weight: 600;
|
| 54 |
+
margin-bottom: 4px;
|
| 55 |
+
display: flex;
|
| 56 |
+
align-items: center;
|
| 57 |
+
gap: 4px;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.info-icon {
|
| 61 |
+
background: rgba(255,255,255,0.1);
|
| 62 |
+
color: #fff;
|
| 63 |
+
border-radius: 50%;
|
| 64 |
+
width: 12px;
|
| 65 |
+
height: 12px;
|
| 66 |
+
display: inline-flex;
|
| 67 |
+
align-items: center;
|
| 68 |
+
justify-content: center;
|
| 69 |
+
font-size: 9px;
|
| 70 |
+
font-family: monospace;
|
| 71 |
+
font-weight: bold;
|
| 72 |
+
cursor: help;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
input[type="text"], input[type="number"], select {
|
| 76 |
+
background-color: rgba(255, 255, 255, 0.02);
|
| 77 |
+
color: var(--text-color);
|
| 78 |
+
border: 1px solid var(--border-color);
|
| 79 |
+
border-radius: 6px;
|
| 80 |
+
padding: 6px 8px;
|
| 81 |
+
font-size: 12px;
|
| 82 |
+
outline: none;
|
| 83 |
+
transition: all 0.2s;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
input[type="text"]:focus, input[type="number"]:focus, select:focus {
|
| 87 |
+
border-color: var(--accent-color);
|
| 88 |
+
background-color: rgba(225, 29, 72, 0.05); /* Rojo transparente */
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* Solucionar el menú desplegable blanco en Windows */
|
| 92 |
+
select option {
|
| 93 |
+
background-color: var(--surface-color);
|
| 94 |
+
color: var(--text-color);
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.flex-row { display: flex; gap: 6px; width: 100%; align-items: center; }
|
| 98 |
+
.flex-row input[type="text"] { flex-grow: 1; }
|
| 99 |
+
.flex-row select { width: 110px; }
|
| 100 |
+
|
| 101 |
+
.sliders-container {
|
| 102 |
+
display: flex;
|
| 103 |
+
gap: 8px;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.slider-box {
|
| 107 |
+
flex: 1;
|
| 108 |
+
display: flex;
|
| 109 |
+
align-items: center;
|
| 110 |
+
gap: 6px;
|
| 111 |
+
background: rgba(255,255,255,0.02);
|
| 112 |
+
padding: 4px 8px;
|
| 113 |
+
border-radius: 6px;
|
| 114 |
+
border: 1px solid var(--border-color);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
.slider-box span { font-size: 11px; color: var(--text-muted); font-weight: 500; }
|
| 118 |
+
.slider-box input[type="range"] { flex-grow: 1; height: 3px; accent-color: var(--accent-color); }
|
| 119 |
+
.slider-box input[type="number"] { width: 40px; padding: 2px; text-align: center; border: none; background: rgba(0,0,0,0.2); }
|
| 120 |
+
|
| 121 |
+
.options-grid {
|
| 122 |
+
display: grid;
|
| 123 |
+
grid-template-columns: 1fr 1fr;
|
| 124 |
+
gap: 8px;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
.custom-checkbox {
|
| 128 |
+
display: flex;
|
| 129 |
+
align-items: flex-start;
|
| 130 |
+
gap: 8px;
|
| 131 |
+
padding: 6px 8px;
|
| 132 |
+
background: rgba(255,255,255,0.02);
|
| 133 |
+
border: 1px solid var(--border-color);
|
| 134 |
+
border-radius: 6px;
|
| 135 |
+
cursor: pointer;
|
| 136 |
+
transition: all 0.2s;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.custom-checkbox:hover {
|
| 140 |
+
background: rgba(255,255,255,0.05);
|
| 141 |
+
border-color: #444c56;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
.custom-checkbox input[type="checkbox"] {
|
| 145 |
+
margin-top: 2px;
|
| 146 |
+
accent-color: var(--accent-color);
|
| 147 |
+
width: 13px;
|
| 148 |
+
height: 13px;
|
| 149 |
+
cursor: pointer;
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
.checkbox-text {
|
| 153 |
+
display: flex;
|
| 154 |
+
flex-direction: column;
|
| 155 |
+
gap: 1px;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.checkbox-text b { font-size: 11.5px; font-weight: 500; color: #fff; }
|
| 159 |
+
.checkbox-text small { font-size: 9.5px; color: var(--text-muted); line-height: 1.2; }
|
| 160 |
+
|
| 161 |
+
.select-bar {
|
| 162 |
+
margin-top: 0px;
|
| 163 |
+
padding-top: 8px;
|
| 164 |
+
border-top: 1px dashed var(--border-color);
|
| 165 |
+
display: flex;
|
| 166 |
+
align-items: center;
|
| 167 |
+
justify-content: space-between;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.select-all-label {
|
| 171 |
+
display: flex;
|
| 172 |
+
align-items: center;
|
| 173 |
+
gap: 8px;
|
| 174 |
+
font-size: 13px;
|
| 175 |
+
font-weight: 500;
|
| 176 |
+
cursor: pointer;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
.select-all-label input {
|
| 180 |
+
accent-color: var(--accent-color);
|
| 181 |
+
width: 16px;
|
| 182 |
+
height: 16px;
|
| 183 |
+
cursor: pointer;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
/* GRID DE IMÁGENES */
|
| 187 |
+
.grid-container {
|
| 188 |
+
flex-grow: 1;
|
| 189 |
+
overflow-y: auto;
|
| 190 |
+
padding: 14px;
|
| 191 |
+
display: grid;
|
| 192 |
+
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
|
| 193 |
+
grid-auto-rows: max-content;
|
| 194 |
+
align-content: start;
|
| 195 |
+
gap: 16px;
|
| 196 |
+
background-color: var(--bg-color);
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.image-card {
|
| 200 |
+
position: relative;
|
| 201 |
+
background-color: var(--surface-color);
|
| 202 |
+
border: 1px solid var(--border-color);
|
| 203 |
+
border-radius: 8px;
|
| 204 |
+
overflow: hidden;
|
| 205 |
+
display: flex;
|
| 206 |
+
flex-direction: column;
|
| 207 |
+
transition: all 0.2s;
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
.image-card.selected {
|
| 211 |
+
border-color: var(--accent-color);
|
| 212 |
+
box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.3); /* Resplandor rojo */
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.image-wrapper {
|
| 216 |
+
position: relative;
|
| 217 |
+
width: 100%;
|
| 218 |
+
aspect-ratio: 1 / 1.4;
|
| 219 |
+
background-color: rgba(0,0,0,0.5);
|
| 220 |
+
display: flex;
|
| 221 |
+
align-items: center;
|
| 222 |
+
justify-content: center;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.image-wrapper img {
|
| 226 |
+
max-width: 100%;
|
| 227 |
+
max-height: 100%;
|
| 228 |
+
object-fit: contain;
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
.card-checkbox {
|
| 232 |
+
position: absolute;
|
| 233 |
+
top: 8px;
|
| 234 |
+
left: 8px;
|
| 235 |
+
width: 20px;
|
| 236 |
+
height: 20px;
|
| 237 |
+
accent-color: var(--accent-color);
|
| 238 |
+
cursor: pointer;
|
| 239 |
+
z-index: 10;
|
| 240 |
+
background: rgba(0,0,0,0.6);
|
| 241 |
+
border-radius: 4px;
|
| 242 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.card-actions {
|
| 246 |
+
position: absolute;
|
| 247 |
+
top: 8px;
|
| 248 |
+
right: 8px;
|
| 249 |
+
display: flex;
|
| 250 |
+
gap: 6px;
|
| 251 |
+
background: rgba(0, 0, 0, 0.7);
|
| 252 |
+
padding: 4px;
|
| 253 |
+
border-radius: 6px;
|
| 254 |
+
z-index: 10;
|
| 255 |
+
backdrop-filter: blur(4px);
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
.icon-btn {
|
| 259 |
+
background: none;
|
| 260 |
+
border: none;
|
| 261 |
+
color: #fff;
|
| 262 |
+
cursor: pointer;
|
| 263 |
+
padding: 5px;
|
| 264 |
+
border-radius: 4px;
|
| 265 |
+
display: flex;
|
| 266 |
+
align-items: center;
|
| 267 |
+
justify-content: center;
|
| 268 |
+
transition: background 0.2s;
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.icon-btn:hover { background-color: rgba(255,255,255,0.2); }
|
| 272 |
+
.icon-btn svg {
|
| 273 |
+
width: 16px;
|
| 274 |
+
height: 16px;
|
| 275 |
+
fill: none;
|
| 276 |
+
stroke: currentColor;
|
| 277 |
+
stroke-width: 2;
|
| 278 |
+
stroke-linecap: round;
|
| 279 |
+
stroke-linejoin: round;
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
.card-info {
|
| 283 |
+
padding: 8px;
|
| 284 |
+
font-size: 11px;
|
| 285 |
+
color: var(--text-color);
|
| 286 |
+
display: flex;
|
| 287 |
+
flex-direction: column;
|
| 288 |
+
gap: 6px;
|
| 289 |
+
background: var(--surface-color);
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
.url-bar {
|
| 293 |
+
background: rgba(0,0,0,0.7);
|
| 294 |
+
padding: 5px;
|
| 295 |
+
position: absolute;
|
| 296 |
+
bottom: 0;
|
| 297 |
+
left: 0;
|
| 298 |
+
right: 0;
|
| 299 |
+
font-size: 10px;
|
| 300 |
+
color: #ddd;
|
| 301 |
+
white-space: nowrap;
|
| 302 |
+
overflow: hidden;
|
| 303 |
+
text-overflow: ellipsis;
|
| 304 |
+
backdrop-filter: blur(2px);
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
.footer {
|
| 308 |
+
padding: 14px 16px;
|
| 309 |
+
background-color: var(--surface-color);
|
| 310 |
+
border-top: 1px solid var(--border-color);
|
| 311 |
+
display: flex;
|
| 312 |
+
justify-content: space-between;
|
| 313 |
+
align-items: center;
|
| 314 |
+
gap: 12px;
|
| 315 |
+
flex-shrink: 0;
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
.footer-inputs {
|
| 319 |
+
display: flex;
|
| 320 |
+
gap: 5px;
|
| 321 |
+
flex-grow: 1;
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
.btn-download {
|
| 325 |
+
background-color: var(--accent-color);
|
| 326 |
+
color: #fff; /* Que se lea bien sobre el rojo */
|
| 327 |
+
border: none;
|
| 328 |
+
border-radius: 6px;
|
| 329 |
+
padding: 10px 16px;
|
| 330 |
+
font-size: 14px;
|
| 331 |
+
font-weight: 600;
|
| 332 |
+
cursor: pointer;
|
| 333 |
+
display: flex;
|
| 334 |
+
align-items: center;
|
| 335 |
+
gap: 8px;
|
| 336 |
+
white-space: nowrap;
|
| 337 |
+
transition: all 0.2s;
|
| 338 |
+
box-shadow: 0 4px 14px 0 rgba(225, 29, 72, 0.2); /* Sombra roja */
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.btn-download:hover {
|
| 342 |
+
background-color: var(--accent-hover);
|
| 343 |
+
transform: translateY(-1px);
|
| 344 |
+
}
|
| 345 |
+
.btn-download:disabled {
|
| 346 |
+
background-color: #30363d;
|
| 347 |
+
color: #8b949e;
|
| 348 |
+
cursor: not-allowed;
|
| 349 |
+
box-shadow: none;
|
| 350 |
+
transform: none;
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
.btn-clean {
|
| 354 |
+
background-color: rgba(255, 255, 255, 0.05);
|
| 355 |
+
border: 1px solid var(--border-color);
|
| 356 |
+
color: var(--text-muted);
|
| 357 |
+
border-radius: 4px;
|
| 358 |
+
padding: 4px 8px;
|
| 359 |
+
font-size: 11px;
|
| 360 |
+
cursor: pointer;
|
| 361 |
+
display: flex;
|
| 362 |
+
align-items: center;
|
| 363 |
+
gap: 4px;
|
| 364 |
+
transition: all 0.2s;
|
| 365 |
+
}
|
| 366 |
+
.btn-clean:hover {
|
| 367 |
+
background-color: rgba(225, 29, 72, 0.1);
|
| 368 |
+
border-color: var(--accent-color);
|
| 369 |
+
color: #fff;
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
.loader {
|
| 373 |
+
display: flex;
|
| 374 |
+
flex-direction: column;
|
| 375 |
+
align-items: center;
|
| 376 |
+
justify-content: center;
|
| 377 |
+
height: 100%;
|
| 378 |
+
color: var(--text-muted);
|
| 379 |
+
grid-column: span 4;
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
/* PANEL BÚSQUEDA SECUENCIAL */
|
| 383 |
+
.sequential-search-panel {
|
| 384 |
+
margin-top: 5px;
|
| 385 |
+
padding: 0 4px;
|
| 386 |
+
animation: slideDown 0.2s ease-out;
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
.seq-grid {
|
| 390 |
+
display: flex;
|
| 391 |
+
flex-direction: column;
|
| 392 |
+
gap: 8px;
|
| 393 |
+
background: rgba(255, 255, 255, 0.02);
|
| 394 |
+
border: 1px solid var(--border-color);
|
| 395 |
+
padding: 10px;
|
| 396 |
+
border-radius: 8px;
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
.seq-row-url {
|
| 400 |
+
display: flex;
|
| 401 |
+
width: 100%;
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
.seq-row-inputs {
|
| 405 |
+
display: flex;
|
| 406 |
+
gap: 8px;
|
| 407 |
+
align-items: center;
|
| 408 |
+
flex-wrap: wrap;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
.seq-input-box {
|
| 412 |
+
display: flex;
|
| 413 |
+
align-items: center;
|
| 414 |
+
gap: 6px;
|
| 415 |
+
font-size: 11px;
|
| 416 |
+
color: var(--text-muted);
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
.seq-input-box span {
|
| 420 |
+
white-space: nowrap;
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
.progress-bar-bg {
|
| 424 |
+
background: rgba(255, 255, 255, 0.08);
|
| 425 |
+
height: 6px;
|
| 426 |
+
border-radius: 3px;
|
| 427 |
+
overflow: hidden;
|
| 428 |
+
margin-top: 4px;
|
| 429 |
+
border: 1px solid rgba(255,255,255,0.02);
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
.progress-bar-fill {
|
| 433 |
+
background: linear-gradient(90deg, var(--accent-color) 0%, #ff527b 100%);
|
| 434 |
+
height: 100%;
|
| 435 |
+
width: 0%;
|
| 436 |
+
transition: width 0.25s ease-out;
|
| 437 |
+
box-shadow: 0 0 8px var(--accent-color);
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
@keyframes slideDown {
|
| 441 |
+
from { opacity: 0; transform: translateY(-8px); }
|
| 442 |
+
to { opacity: 1; transform: translateY(0); }
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
/* FILTROS COLAPSABLES */
|
| 446 |
+
.collapsible-filters {
|
| 447 |
+
max-height: 500px;
|
| 448 |
+
opacity: 1;
|
| 449 |
+
overflow: hidden;
|
| 450 |
+
transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
|
| 451 |
+
opacity 0.2s ease-in-out,
|
| 452 |
+
padding-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
.collapsible-filters.collapsed {
|
| 456 |
+
max-height: 0;
|
| 457 |
+
opacity: 0;
|
| 458 |
+
pointer-events: none;
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
#toggleFiltersBtn svg {
|
| 462 |
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
#toggleFiltersBtn.collapsed svg {
|
| 466 |
+
transform: rotate(180deg);
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
/* MANGA DETAILS VIEW DESIGN */
|
| 470 |
+
.manga-details-container {
|
| 471 |
+
display: flex;
|
| 472 |
+
flex-direction: column;
|
| 473 |
+
gap: 16px;
|
| 474 |
+
padding: 20px;
|
| 475 |
+
background: rgba(18, 20, 26, 0.6);
|
| 476 |
+
backdrop-filter: blur(10px);
|
| 477 |
+
border-radius: 12px;
|
| 478 |
+
border: 1px solid var(--border-color);
|
| 479 |
+
max-width: 740px;
|
| 480 |
+
margin: 10px auto;
|
| 481 |
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
| 482 |
+
animation: slideDown 0.3s ease-out;
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
.manga-details-header {
|
| 486 |
+
display: flex;
|
| 487 |
+
gap: 20px;
|
| 488 |
+
align-items: flex-start;
|
| 489 |
+
border-bottom: 1px solid var(--border-color);
|
| 490 |
+
padding-bottom: 16px;
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
.manga-details-cover {
|
| 494 |
+
width: 90px;
|
| 495 |
+
height: 120px;
|
| 496 |
+
object-fit: cover;
|
| 497 |
+
border-radius: 8px;
|
| 498 |
+
border: 1px solid var(--border-color);
|
| 499 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
|
| 500 |
+
background-color: var(--bg-color);
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
.manga-details-info {
|
| 504 |
+
display: flex;
|
| 505 |
+
flex-direction: column;
|
| 506 |
+
gap: 6px;
|
| 507 |
+
justify-content: center;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
.manga-details-title {
|
| 511 |
+
font-size: 18px;
|
| 512 |
+
font-weight: 700;
|
| 513 |
+
color: #ffffff;
|
| 514 |
+
margin: 0;
|
| 515 |
+
line-height: 1.3;
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
.manga-details-meta {
|
| 519 |
+
font-size: 13px;
|
| 520 |
+
color: var(--text-muted);
|
| 521 |
+
margin: 0;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
.manga-details-meta b {
|
| 525 |
+
color: var(--text-color);
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
.badge-madara {
|
| 529 |
+
align-self: flex-start;
|
| 530 |
+
background: rgba(225, 29, 72, 0.15);
|
| 531 |
+
color: var(--accent-color);
|
| 532 |
+
font-size: 10px;
|
| 533 |
+
font-weight: 700;
|
| 534 |
+
text-transform: uppercase;
|
| 535 |
+
padding: 3px 8px;
|
| 536 |
+
border-radius: 4px;
|
| 537 |
+
border: 1px solid rgba(225, 29, 72, 0.3);
|
| 538 |
+
margin-top: 4px;
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
.manga-chapters-title {
|
| 542 |
+
font-size: 13px;
|
| 543 |
+
font-weight: 600;
|
| 544 |
+
color: var(--text-muted);
|
| 545 |
+
text-transform: uppercase;
|
| 546 |
+
letter-spacing: 0.5px;
|
| 547 |
+
margin-bottom: 4px;
|
| 548 |
+
}
|
| 549 |
+
|
| 550 |
+
.manga-chapters-list {
|
| 551 |
+
display: flex;
|
| 552 |
+
flex-direction: column;
|
| 553 |
+
gap: 8px;
|
| 554 |
+
max-height: 280px;
|
| 555 |
+
overflow-y: auto;
|
| 556 |
+
padding-right: 4px;
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
.manga-chapter-item {
|
| 560 |
+
display: flex;
|
| 561 |
+
justify-content: space-between;
|
| 562 |
+
align-items: center;
|
| 563 |
+
padding: 10px 14px;
|
| 564 |
+
background: rgba(255, 255, 255, 0.02);
|
| 565 |
+
border: 1px solid var(--border-color);
|
| 566 |
+
border-radius: 8px;
|
| 567 |
+
transition: all 0.2s ease;
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
.manga-chapter-item:hover {
|
| 571 |
+
background: rgba(255, 255, 255, 0.04);
|
| 572 |
+
border-color: rgba(255, 255, 255, 0.1);
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
.chapter-name {
|
| 576 |
+
font-size: 13px;
|
| 577 |
+
font-weight: 500;
|
| 578 |
+
color: var(--text-color);
|
| 579 |
+
white-space: nowrap;
|
| 580 |
+
overflow: hidden;
|
| 581 |
+
text-overflow: ellipsis;
|
| 582 |
+
max-width: 320px;
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
.chapter-actions {
|
| 586 |
+
display: flex;
|
| 587 |
+
gap: 8px;
|
| 588 |
+
align-items: center;
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
.btn-chapter-download {
|
| 592 |
+
background: var(--accent-color);
|
| 593 |
+
color: white;
|
| 594 |
+
border: none;
|
| 595 |
+
border-radius: 6px;
|
| 596 |
+
padding: 6px 12px;
|
| 597 |
+
font-size: 11px;
|
| 598 |
+
font-weight: 600;
|
| 599 |
+
cursor: pointer;
|
| 600 |
+
transition: all 0.2s ease;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.btn-chapter-download:hover {
|
| 604 |
+
background: var(--accent-hover);
|
| 605 |
+
box-shadow: 0 0 10px rgba(225, 29, 72, 0.4);
|
| 606 |
+
}
|
| 607 |
+
|
| 608 |
+
.btn-chapter-download:disabled {
|
| 609 |
+
background: var(--border-color);
|
| 610 |
+
color: var(--text-muted);
|
| 611 |
+
cursor: not-allowed;
|
| 612 |
+
box-shadow: none;
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
.chapter-download-progress {
|
| 616 |
+
display: flex;
|
| 617 |
+
align-items: center;
|
| 618 |
+
gap: 10px;
|
| 619 |
+
min-width: 160px;
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
.chapter-download-progress .progress-bar-bg {
|
| 623 |
+
flex-grow: 1;
|
| 624 |
+
height: 4px;
|
| 625 |
+
margin-top: 0;
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
.chapter-download-progress .progress-text {
|
| 629 |
+
font-size: 10px;
|
| 630 |
+
color: var(--text-muted);
|
| 631 |
+
white-space: nowrap;
|
| 632 |
+
min-width: 65px;
|
| 633 |
+
text-align: right;
|
| 634 |
+
}
|
ImageNinja HD/src/popup/popup.html
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="es">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<link rel="stylesheet" href="popup.css">
|
| 6 |
+
</head>
|
| 7 |
+
<body>
|
| 8 |
+
|
| 9 |
+
<div class="header-panel">
|
| 10 |
+
|
| 11 |
+
<div class="collapsible-filters" id="collapsibleFilters">
|
| 12 |
+
<div class="header-row">
|
| 13 |
+
<!-- Filtros Principales -->
|
| 14 |
+
<div>
|
| 15 |
+
<div class="group-title">
|
| 16 |
+
Filtros de Contenido
|
| 17 |
+
<span class="info-icon" title="Usa un texto para buscar en las URLs o filtra por formato (jpg, png, etc.)">?</span>
|
| 18 |
+
</div>
|
| 19 |
+
<div class="flex-row">
|
| 20 |
+
<input type="text" id="filterUrl" placeholder="Buscar palabras clave en la URL..." title="Escribe palabras clave para filtrar imágenes" />
|
| 21 |
+
<select id="filterExt" title="Filtrar por extensión">
|
| 22 |
+
<option value="all">Formato: Todos</option>
|
| 23 |
+
<option value="jpg">Solo JPG</option>
|
| 24 |
+
<option value="jpeg">Solo JPEG</option>
|
| 25 |
+
<option value="png">Solo PNG</option>
|
| 26 |
+
<option value="webp">Solo WEBP</option>
|
| 27 |
+
<option value="gif">Solo GIF</option>
|
| 28 |
+
<option value="svg">Solo SVG</option>
|
| 29 |
+
<option value="avif">Solo AVIF</option>
|
| 30 |
+
<option value="bmp">Solo BMP</option>
|
| 31 |
+
<option value="tiff">Solo TIFF</option>
|
| 32 |
+
<option value="tif">Solo TIF</option>
|
| 33 |
+
<option value="ico">Solo ICO</option>
|
| 34 |
+
<option value="heic">Solo HEIC</option>
|
| 35 |
+
<option value="heif">Solo HEIF</option>
|
| 36 |
+
<option value="jxl">Solo JXL</option>
|
| 37 |
+
</select>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
<!-- Tamaño Mínimo -->
|
| 42 |
+
<div>
|
| 43 |
+
<div class="group-title">
|
| 44 |
+
Tamaño Mínimo Requerido
|
| 45 |
+
<span class="info-icon" title="Oculta logos pequeños, iconos y botones ajustando el tamaño mínimo.">?</span>
|
| 46 |
+
</div>
|
| 47 |
+
<div class="sliders-container">
|
| 48 |
+
<div class="slider-box" title="Filtra imágenes más pequeñas que este ancho">
|
| 49 |
+
<span>Ancho</span>
|
| 50 |
+
<input type="range" id="minWidth" min="0" max="2500" value="0" step="10">
|
| 51 |
+
<input type="number" id="minWidthVal" value="0">
|
| 52 |
+
</div>
|
| 53 |
+
<div class="slider-box" title="Filtra imágenes más pequeñas que este alto">
|
| 54 |
+
<span>Alto</span>
|
| 55 |
+
<input type="range" id="minHeight" min="0" max="2500" value="0" step="10">
|
| 56 |
+
<input type="number" id="minHeightVal" value="0">
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<!-- Opciones Avanzadas -->
|
| 63 |
+
<div>
|
| 64 |
+
<div class="options-grid">
|
| 65 |
+
<label class="custom-checkbox" title="Especial para galerías de Cómics: Abre las miniaturas en la sombra para atraparlas en Calidad Original.">
|
| 66 |
+
<input type="checkbox" id="forceHD">
|
| 67 |
+
<div class="checkbox-text">
|
| 68 |
+
<b>Forzar HD (Lhentai/Galerías)</b>
|
| 69 |
+
<small>Extracción profunda original</small>
|
| 70 |
+
</div>
|
| 71 |
+
</label>
|
| 72 |
+
|
| 73 |
+
<label class="custom-checkbox" title="Crea subcarpetas automáticas (4K, 1080p, etc.) según la resolución de cada imagen.">
|
| 74 |
+
<input type="checkbox" id="separateQuality">
|
| 75 |
+
<div class="checkbox-text">
|
| 76 |
+
<b>Separar por Calidad</b>
|
| 77 |
+
<small>Carpetas (4K, 1080p...)</small>
|
| 78 |
+
</div>
|
| 79 |
+
</label>
|
| 80 |
+
|
| 81 |
+
<label class="custom-checkbox" title="Renombra los archivos como pag_01, pag_02 de acuerdo a su orden en la página, ignorando el nombre original.">
|
| 82 |
+
<input type="checkbox" id="renameSequential" checked>
|
| 83 |
+
<div class="checkbox-text">
|
| 84 |
+
<b>Renombrar a "pag_X"</b>
|
| 85 |
+
<small>Ordena pag_01, pag_02...</small>
|
| 86 |
+
</div>
|
| 87 |
+
</label>
|
| 88 |
+
|
| 89 |
+
<label class="custom-checkbox" title="Modo Inteligente: Detecta y selecciona automáticamente solo las páginas del cómic, ignorando banners, menús y publicidad.">
|
| 90 |
+
<input type="checkbox" id="smartComic" checked>
|
| 91 |
+
<div class="checkbox-text">
|
| 92 |
+
<b>Modo Solo Cómic 🎯</b>
|
| 93 |
+
<small>Filtra logos y banners</small>
|
| 94 |
+
</div>
|
| 95 |
+
</label>
|
| 96 |
+
|
| 97 |
+
<label class="custom-checkbox" title="Convierte y descarga las imágenes en formato PNG (equivalente al guardado manual de Hitomi).">
|
| 98 |
+
<input type="checkbox" id="forcePNG">
|
| 99 |
+
<div class="checkbox-text">
|
| 100 |
+
<b>Forzar PNG (Formato Original)</b>
|
| 101 |
+
<small>Convierte WebP a PNG al descargar</small>
|
| 102 |
+
</div>
|
| 103 |
+
</label>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<!-- Panel Búsqueda Secuencial (Collapsible) -->
|
| 108 |
+
<div class="sequential-search-panel" id="seqPanel" style="display: none;">
|
| 109 |
+
<div class="group-title" style="margin-top: 5px;">
|
| 110 |
+
Búsqueda Secuencial por Paginación
|
| 111 |
+
<span class="info-icon" title="Carga secuencialmente múltiples páginas de un cómic cambiando el número de página en la URL. Usa {page} para definir dónde cambia el número.">?</span>
|
| 112 |
+
</div>
|
| 113 |
+
<div class="seq-grid">
|
| 114 |
+
<div class="seq-row-url">
|
| 115 |
+
<input type="text" id="seqUrlPattern" placeholder="URL con {page}, ej: https://hentaiera.com/view/1473007/{page}/" title="Usa {page} donde va el número de página" style="width: 100%;" />
|
| 116 |
+
</div>
|
| 117 |
+
<div class="seq-row-inputs">
|
| 118 |
+
<div class="seq-input-box">
|
| 119 |
+
<span>Desde:</span>
|
| 120 |
+
<input type="number" id="seqStart" value="1" min="1" style="width: 55px;" />
|
| 121 |
+
</div>
|
| 122 |
+
<div class="seq-input-box">
|
| 123 |
+
<span>Hasta:</span>
|
| 124 |
+
<input type="number" id="seqEnd" value="10" min="1" style="width: 55px;" />
|
| 125 |
+
</div>
|
| 126 |
+
<div class="seq-input-box" style="flex-grow: 1;">
|
| 127 |
+
<span>Selector CSS:</span>
|
| 128 |
+
<input type="text" id="seqSelector" value="#gimg, #image-container img, .fit-horizontal img, .gallery-image img, figure img, .post__content img" placeholder="Selector CSS del img" title="Opcional. Selectores de la imagen principal separados por comas." style="width: 100%;" />
|
| 129 |
+
</div>
|
| 130 |
+
<button id="seqStartBtn" class="btn-clean" style="height: 28px; padding: 0 12px; font-weight: bold; background: var(--accent-color); color: white; border: none; cursor: pointer;">Buscar</button>
|
| 131 |
+
</div>
|
| 132 |
+
<div id="seqProgress" style="display: none; font-size: 11px; color: var(--text-muted); margin-top: 4px;">
|
| 133 |
+
<div style="display: flex; justify-content: space-between; margin-bottom: 2px;">
|
| 134 |
+
<span>Progreso: <span id="seqProgressText">0/0</span></span>
|
| 135 |
+
<span id="seqProgressStatus" style="font-weight: 500;">Iniciando...</span>
|
| 136 |
+
</div>
|
| 137 |
+
<div class="progress-bar-bg"><div id="seqProgressBar" class="progress-bar-fill"></div></div>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<!-- Barra Inferior Cabecera -->
|
| 144 |
+
<div class="select-bar">
|
| 145 |
+
<label class="select-all-label">
|
| 146 |
+
<input type="checkbox" id="selectAll">
|
| 147 |
+
Seleccionar Todo (<span id="selectedCount">0</span> de <span id="totalCount">0</span>)
|
| 148 |
+
</label>
|
| 149 |
+
<div style="display: flex; gap: 8px; align-items: center;">
|
| 150 |
+
<button id="toggleFiltersBtn" class="btn-clean" title="Contraer/Expandir filtros" style="cursor: pointer; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;">
|
| 151 |
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="width: 16px; height: 16px; transition: transform 0.2s;"><polyline points="18 15 12 9 6 15"></polyline></svg>
|
| 152 |
+
</button>
|
| 153 |
+
<button id="toggleSeqBtn" class="btn-clean" title="Abrir panel de búsqueda secuencial para cómics paginados" style="cursor: pointer; display: flex; align-items: center; gap: 4px;">
|
| 154 |
+
🔄 Paginación
|
| 155 |
+
</button>
|
| 156 |
+
<label class="btn-clean" style="cursor: pointer;" title="Ocultar automáticamente imágenes que no cargan">
|
| 157 |
+
<input type="checkbox" id="cleanBrokenToggle" style="accent-color: var(--accent-color); margin: 0;">
|
| 158 |
+
Ocultar Rotas
|
| 159 |
+
</label>
|
| 160 |
+
<span style="font-size: 11px; color: var(--text-muted);">
|
| 161 |
+
Imágenes listas para guardar
|
| 162 |
+
</span>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
|
| 166 |
+
</div>
|
| 167 |
+
|
| 168 |
+
<div class="grid-container" id="imageGrid">
|
| 169 |
+
<div class="loader">
|
| 170 |
+
<h3 style="margin: 0;">Analizando página...</h3>
|
| 171 |
+
<p style="font-size: 13px;">Buscando imágenes disponibles</p>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
|
| 175 |
+
<div class="footer">
|
| 176 |
+
<div class="footer-inputs">
|
| 177 |
+
<!-- Botón Pantalla Completa -->
|
| 178 |
+
<button id="fullscreenBtn" class="icon-btn" title="Pantalla Completa" style="background: rgba(255,255,255,0.1); margin-right: 5px; padding: 0 10px; border-radius: 6px;">
|
| 179 |
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="fill: none; width: 18px; height: 18px; display: block;"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>
|
| 180 |
+
</button>
|
| 181 |
+
|
| 182 |
+
<!-- Input 100% de la subcarpeta -->
|
| 183 |
+
<input type="text" id="subfolder" placeholder="Ej: Dragon_Ball_Z_Caps" title="Se creará esta carpeta dentro de 'Descargas'. Déjalo vacío para 'comics_completos'" style="width: 100%;">
|
| 184 |
+
</div>
|
| 185 |
+
<button id="downloadBtn" class="btn-download" disabled>
|
| 186 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
| 187 |
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
| 188 |
+
<polyline points="7 10 12 15 17 10"></polyline>
|
| 189 |
+
<line x1="12" y1="15" x2="12" y2="3"></line>
|
| 190 |
+
</svg>
|
| 191 |
+
Descargar (<span id="btnCounter">0</span>)
|
| 192 |
+
</button>
|
| 193 |
+
</div>
|
| 194 |
+
|
| 195 |
+
<script type="module" src="popup.js"></script>
|
| 196 |
+
</body>
|
| 197 |
+
</html>
|
ImageNinja HD/src/popup/popup.js
ADDED
|
@@ -0,0 +1,813 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
import { loadSettings, saveSettings } from './modules/settings.js';
|
| 3 |
+
import { applyFilters, getExtension } from './modules/filters.js';
|
| 4 |
+
import { getImagesFromPageDOM } from './modules/scrapers.js';
|
| 5 |
+
import { downloadImage, getUniqueSubfolder } from './modules/downloader.js';
|
| 6 |
+
|
| 7 |
+
// --- INICIALIZACIÓN ---
|
| 8 |
+
document.addEventListener('DOMContentLoaded', async () => {
|
| 9 |
+
await loadSettings();
|
| 10 |
+
initListeners();
|
| 11 |
+
|
| 12 |
+
const params = new URLSearchParams(window.location.search);
|
| 13 |
+
const targetTabId = params.get('tabId');
|
| 14 |
+
let tab;
|
| 15 |
+
|
| 16 |
+
if (targetTabId) {
|
| 17 |
+
try {
|
| 18 |
+
tab = await chrome.tabs.get(parseInt(targetTabId));
|
| 19 |
+
DOM.fullscreenBtn.title = 'Minimizar a Ventana Flotante';
|
| 20 |
+
DOM.fullscreenBtn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="fill: none; width: 18px; height: 18px; display: block;"><path d="M8 3v3h-3m18 2h-3V5m-18 11h3v3m10 2v-3h3m-5-5l7-7M3 21l7-7"></path></svg>';
|
| 21 |
+
DOM.fullscreenBtn.onclick = () => window.close();
|
| 22 |
+
} catch(e) {
|
| 23 |
+
console.error("No se pudo obtener el tab original", e);
|
| 24 |
+
}
|
| 25 |
+
} else {
|
| 26 |
+
const tabs = await chrome.tabs.query({ active: true, currentWindow: true });
|
| 27 |
+
tab = tabs[0];
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!tab) return;
|
| 31 |
+
window.currentContextTabId = tab.id;
|
| 32 |
+
window.currentContextTabUrl = tab.url;
|
| 33 |
+
window.currentContextTabTitle = tab.title;
|
| 34 |
+
|
| 35 |
+
if (tab.url) {
|
| 36 |
+
let suggestedPattern = tab.url;
|
| 37 |
+
let suggestedStart = 1;
|
| 38 |
+
let suggestedEnd = 10;
|
| 39 |
+
|
| 40 |
+
if (tab.url.includes('hentaiera.com/view/')) {
|
| 41 |
+
suggestedPattern = tab.url.replace(/\/view\/(\d+)\/(\d+)\/?/, '/view/$1/{page}/');
|
| 42 |
+
suggestedStart = 1;
|
| 43 |
+
try {
|
| 44 |
+
chrome.scripting.executeScript({
|
| 45 |
+
target: { tabId: tab.id },
|
| 46 |
+
world: 'MAIN',
|
| 47 |
+
function: () => document.getElementById('pages')?.value || '15'
|
| 48 |
+
}, (res) => {
|
| 49 |
+
if (res?.[0]?.result) {
|
| 50 |
+
const pagesVal = parseInt(res[0].result);
|
| 51 |
+
if (pagesVal && DOM.seqEnd) DOM.seqEnd.value = pagesVal;
|
| 52 |
+
}
|
| 53 |
+
});
|
| 54 |
+
} catch (e) {}
|
| 55 |
+
} else {
|
| 56 |
+
const numRegex = /(\/|-|_|=)(\d+)(\/|\.html|\.htm|$|\?|&)/i;
|
| 57 |
+
const match = tab.url.match(numRegex);
|
| 58 |
+
if (match) {
|
| 59 |
+
suggestedPattern = tab.url.replace(numRegex, `$1{page}$3`);
|
| 60 |
+
suggestedStart = 1;
|
| 61 |
+
suggestedEnd = Math.max(10, parseInt(match[2]));
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
if (DOM.seqUrlPattern) {
|
| 66 |
+
DOM.seqUrlPattern.value = suggestedPattern;
|
| 67 |
+
DOM.seqStart.value = suggestedStart;
|
| 68 |
+
DOM.seqEnd.value = suggestedEnd;
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
const isHitomi = tab.url && tab.url.includes('hitomi.la');
|
| 73 |
+
const isHentaiera = tab.url && tab.url.includes('hentaiera.com') && tab.url.includes('/view/');
|
| 74 |
+
const isNHentai = tab.url && (tab.url.includes('nhentai.xxx') || tab.url.includes('nhentai.net') || tab.url.includes('nhentai.to'));
|
| 75 |
+
const is3Hentai = tab.url && tab.url.includes('3hentai.net');
|
| 76 |
+
const isVerComicsPorno = tab.url && tab.url.includes('vercomicsporno.com');
|
| 77 |
+
const isLectorHentai = tab.url && tab.url.includes('lectorhentai.com');
|
| 78 |
+
const isHentaiMode = tab.url && tab.url.includes('hentaimode.com');
|
| 79 |
+
if (isHitomi || isHentaiera || isNHentai || is3Hentai || isVerComicsPorno || isLectorHentai || isHentaiMode) {
|
| 80 |
+
DOM.forceHD.checked = false;
|
| 81 |
+
DOM.forceHD.disabled = true;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
try {
|
| 85 |
+
if (chrome.declarativeNetRequest && tab.url) {
|
| 86 |
+
await chrome.declarativeNetRequest.updateDynamicRules({
|
| 87 |
+
removeRuleIds: [999, 998, 997, 996, 995],
|
| 88 |
+
addRules: [
|
| 89 |
+
{
|
| 90 |
+
id: 999,
|
| 91 |
+
priority: 2,
|
| 92 |
+
action: {
|
| 93 |
+
type: "modifyHeaders",
|
| 94 |
+
requestHeaders: [
|
| 95 |
+
{ header: "Referer", operation: "set", value: tab.url },
|
| 96 |
+
{ header: "Origin", operation: "set", value: new URL(tab.url).origin }
|
| 97 |
+
],
|
| 98 |
+
responseHeaders: [
|
| 99 |
+
{ header: "Access-Control-Allow-Origin", operation: "set", value: "*" },
|
| 100 |
+
{ header: "Cross-Origin-Resource-Policy", operation: "remove" }
|
| 101 |
+
]
|
| 102 |
+
},
|
| 103 |
+
condition: {
|
| 104 |
+
urlFilter: new URL(tab.url).hostname.replace('www.', ''),
|
| 105 |
+
resourceTypes: ["image", "xmlhttprequest", "other", "main_frame", "sub_frame"]
|
| 106 |
+
}
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
id: 998,
|
| 110 |
+
priority: 2,
|
| 111 |
+
action: {
|
| 112 |
+
type: "modifyHeaders",
|
| 113 |
+
requestHeaders: [
|
| 114 |
+
{ header: "Referer", operation: "set", value: "https://hitomi.la/" },
|
| 115 |
+
{ header: "Origin", operation: "set", value: "https://hitomi.la" }
|
| 116 |
+
],
|
| 117 |
+
responseHeaders: [
|
| 118 |
+
{ header: "Access-Control-Allow-Origin", operation: "set", value: "*" },
|
| 119 |
+
{ header: "Cross-Origin-Resource-Policy", operation: "remove" }
|
| 120 |
+
]
|
| 121 |
+
},
|
| 122 |
+
condition: {
|
| 123 |
+
urlFilter: "gold-usergeneratedcontent.net",
|
| 124 |
+
resourceTypes: ["image", "xmlhttprequest", "other", "main_frame", "sub_frame"]
|
| 125 |
+
}
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
id: 997,
|
| 129 |
+
priority: 2,
|
| 130 |
+
action: {
|
| 131 |
+
type: "modifyHeaders",
|
| 132 |
+
requestHeaders: [
|
| 133 |
+
{ header: "Referer", operation: "set", value: tab.url },
|
| 134 |
+
{ header: "Origin", operation: "set", value: new URL(tab.url).origin }
|
| 135 |
+
],
|
| 136 |
+
responseHeaders: [
|
| 137 |
+
{ header: "Access-Control-Allow-Origin", operation: "set", value: "*" },
|
| 138 |
+
{ header: "Cross-Origin-Resource-Policy", operation: "remove" }
|
| 139 |
+
]
|
| 140 |
+
},
|
| 141 |
+
condition: {
|
| 142 |
+
urlFilter: "nhentaimg.com",
|
| 143 |
+
resourceTypes: ["image", "xmlhttprequest", "other", "main_frame", "sub_frame"]
|
| 144 |
+
}
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
id: 996,
|
| 148 |
+
priority: 2,
|
| 149 |
+
action: {
|
| 150 |
+
type: "modifyHeaders",
|
| 151 |
+
requestHeaders: [
|
| 152 |
+
{ header: "Referer", operation: "set", value: tab.url.includes('3hentai.net') ? tab.url : "https://3hentai.net/" },
|
| 153 |
+
{ header: "Origin", operation: "set", value: tab.url.includes('3hentai.net') ? new URL(tab.url).origin : "https://3hentai.net" }
|
| 154 |
+
],
|
| 155 |
+
responseHeaders: [
|
| 156 |
+
{ header: "Access-Control-Allow-Origin", operation: "set", value: "*" },
|
| 157 |
+
{ header: "Cross-Origin-Resource-Policy", operation: "remove" }
|
| 158 |
+
]
|
| 159 |
+
},
|
| 160 |
+
condition: {
|
| 161 |
+
urlFilter: "3hentai.xyz",
|
| 162 |
+
resourceTypes: ["image", "xmlhttprequest", "other", "main_frame", "sub_frame"]
|
| 163 |
+
}
|
| 164 |
+
},
|
| 165 |
+
{
|
| 166 |
+
id: 995,
|
| 167 |
+
priority: 2,
|
| 168 |
+
action: {
|
| 169 |
+
type: "modifyHeaders",
|
| 170 |
+
requestHeaders: [
|
| 171 |
+
{ header: "Referer", operation: "set", value: "https://lectorhentai.com/" },
|
| 172 |
+
{ header: "Origin", operation: "set", value: "https://lectorhentai.com" }
|
| 173 |
+
],
|
| 174 |
+
responseHeaders: [
|
| 175 |
+
{ header: "Access-Control-Allow-Origin", operation: "set", value: "*" },
|
| 176 |
+
{ header: "Cross-Origin-Resource-Policy", operation: "remove" }
|
| 177 |
+
]
|
| 178 |
+
},
|
| 179 |
+
condition: {
|
| 180 |
+
urlFilter: "giolandscaping.com",
|
| 181 |
+
resourceTypes: ["image", "xmlhttprequest", "other", "main_frame", "sub_frame"]
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
]
|
| 185 |
+
});
|
| 186 |
+
}
|
| 187 |
+
} catch (e) {
|
| 188 |
+
console.error("Dynamic DNR failed", e);
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
chrome.scripting.executeScript({
|
| 192 |
+
target: { tabId: tab.id },
|
| 193 |
+
world: (isHitomi || isHentaiera || isNHentai || is3Hentai || isLectorHentai || isHentaiMode) ? 'MAIN' : 'ISOLATED',
|
| 194 |
+
function: getImagesFromPageDOM,
|
| 195 |
+
}, (results) => {
|
| 196 |
+
if (chrome.runtime.lastError || !results?.[0]?.result) {
|
| 197 |
+
DOM.grid.innerHTML = '<div class="loader"><p style="color: var(--danger-color)">Error al obtener imágenes.</p></div>';
|
| 198 |
+
return;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
const res = results[0].result;
|
| 202 |
+
|
| 203 |
+
const uniqueMap = new Map();
|
| 204 |
+
res.forEach(img => {
|
| 205 |
+
if (!uniqueMap.has(img.src) && img.src.startsWith('http')) {
|
| 206 |
+
uniqueMap.set(img.src, img);
|
| 207 |
+
}
|
| 208 |
+
});
|
| 209 |
+
|
| 210 |
+
state.allImages = Array.from(uniqueMap.values());
|
| 211 |
+
if (DOM.selectAll.checked) {
|
| 212 |
+
state.allImages.forEach(img => state.selectedImages.add(img.src));
|
| 213 |
+
}
|
| 214 |
+
applyFilters();
|
| 215 |
+
|
| 216 |
+
if (DOM.forceHD.checked) {
|
| 217 |
+
updateHDUrls();
|
| 218 |
+
}
|
| 219 |
+
});
|
| 220 |
+
|
| 221 |
+
// Check if background is currently downloading
|
| 222 |
+
if (window.currentContextTabUrl) {
|
| 223 |
+
chrome.runtime.sendMessage({ action: 'getDownloadProgress', comicUrl: window.currentContextTabUrl }, (resp) => {
|
| 224 |
+
if (resp && resp.downloading) {
|
| 225 |
+
showDownloadingState(resp.completed, resp.total);
|
| 226 |
+
}
|
| 227 |
+
});
|
| 228 |
+
}
|
| 229 |
+
});
|
| 230 |
+
|
| 231 |
+
function initListeners() {
|
| 232 |
+
const handleSizeInput = (slider, valBox) => {
|
| 233 |
+
valBox.value = slider.value;
|
| 234 |
+
applyFilters();
|
| 235 |
+
if (DOM.forceHD.checked) updateHDUrls();
|
| 236 |
+
saveSettings();
|
| 237 |
+
};
|
| 238 |
+
|
| 239 |
+
DOM.minWidth.addEventListener('input', () => handleSizeInput(DOM.minWidth, DOM.minWidthVal));
|
| 240 |
+
DOM.minHeight.addEventListener('input', () => handleSizeInput(DOM.minHeight, DOM.minHeightVal));
|
| 241 |
+
DOM.minWidthVal.addEventListener('input', () => { DOM.minWidth.value = DOM.minWidthVal.value; applyFilters(); saveSettings(); });
|
| 242 |
+
DOM.minHeightVal.addEventListener('input', () => { DOM.minHeight.value = DOM.minHeightVal.value; applyFilters(); saveSettings(); });
|
| 243 |
+
|
| 244 |
+
DOM.minWidth.addEventListener('change', saveSettings);
|
| 245 |
+
DOM.minHeight.addEventListener('change', saveSettings);
|
| 246 |
+
|
| 247 |
+
DOM.filterUrl.addEventListener('input', () => { applyFilters(); saveSettings(); });
|
| 248 |
+
DOM.filterExt.addEventListener('change', () => { applyFilters(); saveSettings(); });
|
| 249 |
+
DOM.forceHD.addEventListener('change', () => { updateHDUrls(); saveSettings(); });
|
| 250 |
+
DOM.separateQuality.addEventListener('change', saveSettings);
|
| 251 |
+
DOM.renameSequential.addEventListener('change', saveSettings);
|
| 252 |
+
DOM.smartComic.addEventListener('change', () => { applyFilters(); saveSettings(); });
|
| 253 |
+
DOM.forcePNG.addEventListener('change', saveSettings);
|
| 254 |
+
DOM.subfolderInput.addEventListener('input', saveSettings);
|
| 255 |
+
|
| 256 |
+
DOM.selectAll.addEventListener('change', (e) => {
|
| 257 |
+
if (e.target.checked) {
|
| 258 |
+
state.filteredImages.forEach(img => state.selectedImages.add(img.src));
|
| 259 |
+
} else {
|
| 260 |
+
state.selectedImages.clear();
|
| 261 |
+
}
|
| 262 |
+
updateSelectionVisuals();
|
| 263 |
+
saveSettings();
|
| 264 |
+
});
|
| 265 |
+
|
| 266 |
+
DOM.downloadBtn.addEventListener('click', async () => {
|
| 267 |
+
const toDownload = state.filteredImages.filter(img => state.selectedImages.has(img.src));
|
| 268 |
+
if (toDownload.length === 0) return;
|
| 269 |
+
|
| 270 |
+
const baseSf = DOM.subfolderInput.value.trim().replace(/[\\:*?"<>|]/g, "") || (window.currentContextTabTitle ? window.currentContextTabTitle.replace(/[\\:*?"<>|]/g, "").trim().slice(0, 80) : 'comics_completos');
|
| 271 |
+
const uniqueSf = await getUniqueSubfolder(baseSf);
|
| 272 |
+
|
| 273 |
+
const is3Hentai = window.currentContextTabUrl && window.currentContextTabUrl.includes('3hentai.net');
|
| 274 |
+
|
| 275 |
+
if (is3Hentai) {
|
| 276 |
+
chrome.runtime.sendMessage({
|
| 277 |
+
action: 'startBackgroundDownloads',
|
| 278 |
+
toDownload,
|
| 279 |
+
baseSf,
|
| 280 |
+
uniqueSf,
|
| 281 |
+
is3Hentai,
|
| 282 |
+
isForcePNG: DOM.forcePNG && DOM.forcePNG.checked,
|
| 283 |
+
separateQuality: DOM.separateQuality && DOM.separateQuality.checked,
|
| 284 |
+
renameSequential: DOM.renameSequential && DOM.renameSequential.checked,
|
| 285 |
+
comicUrl: window.currentContextTabUrl
|
| 286 |
+
}, () => {
|
| 287 |
+
showDownloadingState(0, toDownload.length);
|
| 288 |
+
});
|
| 289 |
+
} else {
|
| 290 |
+
// Original parallel behavior
|
| 291 |
+
toDownload.forEach((img, idx) => downloadImage(img, idx, toDownload.length, uniqueSf));
|
| 292 |
+
}
|
| 293 |
+
});
|
| 294 |
+
|
| 295 |
+
if (DOM.fullscreenBtn) {
|
| 296 |
+
DOM.fullscreenBtn.addEventListener('click', () => {
|
| 297 |
+
const params = new URLSearchParams(window.location.search);
|
| 298 |
+
if (!params.has('tabId') && window.currentContextTabId) {
|
| 299 |
+
chrome.tabs.create({ url: chrome.runtime.getURL('popup.html?tabId=' + window.currentContextTabId) });
|
| 300 |
+
}
|
| 301 |
+
});
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
window.addEventListener('mouseup', () => state.isDragging = false);
|
| 305 |
+
window.addEventListener('mouseleave', () => state.isDragging = false);
|
| 306 |
+
|
| 307 |
+
if (DOM.cleanBrokenToggle) {
|
| 308 |
+
DOM.cleanBrokenToggle.addEventListener('change', () => {
|
| 309 |
+
applyFilters();
|
| 310 |
+
saveSettings();
|
| 311 |
+
});
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
if (DOM.toggleFiltersBtn) {
|
| 315 |
+
if (DOM.toggleFiltersBtn.classList.contains('collapsed')) {
|
| 316 |
+
DOM.toggleFiltersBtn.title = "Expandir filtros";
|
| 317 |
+
} else {
|
| 318 |
+
DOM.toggleFiltersBtn.title = "Contraer filtros";
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
DOM.toggleFiltersBtn.addEventListener('click', () => {
|
| 322 |
+
const isCollapsed = DOM.collapsibleFilters.classList.toggle('collapsed');
|
| 323 |
+
DOM.toggleFiltersBtn.classList.toggle('collapsed', isCollapsed);
|
| 324 |
+
DOM.toggleFiltersBtn.title = isCollapsed ? "Expandir filtros" : "Contraer filtros";
|
| 325 |
+
saveSettings();
|
| 326 |
+
});
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
if (DOM.toggleSeqBtn) {
|
| 330 |
+
DOM.toggleSeqBtn.addEventListener('click', () => {
|
| 331 |
+
if (DOM.seqPanel.style.display === 'none') {
|
| 332 |
+
DOM.seqPanel.style.display = 'block';
|
| 333 |
+
DOM.toggleSeqBtn.style.backgroundColor = 'rgba(225, 29, 72, 0.15)';
|
| 334 |
+
DOM.toggleSeqBtn.style.borderColor = 'var(--accent-color)';
|
| 335 |
+
DOM.toggleSeqBtn.style.color = '#fff';
|
| 336 |
+
} else {
|
| 337 |
+
DOM.seqPanel.style.display = 'none';
|
| 338 |
+
DOM.toggleSeqBtn.style.backgroundColor = '';
|
| 339 |
+
DOM.toggleSeqBtn.style.borderColor = '';
|
| 340 |
+
DOM.toggleSeqBtn.style.color = '';
|
| 341 |
+
}
|
| 342 |
+
});
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
if (DOM.seqStartBtn) {
|
| 346 |
+
DOM.seqStartBtn.addEventListener('click', startSequentialSearch);
|
| 347 |
+
}
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
async function updateHDUrls() {
|
| 351 |
+
const isHitomi = window.currentContextTabUrl && window.currentContextTabUrl.includes('hitomi.la');
|
| 352 |
+
const isHentaiera = window.currentContextTabUrl && window.currentContextTabUrl.includes('hentaiera.com');
|
| 353 |
+
const isNHentai = window.currentContextTabUrl && (window.currentContextTabUrl.includes('nhentai.xxx') || window.currentContextTabUrl.includes('nhentai.net') || window.currentContextTabUrl.includes('nhentai.to'));
|
| 354 |
+
const is3Hentai = window.currentContextTabUrl && window.currentContextTabUrl.includes('3hentai.net');
|
| 355 |
+
const isVerComicsPorno = window.currentContextTabUrl && window.currentContextTabUrl.includes('vercomicsporno.com');
|
| 356 |
+
if (isHitomi || isHentaiera || isNHentai || is3Hentai || isVerComicsPorno) {
|
| 357 |
+
DOM.forceHD.checked = false;
|
| 358 |
+
DOM.forceHD.disabled = true;
|
| 359 |
+
return;
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
if (!DOM.forceHD.checked) {
|
| 363 |
+
state.allImages.forEach(img => {
|
| 364 |
+
if (img.originalSrc) {
|
| 365 |
+
img.src = img.originalSrc;
|
| 366 |
+
img.width = img.origWidth;
|
| 367 |
+
img.height = img.origHeight;
|
| 368 |
+
}
|
| 369 |
+
img.hdSearching = false;
|
| 370 |
+
img.hdFound = false;
|
| 371 |
+
});
|
| 372 |
+
applyFilters();
|
| 373 |
+
return;
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
state.allImages.forEach(img => {
|
| 377 |
+
if (!img.originalSrc) {
|
| 378 |
+
img.originalSrc = img.src;
|
| 379 |
+
img.origWidth = img.width;
|
| 380 |
+
img.origHeight = img.height;
|
| 381 |
+
}
|
| 382 |
+
});
|
| 383 |
+
|
| 384 |
+
state.filteredImages.forEach(img => {
|
| 385 |
+
if (img.inLink && img.linkHref && !img.hdFound && !img.hdSearching) {
|
| 386 |
+
img.hdSearching = true;
|
| 387 |
+
}
|
| 388 |
+
if (!img.hdFound && img.src.includes('kemono.') && img.src.includes('/thumbnail/data/')) {
|
| 389 |
+
img.src = img.src.replace('/thumbnail/data/', '/data/');
|
| 390 |
+
img.linkHref = img.src;
|
| 391 |
+
img.hdSearching = true;
|
| 392 |
+
}
|
| 393 |
+
});
|
| 394 |
+
|
| 395 |
+
render();
|
| 396 |
+
|
| 397 |
+
let queue = state.filteredImages.map((img, idx) => ({img, idx})).filter(x => x.img.hdSearching);
|
| 398 |
+
const limit = 5;
|
| 399 |
+
let active = 0;
|
| 400 |
+
|
| 401 |
+
await new Promise(resolve => {
|
| 402 |
+
if (queue.length === 0) return resolve();
|
| 403 |
+
|
| 404 |
+
const processNext = async () => {
|
| 405 |
+
if (queue.length === 0 && active === 0) return resolve();
|
| 406 |
+
|
| 407 |
+
while (active < limit && queue.length > 0) {
|
| 408 |
+
active++;
|
| 409 |
+
const {img, idx} = queue.shift();
|
| 410 |
+
|
| 411 |
+
try {
|
| 412 |
+
const resp = await fetch(img.linkHref);
|
| 413 |
+
const html = await resp.text();
|
| 414 |
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
| 415 |
+
|
| 416 |
+
let foundSrc = doc.querySelector('#image-container img, .fit-horizontal img, #gimg, .gallery-image img, figure img, .post__content img')?.getAttribute('src');
|
| 417 |
+
|
| 418 |
+
if (!foundSrc && img.linkHref.match(/\.(jpg|jpeg|png|webp|gif|svg|avif|bmp|tiff|tif|ico|heic|heif|jxl)$/i)) foundSrc = img.linkHref;
|
| 419 |
+
|
| 420 |
+
if (!foundSrc) {
|
| 421 |
+
const folder = (new URL(img.originalSrc)).pathname.split('/').slice(0,-1).join('/');
|
| 422 |
+
foundSrc = Array.from(doc.querySelectorAll('img'))
|
| 423 |
+
.map(i => i.getAttribute('src'))
|
| 424 |
+
.find(s => s?.includes(folder) && !s.match(/t\.(jpg|jpeg|png|webp|gif|svg|avif|bmp|tiff|tif|ico|heic|heif|jxl)$/i) && !s.includes('logo'));
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
if (foundSrc) {
|
| 428 |
+
const fullUrl = foundSrc.startsWith('http') ? foundSrc : new URL(foundSrc, img.linkHref).href;
|
| 429 |
+
img.src = fullUrl;
|
| 430 |
+
await new Promise(r => {
|
| 431 |
+
const t = new Image();
|
| 432 |
+
t.onload = () => { img.width = t.naturalWidth; img.height = t.naturalHeight; img.hdFound = true; r(); };
|
| 433 |
+
t.onerror = r;
|
| 434 |
+
t.src = fullUrl;
|
| 435 |
+
});
|
| 436 |
+
}
|
| 437 |
+
} catch {}
|
| 438 |
+
|
| 439 |
+
img.hdSearching = false;
|
| 440 |
+
updateCardForHD(idx);
|
| 441 |
+
active--;
|
| 442 |
+
processNext();
|
| 443 |
+
}
|
| 444 |
+
};
|
| 445 |
+
processNext();
|
| 446 |
+
});
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
function updateCardForHD(idx) {
|
| 450 |
+
const cards = DOM.grid.querySelectorAll('.image-card');
|
| 451 |
+
const card = cards[idx];
|
| 452 |
+
if (!card) return;
|
| 453 |
+
const img = state.filteredImages[idx];
|
| 454 |
+
|
| 455 |
+
let info = `${img.width} × ${img.height}`;
|
| 456 |
+
let style = '';
|
| 457 |
+
if (DOM.forceHD.checked) {
|
| 458 |
+
if (img.hdSearching) { info = '🔎 Buscando...'; style = 'color: #f39c12; font-size: 11px;'; }
|
| 459 |
+
else if (img.hdFound) { info = `🌟 HD: ${img.width}×${img.height}`; style = 'color: #2ecc71; font-weight: bold;'; }
|
| 460 |
+
else { info = '❌ Normal'; style = 'color: #e74c3c; font-size: 11px;'; }
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
const span = card.querySelector('.card-info span');
|
| 464 |
+
if (span) {
|
| 465 |
+
span.innerHTML = info;
|
| 466 |
+
span.setAttribute('style', style);
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
if (img.hdFound) {
|
| 470 |
+
const imgEl = card.querySelector('.image-wrapper img');
|
| 471 |
+
if (imgEl && imgEl.src !== img.src) imgEl.src = img.src;
|
| 472 |
+
const urlBar = card.querySelector('.url-bar');
|
| 473 |
+
if (urlBar && urlBar.textContent !== img.src) urlBar.textContent = img.src;
|
| 474 |
+
}
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
export function render() {
|
| 478 |
+
const scroll = DOM.grid.scrollTop;
|
| 479 |
+
DOM.grid.innerHTML = '';
|
| 480 |
+
|
| 481 |
+
if (state.filteredImages.length === 0) {
|
| 482 |
+
DOM.grid.innerHTML = '<div class="loader"><p>No se encontraron imágenes.</p></div>';
|
| 483 |
+
} else {
|
| 484 |
+
state.filteredImages.forEach((img, idx) => {
|
| 485 |
+
const isSelected = state.selectedImages.has(img.src);
|
| 486 |
+
const card = document.createElement('div');
|
| 487 |
+
card.className = `image-card ${isSelected ? 'selected' : ''}`;
|
| 488 |
+
|
| 489 |
+
let info = `${img.width} × ${img.height}`;
|
| 490 |
+
let style = '';
|
| 491 |
+
if (DOM.forceHD.checked) {
|
| 492 |
+
if (img.hdSearching) { info = '🔎 Buscando...'; style = 'color: #f39c12; font-size: 11px;'; }
|
| 493 |
+
else if (img.hdFound) { info = `🌟 HD: ${img.width}×${img.height}`; style = 'color: #2ecc71; font-weight: bold;'; }
|
| 494 |
+
else { info = '❌ Normal'; style = 'color: #e74c3c; font-size: 11px;'; }
|
| 495 |
+
}
|
| 496 |
+
|
| 497 |
+
card.innerHTML = `
|
| 498 |
+
<input type="checkbox" class="card-checkbox" ${isSelected ? 'checked' : ''}>
|
| 499 |
+
<div class="card-actions">
|
| 500 |
+
<button class="icon-btn btn-ext"><svg viewBox="0 0 24 24"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg></button>
|
| 501 |
+
<button class="icon-btn btn-dl"><svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></button>
|
| 502 |
+
</div>
|
| 503 |
+
<div class="image-wrapper"><img src="${img.src}" loading="lazy" /><div class="url-bar">${img.src}</div></div>
|
| 504 |
+
<div class="card-info"><span style="${style}">${info}</span></div>
|
| 505 |
+
`;
|
| 506 |
+
|
| 507 |
+
card.querySelector('.btn-ext').onclick = (e) => { e.stopPropagation(); chrome.tabs.create({ url: img.src }); };
|
| 508 |
+
card.querySelector('.btn-dl').onclick = async (e) => {
|
| 509 |
+
e.stopPropagation();
|
| 510 |
+
const baseSf = DOM.subfolderInput.value.trim().replace(/[\\:*?"<>|]/g, "") || (window.currentContextTabTitle ? window.currentContextTabTitle.replace(/[\\:*?"<>|]/g, "").trim().slice(0, 80) : 'comics_completos');
|
| 511 |
+
const uniqueSf = await getUniqueSubfolder(baseSf);
|
| 512 |
+
downloadImage(img, idx, state.filteredImages.length, uniqueSf);
|
| 513 |
+
};
|
| 514 |
+
|
| 515 |
+
const imgEl = card.querySelector('img');
|
| 516 |
+
imgEl.addEventListener('dragstart', (e) => e.preventDefault());
|
| 517 |
+
imgEl.addEventListener('error', () => {
|
| 518 |
+
img.isBroken = true;
|
| 519 |
+
if (DOM.cleanBrokenToggle && DOM.cleanBrokenToggle.checked) {
|
| 520 |
+
card.style.display = 'none';
|
| 521 |
+
state.selectedImages.delete(img.src);
|
| 522 |
+
updateSelectionVisuals();
|
| 523 |
+
}
|
| 524 |
+
});
|
| 525 |
+
|
| 526 |
+
card.addEventListener('mousedown', (e) => {
|
| 527 |
+
if (e.target.closest('.card-actions')) return;
|
| 528 |
+
e.preventDefault();
|
| 529 |
+
if (e.shiftKey) {
|
| 530 |
+
toggleSelection(idx, true);
|
| 531 |
+
} else {
|
| 532 |
+
state.isDragging = true;
|
| 533 |
+
state.dragStartIdx = idx;
|
| 534 |
+
state.dragMode = !state.selectedImages.has(img.src);
|
| 535 |
+
state.dragSavedSelection = new Set(state.selectedImages);
|
| 536 |
+
updateDragSelection(idx);
|
| 537 |
+
}
|
| 538 |
+
});
|
| 539 |
+
|
| 540 |
+
card.addEventListener('mouseenter', (e) => {
|
| 541 |
+
if (state.isDragging) {
|
| 542 |
+
updateDragSelection(idx);
|
| 543 |
+
}
|
| 544 |
+
});
|
| 545 |
+
|
| 546 |
+
DOM.grid.appendChild(card);
|
| 547 |
+
});
|
| 548 |
+
}
|
| 549 |
+
|
| 550 |
+
updateSelectionVisuals();
|
| 551 |
+
DOM.grid.scrollTop = scroll;
|
| 552 |
+
}
|
| 553 |
+
|
| 554 |
+
function updateSelectionVisuals() {
|
| 555 |
+
const cards = DOM.grid.querySelectorAll('.image-card');
|
| 556 |
+
state.filteredImages.forEach((img, idx) => {
|
| 557 |
+
const isSelected = state.selectedImages.has(img.src);
|
| 558 |
+
const card = cards[idx];
|
| 559 |
+
if (card) {
|
| 560 |
+
if (isSelected) card.classList.add('selected');
|
| 561 |
+
else card.classList.remove('selected');
|
| 562 |
+
|
| 563 |
+
const checkbox = card.querySelector('.card-checkbox');
|
| 564 |
+
if (checkbox) checkbox.checked = isSelected;
|
| 565 |
+
}
|
| 566 |
+
});
|
| 567 |
+
|
| 568 |
+
DOM.selectedCount.textContent = state.selectedImages.size;
|
| 569 |
+
DOM.btnCounter.textContent = state.selectedImages.size;
|
| 570 |
+
DOM.selectAll.checked = state.filteredImages.length > 0 && state.selectedImages.size === state.filteredImages.length;
|
| 571 |
+
DOM.downloadBtn.disabled = state.selectedImages.size === 0;
|
| 572 |
+
DOM.totalCount.textContent = state.filteredImages.length;
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
function updateDragSelection(currentIdx) {
|
| 576 |
+
state.selectedImages = new Set(state.dragSavedSelection);
|
| 577 |
+
const start = Math.min(state.dragStartIdx, currentIdx);
|
| 578 |
+
const end = Math.max(state.dragStartIdx, currentIdx);
|
| 579 |
+
|
| 580 |
+
for (let i = start; i <= end; i++) {
|
| 581 |
+
const src = state.filteredImages[i].src;
|
| 582 |
+
if (state.dragMode) state.selectedImages.add(src);
|
| 583 |
+
else state.selectedImages.delete(src);
|
| 584 |
+
}
|
| 585 |
+
|
| 586 |
+
state.lastSelectedIdx = currentIdx;
|
| 587 |
+
updateSelectionVisuals();
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
function toggleSelection(idx, shift, forceState = null) {
|
| 591 |
+
const img = state.filteredImages[idx];
|
| 592 |
+
const isCurrentlySelected = state.selectedImages.has(img.src);
|
| 593 |
+
|
| 594 |
+
if (shift && state.lastSelectedIdx !== -1) {
|
| 595 |
+
const start = Math.min(state.lastSelectedIdx, idx);
|
| 596 |
+
const end = Math.max(state.lastSelectedIdx, idx);
|
| 597 |
+
const shouldSelect = !state.selectedImages.has(state.filteredImages[state.lastSelectedIdx].src);
|
| 598 |
+
|
| 599 |
+
for (let i = start; i <= end; i++) {
|
| 600 |
+
const src = state.filteredImages[i].src;
|
| 601 |
+
if (shouldSelect) state.selectedImages.add(src);
|
| 602 |
+
else state.selectedImages.delete(src);
|
| 603 |
+
}
|
| 604 |
+
} else {
|
| 605 |
+
if (forceState !== null) {
|
| 606 |
+
if (forceState) state.selectedImages.add(img.src);
|
| 607 |
+
else state.selectedImages.delete(img.src);
|
| 608 |
+
} else {
|
| 609 |
+
if (isCurrentlySelected) state.selectedImages.delete(img.src);
|
| 610 |
+
else state.selectedImages.add(img.src);
|
| 611 |
+
}
|
| 612 |
+
state.lastSelectedIdx = idx;
|
| 613 |
+
}
|
| 614 |
+
updateSelectionVisuals();
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
async function startSequentialSearch() {
|
| 618 |
+
const urlPattern = DOM.seqUrlPattern.value.trim();
|
| 619 |
+
const startPage = parseInt(DOM.seqStart.value) || 1;
|
| 620 |
+
const endPage = parseInt(DOM.seqEnd.value) || 1;
|
| 621 |
+
const customSelector = DOM.seqSelector.value.trim();
|
| 622 |
+
|
| 623 |
+
if (!urlPattern.includes('{page}')) {
|
| 624 |
+
alert('Por favor, introduce una URL con el marcador {page} para poder paginar.');
|
| 625 |
+
return;
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
if (startPage > endPage) {
|
| 629 |
+
alert('La página de inicio ("Desde") no puede ser mayor que la página final ("Hasta").');
|
| 630 |
+
return;
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
DOM.seqStartBtn.disabled = true;
|
| 634 |
+
DOM.seqStartBtn.textContent = 'Buscando...';
|
| 635 |
+
DOM.seqUrlPattern.disabled = true;
|
| 636 |
+
DOM.seqStart.disabled = true;
|
| 637 |
+
DOM.seqEnd.disabled = true;
|
| 638 |
+
DOM.seqSelector.disabled = true;
|
| 639 |
+
DOM.seqProgress.style.display = 'block';
|
| 640 |
+
|
| 641 |
+
state.allImages = [];
|
| 642 |
+
state.selectedImages.clear();
|
| 643 |
+
applyFilters();
|
| 644 |
+
|
| 645 |
+
const totalPages = endPage - startPage + 1;
|
| 646 |
+
let loadedCount = 0;
|
| 647 |
+
|
| 648 |
+
DOM.seqProgressText.textContent = `0 / ${totalPages}`;
|
| 649 |
+
DOM.seqProgressStatus.textContent = 'Iniciando búsqueda...';
|
| 650 |
+
DOM.seqProgressBar.style.width = '0%';
|
| 651 |
+
|
| 652 |
+
const queue = [];
|
| 653 |
+
for (let p = startPage; p <= endPage; p++) {
|
| 654 |
+
queue.push(p);
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
const limit = 3;
|
| 658 |
+
let activeCount = 0;
|
| 659 |
+
|
| 660 |
+
const processNext = async () => {
|
| 661 |
+
if (queue.length === 0 && activeCount === 0) {
|
| 662 |
+
DOM.seqStartBtn.disabled = false;
|
| 663 |
+
DOM.seqStartBtn.textContent = 'Buscar';
|
| 664 |
+
DOM.seqUrlPattern.disabled = false;
|
| 665 |
+
DOM.seqStart.disabled = false;
|
| 666 |
+
DOM.seqEnd.disabled = false;
|
| 667 |
+
DOM.seqSelector.disabled = false;
|
| 668 |
+
DOM.seqProgressStatus.textContent = '¡Búsqueda completa!';
|
| 669 |
+
|
| 670 |
+
state.allImages.forEach(img => state.selectedImages.add(img.src));
|
| 671 |
+
updateSelectionVisuals();
|
| 672 |
+
return;
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
while (activeCount < limit && queue.length > 0) {
|
| 676 |
+
activeCount++;
|
| 677 |
+
const pageNum = queue.shift();
|
| 678 |
+
const pageUrl = urlPattern.replace('{page}', pageNum);
|
| 679 |
+
|
| 680 |
+
DOM.seqProgressStatus.textContent = `Cargando página ${pageNum}...`;
|
| 681 |
+
|
| 682 |
+
try {
|
| 683 |
+
const resp = await fetch(pageUrl);
|
| 684 |
+
if (!resp.ok) throw new Error(`HTTP error ${resp.status}`);
|
| 685 |
+
|
| 686 |
+
const html = await resp.text();
|
| 687 |
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
| 688 |
+
|
| 689 |
+
let foundSrc = '';
|
| 690 |
+
if (customSelector) {
|
| 691 |
+
foundSrc = doc.querySelector(customSelector)?.getAttribute('src') || doc.querySelector(customSelector)?.getAttribute('data-src');
|
| 692 |
+
}
|
| 693 |
+
|
| 694 |
+
if (!foundSrc) {
|
| 695 |
+
const standardSelectors = '#gimg, #image-container img, .fit-horizontal img, .gallery-image img, figure img, .post__content img';
|
| 696 |
+
foundSrc = doc.querySelector(standardSelectors)?.getAttribute('src') || doc.querySelector(standardSelectors)?.getAttribute('data-src');
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
+
if (!foundSrc) {
|
| 700 |
+
const imgs = Array.from(doc.querySelectorAll('img'));
|
| 701 |
+
let bestImg = null;
|
| 702 |
+
let bestScore = 0;
|
| 703 |
+
|
| 704 |
+
imgs.forEach(img => {
|
| 705 |
+
const src = img.getAttribute('src') || img.getAttribute('data-src') || img.getAttribute('data-lazy-src');
|
| 706 |
+
if (!src || src.startsWith('data:') || src.startsWith('blob:')) return;
|
| 707 |
+
if (src.includes('logo') || src.includes('banner') || src.includes('avatar') || src.includes('icon')) return;
|
| 708 |
+
|
| 709 |
+
let score = 10;
|
| 710 |
+
const filename = src.split('/').pop();
|
| 711 |
+
if (filename.match(/\d+/)) score += 20;
|
| 712 |
+
if (img.width >= 300 || img.height >= 300) score += 50;
|
| 713 |
+
|
| 714 |
+
if (score > bestScore) {
|
| 715 |
+
bestScore = score;
|
| 716 |
+
bestImg = src;
|
| 717 |
+
}
|
| 718 |
+
});
|
| 719 |
+
|
| 720 |
+
if (bestImg) {
|
| 721 |
+
foundSrc = bestImg;
|
| 722 |
+
}
|
| 723 |
+
}
|
| 724 |
+
|
| 725 |
+
if (foundSrc) {
|
| 726 |
+
const fullUrl = foundSrc.startsWith('http') ? foundSrc : new URL(foundSrc, pageUrl).href;
|
| 727 |
+
|
| 728 |
+
const imgObj = {
|
| 729 |
+
src: fullUrl,
|
| 730 |
+
width: 0,
|
| 731 |
+
height: 0,
|
| 732 |
+
inLink: false,
|
| 733 |
+
linkHref: null,
|
| 734 |
+
isKemonoThumb: false,
|
| 735 |
+
originalSrc: fullUrl,
|
| 736 |
+
origWidth: 0,
|
| 737 |
+
origHeight: 0
|
| 738 |
+
};
|
| 739 |
+
|
| 740 |
+
await new Promise(resolve => {
|
| 741 |
+
const t = new Image();
|
| 742 |
+
t.onload = () => {
|
| 743 |
+
imgObj.width = t.naturalWidth;
|
| 744 |
+
imgObj.height = t.naturalHeight;
|
| 745 |
+
imgObj.origWidth = t.naturalWidth;
|
| 746 |
+
imgObj.origHeight = t.naturalHeight;
|
| 747 |
+
resolve();
|
| 748 |
+
};
|
| 749 |
+
t.onerror = () => { resolve(); };
|
| 750 |
+
t.src = fullUrl;
|
| 751 |
+
});
|
| 752 |
+
|
| 753 |
+
if (!state.allImages.some(img => img.src === imgObj.src)) {
|
| 754 |
+
state.allImages.push(imgObj);
|
| 755 |
+
state.selectedImages.add(imgObj.src);
|
| 756 |
+
applyFilters();
|
| 757 |
+
}
|
| 758 |
+
}
|
| 759 |
+
} catch (err) {
|
| 760 |
+
console.error(`Error al cargar página ${pageNum}:`, err);
|
| 761 |
+
}
|
| 762 |
+
|
| 763 |
+
loadedCount++;
|
| 764 |
+
activeCount--;
|
| 765 |
+
|
| 766 |
+
const progressPercent = (loadedCount / totalPages) * 100;
|
| 767 |
+
DOM.seqProgressText.textContent = `${loadedCount} / ${totalPages}`;
|
| 768 |
+
DOM.seqProgressBar.style.width = `${progressPercent}%`;
|
| 769 |
+
|
| 770 |
+
processNext();
|
| 771 |
+
}
|
| 772 |
+
};
|
| 773 |
+
|
| 774 |
+
processNext();
|
| 775 |
+
}
|
| 776 |
+
|
| 777 |
+
let originalHTML = '';
|
| 778 |
+
|
| 779 |
+
function showDownloadingState(completed, total) {
|
| 780 |
+
if (!originalHTML) {
|
| 781 |
+
originalHTML = DOM.downloadBtn.innerHTML;
|
| 782 |
+
}
|
| 783 |
+
DOM.downloadBtn.disabled = true;
|
| 784 |
+
const percentage = Math.round((completed / total) * 100);
|
| 785 |
+
DOM.downloadBtn.innerHTML = `
|
| 786 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
| 787 |
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
| 788 |
+
<polyline points="7 10 12 15 17 10"></polyline>
|
| 789 |
+
<line x1="12" y1="15" x2="12" y2="3"></line>
|
| 790 |
+
</svg>
|
| 791 |
+
Descargando... ${percentage}% (${completed}/${total})
|
| 792 |
+
`;
|
| 793 |
+
}
|
| 794 |
+
|
| 795 |
+
function restoreDownloadButton() {
|
| 796 |
+
if (originalHTML) {
|
| 797 |
+
DOM.downloadBtn.disabled = false;
|
| 798 |
+
DOM.downloadBtn.innerHTML = originalHTML;
|
| 799 |
+
originalHTML = '';
|
| 800 |
+
}
|
| 801 |
+
updateSelectionVisuals();
|
| 802 |
+
}
|
| 803 |
+
|
| 804 |
+
chrome.runtime.onMessage.addListener((request) => {
|
| 805 |
+
if (request.action === 'downloadProgress' && request.comicUrl === window.currentContextTabUrl) {
|
| 806 |
+
if (request.downloading) {
|
| 807 |
+
showDownloadingState(request.completed, request.total);
|
| 808 |
+
} else {
|
| 809 |
+
restoreDownloadButton();
|
| 810 |
+
}
|
| 811 |
+
}
|
| 812 |
+
});
|
| 813 |
+
|
buscador hls/manifest.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"manifest_version": 3,
|
| 3 |
+
"name": "Buscador HLS",
|
| 4 |
+
"version": "1.0",
|
| 5 |
+
"description": "Busca y extrae enlaces de video HLS (.m3u8) en su máxima calidad de forma masiva.",
|
| 6 |
+
"permissions": [
|
| 7 |
+
"activeTab",
|
| 8 |
+
"scripting",
|
| 9 |
+
"tabs"
|
| 10 |
+
],
|
| 11 |
+
"host_permissions": [
|
| 12 |
+
"*://*.xvideos.com/*",
|
| 13 |
+
"*://*.xvideos.es/*",
|
| 14 |
+
"*://*.xvideos2.com/*",
|
| 15 |
+
"*://*.xvideos-cdn.com/*",
|
| 16 |
+
"*://*.pornhub.com/*",
|
| 17 |
+
"*://*.phncdn.com/*",
|
| 18 |
+
"<all_urls>"
|
| 19 |
+
],
|
| 20 |
+
"action": {
|
| 21 |
+
"default_popup": "popup.html"
|
| 22 |
+
}
|
| 23 |
+
}
|
buscador hls/popup.css
ADDED
|
@@ -0,0 +1,643 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Buscador HLS Max - Custom Stylesheet */
|
| 2 |
+
:root {
|
| 3 |
+
--bg-main: #09090b;
|
| 4 |
+
--bg-card: #18181b;
|
| 5 |
+
--bg-input: #09090b;
|
| 6 |
+
--border: #27272a;
|
| 7 |
+
--border-focus: #4f46e5;
|
| 8 |
+
--text-main: #f4f4f5;
|
| 9 |
+
--text-muted: #a1a1aa;
|
| 10 |
+
|
| 11 |
+
--primary: #6366f1;
|
| 12 |
+
--primary-hover: #4f46e5;
|
| 13 |
+
--primary-shadow: rgba(99, 102, 241, 0.35);
|
| 14 |
+
|
| 15 |
+
--accent: #8b5cf6;
|
| 16 |
+
--accent-hover: #7c3aed;
|
| 17 |
+
|
| 18 |
+
--success: #10b981;
|
| 19 |
+
--success-bg: rgba(16, 185, 129, 0.15);
|
| 20 |
+
--success-border: rgba(16, 185, 129, 0.3);
|
| 21 |
+
|
| 22 |
+
--info: #3b82f6;
|
| 23 |
+
--info-bg: rgba(59, 130, 246, 0.15);
|
| 24 |
+
|
| 25 |
+
--warning: #f59e0b;
|
| 26 |
+
--warning-bg: rgba(245, 158, 11, 0.15);
|
| 27 |
+
|
| 28 |
+
--danger: #ef4444;
|
| 29 |
+
--danger-bg: rgba(239, 68, 68, 0.15);
|
| 30 |
+
|
| 31 |
+
--font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
| 32 |
+
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
| 33 |
+
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 34 |
+
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 35 |
+
--shadow-glow: 0 0 15px rgba(99, 102, 241, 0.15);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
/* Reset */
|
| 39 |
+
* {
|
| 40 |
+
box-sizing: border-box;
|
| 41 |
+
margin: 0;
|
| 42 |
+
padding: 0;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
body {
|
| 46 |
+
background-color: var(--bg-main);
|
| 47 |
+
color: var(--text-main);
|
| 48 |
+
font-family: var(--font-family);
|
| 49 |
+
font-size: 14px;
|
| 50 |
+
line-height: 1.5;
|
| 51 |
+
width: 680px; /* Default popup width */
|
| 52 |
+
min-height: 520px;
|
| 53 |
+
overflow-x: hidden;
|
| 54 |
+
position: relative;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
/* Full Tab / Page Mode Detection */
|
| 58 |
+
@media (min-width: 768px) {
|
| 59 |
+
body {
|
| 60 |
+
width: 100vw;
|
| 61 |
+
min-height: 100vh;
|
| 62 |
+
display: flex;
|
| 63 |
+
justify-content: center;
|
| 64 |
+
align-items: flex-start;
|
| 65 |
+
padding: 30px 15px;
|
| 66 |
+
}
|
| 67 |
+
.app-container {
|
| 68 |
+
width: 100%;
|
| 69 |
+
max-width: 900px;
|
| 70 |
+
margin: 0 auto;
|
| 71 |
+
border-radius: 16px;
|
| 72 |
+
border: 1px solid var(--border);
|
| 73 |
+
box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(0,0,0,0.4);
|
| 74 |
+
background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
|
| 75 |
+
}
|
| 76 |
+
.results-container {
|
| 77 |
+
max-height: 480px;
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.app-container {
|
| 82 |
+
display: flex;
|
| 83 |
+
flex-direction: column;
|
| 84 |
+
background-color: var(--bg-main);
|
| 85 |
+
padding: 20px;
|
| 86 |
+
min-height: inherit;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
/* Header */
|
| 90 |
+
.header {
|
| 91 |
+
display: flex;
|
| 92 |
+
justify-content: space-between;
|
| 93 |
+
align-items: center;
|
| 94 |
+
margin-bottom: 20px;
|
| 95 |
+
padding-bottom: 15px;
|
| 96 |
+
border-bottom: 1px solid var(--border);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.brand {
|
| 100 |
+
display: flex;
|
| 101 |
+
align-items: center;
|
| 102 |
+
gap: 12px;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.logo-icon {
|
| 106 |
+
background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
|
| 107 |
+
color: #fff;
|
| 108 |
+
width: 38px;
|
| 109 |
+
height: 38px;
|
| 110 |
+
border-radius: 10px;
|
| 111 |
+
display: flex;
|
| 112 |
+
align-items: center;
|
| 113 |
+
justify-content: center;
|
| 114 |
+
box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
.brand-text h1 {
|
| 118 |
+
font-size: 18px;
|
| 119 |
+
font-weight: 800;
|
| 120 |
+
letter-spacing: -0.025em;
|
| 121 |
+
color: #ffffff;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.brand-text h1 span {
|
| 125 |
+
background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
|
| 126 |
+
-webkit-background-clip: text;
|
| 127 |
+
-webkit-text-fill-color: transparent;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.brand-text p {
|
| 131 |
+
font-size: 11px;
|
| 132 |
+
color: var(--text-muted);
|
| 133 |
+
font-weight: 500;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.btn-icon {
|
| 137 |
+
background: var(--bg-card);
|
| 138 |
+
border: 1px solid var(--border);
|
| 139 |
+
color: var(--text-muted);
|
| 140 |
+
width: 36px;
|
| 141 |
+
height: 36px;
|
| 142 |
+
border-radius: 8px;
|
| 143 |
+
display: flex;
|
| 144 |
+
align-items: center;
|
| 145 |
+
justify-content: center;
|
| 146 |
+
cursor: pointer;
|
| 147 |
+
transition: all 0.2s ease;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
.btn-icon:hover {
|
| 151 |
+
background: var(--border);
|
| 152 |
+
color: #fff;
|
| 153 |
+
border-color: var(--text-muted);
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/* Panels styling */
|
| 157 |
+
.panel {
|
| 158 |
+
background-color: var(--bg-card);
|
| 159 |
+
border: 1px solid var(--border);
|
| 160 |
+
border-radius: 12px;
|
| 161 |
+
padding: 16px;
|
| 162 |
+
margin-bottom: 16px;
|
| 163 |
+
box-shadow: var(--shadow-sm);
|
| 164 |
+
transition: box-shadow 0.2s ease, border-color 0.2s ease;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.panel:hover {
|
| 168 |
+
box-shadow: var(--shadow-md), var(--shadow-glow);
|
| 169 |
+
border-color: rgba(99, 102, 241, 0.15);
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
.panel-header {
|
| 173 |
+
display: flex;
|
| 174 |
+
align-items: center;
|
| 175 |
+
gap: 10px;
|
| 176 |
+
margin-bottom: 14px;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
.step-num {
|
| 180 |
+
background: rgba(99, 102, 241, 0.1);
|
| 181 |
+
color: var(--primary);
|
| 182 |
+
font-size: 12px;
|
| 183 |
+
font-weight: 700;
|
| 184 |
+
width: 22px;
|
| 185 |
+
height: 22px;
|
| 186 |
+
border-radius: 6px;
|
| 187 |
+
display: flex;
|
| 188 |
+
align-items: center;
|
| 189 |
+
justify-content: center;
|
| 190 |
+
border: 1px solid rgba(99, 102, 241, 0.2);
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
.panel-header h2 {
|
| 194 |
+
font-size: 15px;
|
| 195 |
+
font-weight: 700;
|
| 196 |
+
color: #fff;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
/* Inputs & Textareas */
|
| 200 |
+
.textarea-wrapper {
|
| 201 |
+
position: relative;
|
| 202 |
+
margin-bottom: 12px;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
textarea {
|
| 206 |
+
width: 100%;
|
| 207 |
+
height: 120px;
|
| 208 |
+
background-color: var(--bg-input);
|
| 209 |
+
border: 1px solid var(--border);
|
| 210 |
+
border-radius: 8px;
|
| 211 |
+
color: var(--text-main);
|
| 212 |
+
padding: 12px;
|
| 213 |
+
font-family: monospace;
|
| 214 |
+
font-size: 12.5px;
|
| 215 |
+
resize: vertical;
|
| 216 |
+
outline: none;
|
| 217 |
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
textarea:focus {
|
| 221 |
+
border-color: var(--border-focus);
|
| 222 |
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
textarea::placeholder {
|
| 226 |
+
color: #52525b;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.btn-clear {
|
| 230 |
+
position: absolute;
|
| 231 |
+
right: 12px;
|
| 232 |
+
bottom: 12px;
|
| 233 |
+
background: rgba(39, 39, 42, 0.8);
|
| 234 |
+
border: 1px solid var(--border);
|
| 235 |
+
color: var(--text-muted);
|
| 236 |
+
font-size: 11px;
|
| 237 |
+
font-weight: 600;
|
| 238 |
+
padding: 4px 8px;
|
| 239 |
+
border-radius: 6px;
|
| 240 |
+
display: flex;
|
| 241 |
+
align-items: center;
|
| 242 |
+
gap: 4px;
|
| 243 |
+
cursor: pointer;
|
| 244 |
+
backdrop-filter: blur(4px);
|
| 245 |
+
transition: all 0.2s ease;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
.btn-clear:hover {
|
| 249 |
+
background: var(--danger-bg);
|
| 250 |
+
color: #ef4444;
|
| 251 |
+
border-color: rgba(239, 68, 68, 0.3);
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
/* Control Rows */
|
| 255 |
+
.control-row {
|
| 256 |
+
display: flex;
|
| 257 |
+
justify-content: space-between;
|
| 258 |
+
align-items: center;
|
| 259 |
+
gap: 12px;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.concurrency-selector {
|
| 263 |
+
display: flex;
|
| 264 |
+
align-items: center;
|
| 265 |
+
gap: 8px;
|
| 266 |
+
color: var(--text-muted);
|
| 267 |
+
font-size: 13px;
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
.concurrency-selector select {
|
| 271 |
+
background-color: var(--bg-input);
|
| 272 |
+
border: 1px solid var(--border);
|
| 273 |
+
color: var(--text-main);
|
| 274 |
+
padding: 6px 10px;
|
| 275 |
+
border-radius: 6px;
|
| 276 |
+
outline: none;
|
| 277 |
+
cursor: pointer;
|
| 278 |
+
font-weight: 500;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.concurrency-selector select:focus {
|
| 282 |
+
border-color: var(--border-focus);
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
/* Buttons */
|
| 286 |
+
.btn-primary {
|
| 287 |
+
background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
|
| 288 |
+
color: #fff;
|
| 289 |
+
border: none;
|
| 290 |
+
font-weight: 700;
|
| 291 |
+
font-size: 13px;
|
| 292 |
+
padding: 10px 18px;
|
| 293 |
+
border-radius: 8px;
|
| 294 |
+
cursor: pointer;
|
| 295 |
+
display: flex;
|
| 296 |
+
align-items: center;
|
| 297 |
+
gap: 8px;
|
| 298 |
+
box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
|
| 299 |
+
transition: all 0.2s ease;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
.btn-primary:hover {
|
| 303 |
+
transform: translateY(-1px);
|
| 304 |
+
box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
|
| 305 |
+
opacity: 0.95;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
.btn-primary:active {
|
| 309 |
+
transform: translateY(0);
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
.btn-secondary {
|
| 313 |
+
background-color: #27272a;
|
| 314 |
+
border: 1px solid #3f3f46;
|
| 315 |
+
color: var(--text-main);
|
| 316 |
+
font-weight: 600;
|
| 317 |
+
font-size: 12.5px;
|
| 318 |
+
padding: 8px 14px;
|
| 319 |
+
border-radius: 8px;
|
| 320 |
+
cursor: pointer;
|
| 321 |
+
display: flex;
|
| 322 |
+
align-items: center;
|
| 323 |
+
gap: 6px;
|
| 324 |
+
transition: all 0.2s ease;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
.btn-secondary:hover {
|
| 328 |
+
background-color: #3f3f46;
|
| 329 |
+
border-color: #52525b;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
.btn-small {
|
| 333 |
+
padding: 4px 8px;
|
| 334 |
+
font-size: 11px;
|
| 335 |
+
border-radius: 6px;
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
.btn-accent {
|
| 339 |
+
background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
/* Progress bar section */
|
| 343 |
+
.progress-section {
|
| 344 |
+
background: rgba(39, 39, 42, 0.3);
|
| 345 |
+
border: 1px dashed var(--border);
|
| 346 |
+
border-radius: 10px;
|
| 347 |
+
padding: 12px 16px;
|
| 348 |
+
margin-bottom: 16px;
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
.progress-info {
|
| 352 |
+
display: flex;
|
| 353 |
+
justify-content: space-between;
|
| 354 |
+
font-size: 12.5px;
|
| 355 |
+
font-weight: 600;
|
| 356 |
+
margin-bottom: 6px;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
#progress-status {
|
| 360 |
+
color: var(--text-main);
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
#progress-percentage {
|
| 364 |
+
color: var(--primary);
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
.progress-bar-container {
|
| 368 |
+
width: 100%;
|
| 369 |
+
height: 8px;
|
| 370 |
+
background-color: #27272a;
|
| 371 |
+
border-radius: 9999px;
|
| 372 |
+
overflow: hidden;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.progress-bar {
|
| 376 |
+
height: 100%;
|
| 377 |
+
width: 0;
|
| 378 |
+
background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
|
| 379 |
+
border-radius: 9999px;
|
| 380 |
+
transition: width 0.2s ease;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
/* Results Placeholder */
|
| 384 |
+
.results-placeholder {
|
| 385 |
+
display: flex;
|
| 386 |
+
flex-direction: column;
|
| 387 |
+
align-items: center;
|
| 388 |
+
justify-content: center;
|
| 389 |
+
padding: 40px 20px;
|
| 390 |
+
text-align: center;
|
| 391 |
+
color: var(--text-muted);
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
.placeholder-icon {
|
| 395 |
+
color: #3f3f46;
|
| 396 |
+
margin-bottom: 12px;
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
.results-placeholder p {
|
| 400 |
+
font-weight: 600;
|
| 401 |
+
color: #e4e4e7;
|
| 402 |
+
font-size: 13.5px;
|
| 403 |
+
margin-bottom: 4px;
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
.results-placeholder .hint {
|
| 407 |
+
font-size: 11px;
|
| 408 |
+
color: #71717a;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
/* Results Table */
|
| 412 |
+
.results-container {
|
| 413 |
+
overflow-y: auto;
|
| 414 |
+
max-height: 220px;
|
| 415 |
+
border: 1px solid var(--border);
|
| 416 |
+
border-radius: 8px;
|
| 417 |
+
background-color: var(--bg-input);
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
/* Custom scrollbars */
|
| 421 |
+
.results-container::-webkit-scrollbar {
|
| 422 |
+
width: 6px;
|
| 423 |
+
}
|
| 424 |
+
.results-container::-webkit-scrollbar-track {
|
| 425 |
+
background: transparent;
|
| 426 |
+
}
|
| 427 |
+
.results-container::-webkit-scrollbar-thumb {
|
| 428 |
+
background: #27272a;
|
| 429 |
+
border-radius: 999px;
|
| 430 |
+
}
|
| 431 |
+
.results-container::-webkit-scrollbar-thumb:hover {
|
| 432 |
+
background: #3f3f46;
|
| 433 |
+
}
|
| 434 |
+
|
| 435 |
+
.title-with-badge {
|
| 436 |
+
display: flex;
|
| 437 |
+
align-items: center;
|
| 438 |
+
gap: 8px;
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
.badge {
|
| 442 |
+
background-color: #27272a;
|
| 443 |
+
border: 1px solid var(--border);
|
| 444 |
+
color: #fff;
|
| 445 |
+
font-size: 11px;
|
| 446 |
+
font-weight: 700;
|
| 447 |
+
padding: 2px 8px;
|
| 448 |
+
border-radius: 12px;
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
.results-table {
|
| 452 |
+
width: 100%;
|
| 453 |
+
border-collapse: collapse;
|
| 454 |
+
text-align: left;
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
.results-table th {
|
| 458 |
+
background-color: #18181b;
|
| 459 |
+
color: var(--text-muted);
|
| 460 |
+
font-size: 11px;
|
| 461 |
+
font-weight: 700;
|
| 462 |
+
text-transform: uppercase;
|
| 463 |
+
letter-spacing: 0.05em;
|
| 464 |
+
padding: 10px 12px;
|
| 465 |
+
border-bottom: 1px solid var(--border);
|
| 466 |
+
position: sticky;
|
| 467 |
+
top: 0;
|
| 468 |
+
z-index: 10;
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
.results-table td {
|
| 472 |
+
padding: 12px;
|
| 473 |
+
border-bottom: 1px solid var(--border);
|
| 474 |
+
vertical-align: middle;
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
.results-table tbody tr:hover {
|
| 478 |
+
background-color: rgba(39, 39, 42, 0.4);
|
| 479 |
+
}
|
| 480 |
+
|
| 481 |
+
.results-table tbody tr.error-row {
|
| 482 |
+
opacity: 0.7;
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
/* Custom Checkbox */
|
| 486 |
+
input[type="checkbox"] {
|
| 487 |
+
accent-color: var(--primary);
|
| 488 |
+
width: 15px;
|
| 489 |
+
height: 15px;
|
| 490 |
+
cursor: pointer;
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
/* Video Column Info */
|
| 494 |
+
.video-cell {
|
| 495 |
+
display: flex;
|
| 496 |
+
flex-direction: column;
|
| 497 |
+
gap: 4px;
|
| 498 |
+
max-width: 320px;
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
.video-title {
|
| 502 |
+
font-weight: 600;
|
| 503 |
+
color: #fff;
|
| 504 |
+
font-size: 13px;
|
| 505 |
+
white-space: nowrap;
|
| 506 |
+
overflow: hidden;
|
| 507 |
+
text-overflow: ellipsis;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
.video-url {
|
| 511 |
+
font-family: monospace;
|
| 512 |
+
font-size: 11px;
|
| 513 |
+
color: var(--text-muted);
|
| 514 |
+
white-space: nowrap;
|
| 515 |
+
overflow: hidden;
|
| 516 |
+
text-overflow: ellipsis;
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
.video-url a {
|
| 520 |
+
color: inherit;
|
| 521 |
+
text-decoration: none;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
.video-url a:hover {
|
| 525 |
+
color: var(--primary);
|
| 526 |
+
text-decoration: underline;
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
/* Quality Tag colors */
|
| 530 |
+
.quality-tag {
|
| 531 |
+
font-size: 11px;
|
| 532 |
+
font-weight: 800;
|
| 533 |
+
padding: 3px 8px;
|
| 534 |
+
border-radius: 6px;
|
| 535 |
+
text-transform: uppercase;
|
| 536 |
+
display: inline-block;
|
| 537 |
+
text-align: center;
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
.quality-1080p {
|
| 541 |
+
background-color: var(--success-bg);
|
| 542 |
+
color: var(--success);
|
| 543 |
+
border: 1px solid var(--success-border);
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
.quality-720p {
|
| 547 |
+
background-color: var(--info-bg);
|
| 548 |
+
color: var(--info);
|
| 549 |
+
border: 1px solid rgba(59, 130, 246, 0.3);
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
.quality-480p, .quality-360p {
|
| 553 |
+
background-color: var(--warning-bg);
|
| 554 |
+
color: var(--warning);
|
| 555 |
+
border: 1px solid rgba(245, 158, 11, 0.3);
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
.quality-error {
|
| 559 |
+
background-color: var(--danger-bg);
|
| 560 |
+
color: var(--danger);
|
| 561 |
+
border: 1px solid rgba(239, 68, 68, 0.3);
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
/* Action items inside cell */
|
| 565 |
+
.actions-cell {
|
| 566 |
+
display: flex;
|
| 567 |
+
gap: 6px;
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
.btn-actions-row {
|
| 571 |
+
background: var(--bg-card);
|
| 572 |
+
border: 1px solid var(--border);
|
| 573 |
+
color: var(--text-main);
|
| 574 |
+
padding: 6px;
|
| 575 |
+
border-radius: 6px;
|
| 576 |
+
cursor: pointer;
|
| 577 |
+
display: flex;
|
| 578 |
+
align-items: center;
|
| 579 |
+
justify-content: center;
|
| 580 |
+
transition: all 0.2s ease;
|
| 581 |
+
}
|
| 582 |
+
|
| 583 |
+
.btn-actions-row:hover {
|
| 584 |
+
background-color: var(--border);
|
| 585 |
+
color: #fff;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.btn-actions-row.success-toast {
|
| 589 |
+
color: var(--success);
|
| 590 |
+
border-color: var(--success);
|
| 591 |
+
background-color: var(--success-bg);
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
/* Bulk actions footer panel */
|
| 595 |
+
.bulk-actions {
|
| 596 |
+
display: flex;
|
| 597 |
+
justify-content: space-between;
|
| 598 |
+
align-items: center;
|
| 599 |
+
margin-top: 14px;
|
| 600 |
+
padding-top: 14px;
|
| 601 |
+
border-top: 1px solid var(--border);
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
.select-info {
|
| 605 |
+
font-size: 12.5px;
|
| 606 |
+
color: var(--text-muted);
|
| 607 |
+
font-weight: 600;
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
.bulk-buttons {
|
| 611 |
+
display: flex;
|
| 612 |
+
gap: 8px;
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
/* Toast Message popup */
|
| 616 |
+
.toast {
|
| 617 |
+
position: fixed;
|
| 618 |
+
bottom: 20px;
|
| 619 |
+
left: 50%;
|
| 620 |
+
transform: translateX(-50%) translateY(100px);
|
| 621 |
+
background-color: #27272a;
|
| 622 |
+
border: 1px solid var(--border);
|
| 623 |
+
color: #fff;
|
| 624 |
+
padding: 10px 20px;
|
| 625 |
+
border-radius: 8px;
|
| 626 |
+
font-weight: 600;
|
| 627 |
+
font-size: 13px;
|
| 628 |
+
box-shadow: var(--shadow-lg), 0 0 20px rgba(0,0,0,0.5);
|
| 629 |
+
pointer-events: none;
|
| 630 |
+
z-index: 2000;
|
| 631 |
+
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
|
| 632 |
+
opacity: 0;
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
.toast.show {
|
| 636 |
+
transform: translateX(-50%) translateY(0);
|
| 637 |
+
opacity: 1;
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
/* Utility Helpers */
|
| 641 |
+
.hidden {
|
| 642 |
+
display: none !important;
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="es">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Buscador HLS Max</title>
|
| 7 |
+
<!-- Google Fonts: Inter -->
|
| 8 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 9 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
|
| 11 |
+
<link rel="stylesheet" href="popup.css">
|
| 12 |
+
</head>
|
| 13 |
+
<body>
|
| 14 |
+
<div class="app-container">
|
| 15 |
+
<!-- Header -->
|
| 16 |
+
<header class="header">
|
| 17 |
+
<div class="brand">
|
| 18 |
+
<div class="logo-icon">
|
| 19 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
| 20 |
+
<polygon points="23 7 16 12 23 17 23 7"></polygon>
|
| 21 |
+
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>
|
| 22 |
+
</svg>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="brand-text">
|
| 25 |
+
<h1>Buscador HLS <span>Max</span></h1>
|
| 26 |
+
<p>Extractor de enlaces m3u8 en alta fidelidad</p>
|
| 27 |
+
</div>
|
| 28 |
+
</div>
|
| 29 |
+
<button id="btn-expand" class="btn-icon" title="Abrir en pestaña completa">
|
| 30 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 31 |
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
|
| 32 |
+
<polyline points="15 3 21 3 21 9"></polyline>
|
| 33 |
+
<line x1="10" y1="14" x2="21" y2="3"></line>
|
| 34 |
+
</svg>
|
| 35 |
+
</button>
|
| 36 |
+
</header>
|
| 37 |
+
|
| 38 |
+
<!-- Main Content -->
|
| 39 |
+
<main class="main-content">
|
| 40 |
+
<!-- Input Panel -->
|
| 41 |
+
<section class="panel input-panel">
|
| 42 |
+
<div class="panel-header">
|
| 43 |
+
<span class="step-num">1</span>
|
| 44 |
+
<h2>Ingresar enlaces de video</h2>
|
| 45 |
+
</div>
|
| 46 |
+
<div class="textarea-wrapper">
|
| 47 |
+
<textarea id="urls-input" placeholder="Pega aquí tus enlaces de video de XVideos o Pornhub (uno por línea)... Ejemplos: https://es.pornhub.com/view_video.php?viewkey=ph5fc66dd71d040 https://www.xvideos.es/video..."></textarea>
|
| 48 |
+
<button id="btn-clear-input" class="btn-clear" title="Limpiar lista">
|
| 49 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 50 |
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
| 51 |
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
| 52 |
+
</svg>
|
| 53 |
+
Limpiar
|
| 54 |
+
</button>
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
<div class="control-row">
|
| 58 |
+
<div class="concurrency-selector">
|
| 59 |
+
<label for="concurrency-select">Hilos simultáneos:</label>
|
| 60 |
+
<select id="concurrency-select">
|
| 61 |
+
<option value="1">1 (Seguro)</option>
|
| 62 |
+
<option value="2">2 (Recomendado)</option>
|
| 63 |
+
<option value="3" selected>3 (Rápido)</option>
|
| 64 |
+
<option value="5">5 (Turbo)</option>
|
| 65 |
+
</select>
|
| 66 |
+
</div>
|
| 67 |
+
<button id="btn-extract" class="btn-primary">
|
| 68 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
| 69 |
+
<polyline points="23 4 23 10 17 10"></polyline>
|
| 70 |
+
<polyline points="1 20 1 14 7 14"></polyline>
|
| 71 |
+
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>
|
| 72 |
+
</svg>
|
| 73 |
+
Extraer Enlaces HLS
|
| 74 |
+
</button>
|
| 75 |
+
</div>
|
| 76 |
+
</section>
|
| 77 |
+
|
| 78 |
+
<!-- Progress Section -->
|
| 79 |
+
<section id="progress-section" class="progress-section hidden">
|
| 80 |
+
<div class="progress-info">
|
| 81 |
+
<span id="progress-status">Procesando videos...</span>
|
| 82 |
+
<span id="progress-percentage">0%</span>
|
| 83 |
+
</div>
|
| 84 |
+
<div class="progress-bar-container">
|
| 85 |
+
<div id="progress-bar" class="progress-bar"></div>
|
| 86 |
+
</div>
|
| 87 |
+
</section>
|
| 88 |
+
|
| 89 |
+
<!-- Results Panel -->
|
| 90 |
+
<section class="panel results-panel">
|
| 91 |
+
<div class="panel-header">
|
| 92 |
+
<div class="title-with-badge">
|
| 93 |
+
<span class="step-num">2</span>
|
| 94 |
+
<h2>Enlaces HLS Encontrados</h2>
|
| 95 |
+
<span id="results-count" class="badge">0</span>
|
| 96 |
+
</div>
|
| 97 |
+
<div class="results-actions-top" style="display: flex; gap: 8px;">
|
| 98 |
+
<button id="btn-copy-all-top" class="btn-primary btn-small hidden" title="Copiar todos los enlaces HLS">
|
| 99 |
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 2px;">
|
| 100 |
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
| 101 |
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
| 102 |
+
</svg>
|
| 103 |
+
Copiar Todos
|
| 104 |
+
</button>
|
| 105 |
+
<button id="btn-filter-quality" class="btn-secondary btn-small" title="Filtrar por calidad">
|
| 106 |
+
Todas las Calidades
|
| 107 |
+
</button>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<div class="results-container">
|
| 112 |
+
<div id="results-placeholder" class="results-placeholder">
|
| 113 |
+
<div class="placeholder-icon">
|
| 114 |
+
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
| 115 |
+
<rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"></rect>
|
| 116 |
+
<line x1="7" y1="2" x2="7" y2="22"></line>
|
| 117 |
+
<line x1="17" y1="2" x2="17" y2="22"></line>
|
| 118 |
+
<line x1="2" y1="12" x2="22" y2="12"></line>
|
| 119 |
+
<line x1="2" y1="7" x2="7" y2="7"></line>
|
| 120 |
+
<line x1="2" y1="17" x2="7" y2="17"></line>
|
| 121 |
+
<line x1="17" y1="17" x2="22" y2="17"></line>
|
| 122 |
+
<line x1="17" y1="7" x2="22" y2="7"></line>
|
| 123 |
+
</svg>
|
| 124 |
+
</div>
|
| 125 |
+
<p>Los enlaces resueltos en su máxima calidad aparecerán aquí.</p>
|
| 126 |
+
<span class="hint">Pega los enlaces arriba y presiona "Extraer Enlaces HLS".</span>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<table id="results-table" class="results-table hidden">
|
| 130 |
+
<thead>
|
| 131 |
+
<tr>
|
| 132 |
+
<th width="40"><input type="checkbox" id="select-all-checkbox" checked></th>
|
| 133 |
+
<th>Video</th>
|
| 134 |
+
<th width="90">Calidad</th>
|
| 135 |
+
<th width="120">Acciones</th>
|
| 136 |
+
</tr>
|
| 137 |
+
</thead>
|
| 138 |
+
<tbody id="results-list">
|
| 139 |
+
<!-- Dynamically populated rows -->
|
| 140 |
+
</tbody>
|
| 141 |
+
</table>
|
| 142 |
+
</div>
|
| 143 |
+
|
| 144 |
+
<!-- Bulk Actions Footer -->
|
| 145 |
+
<div id="bulk-actions" class="bulk-actions hidden">
|
| 146 |
+
<div class="select-info">
|
| 147 |
+
<span id="selected-count">0 seleccionados</span>
|
| 148 |
+
</div>
|
| 149 |
+
<div class="bulk-buttons">
|
| 150 |
+
<button id="btn-bulk-copy" class="btn-secondary">
|
| 151 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 152 |
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
| 153 |
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
| 154 |
+
</svg>
|
| 155 |
+
Copiar HLS
|
| 156 |
+
</button>
|
| 157 |
+
<button id="btn-bulk-open" class="btn-secondary">
|
| 158 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 159 |
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
|
| 160 |
+
<polyline points="15 3 21 3 21 9"></polyline>
|
| 161 |
+
<line x1="10" y1="14" x2="21" y2="3"></line>
|
| 162 |
+
</svg>
|
| 163 |
+
Abrir Pestañas
|
| 164 |
+
</button>
|
| 165 |
+
<button id="btn-bulk-download" class="btn-primary btn-accent">
|
| 166 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 167 |
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
| 168 |
+
<polyline points="7 10 12 15 17 10"></polyline>
|
| 169 |
+
<line x1="12" y1="15" x2="12" y2="3"></line>
|
| 170 |
+
</svg>
|
| 171 |
+
Exportar M3U
|
| 172 |
+
</button>
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
</section>
|
| 176 |
+
</main>
|
| 177 |
+
</div>
|
| 178 |
+
|
| 179 |
+
<!-- Notification Toast -->
|
| 180 |
+
<div id="toast" class="toast hidden">Enlace copiado correctamente.</div>
|
| 181 |
+
|
| 182 |
+
<script src="popup.js"></script>
|
| 183 |
+
</body>
|
| 184 |
+
</html>
|
buscador hls/popup.js
ADDED
|
@@ -0,0 +1,709 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 2 |
+
// Elements
|
| 3 |
+
const urlsInput = document.getElementById('urls-input');
|
| 4 |
+
const btnClearInput = document.getElementById('btn-clear-input');
|
| 5 |
+
const concurrencySelect = document.getElementById('concurrency-select');
|
| 6 |
+
const btnExtract = document.getElementById('btn-extract');
|
| 7 |
+
const btnExpand = document.getElementById('btn-expand');
|
| 8 |
+
|
| 9 |
+
const progressSection = document.getElementById('progress-section');
|
| 10 |
+
const progressStatus = document.getElementById('progress-status');
|
| 11 |
+
const progressPercentage = document.getElementById('progress-percentage');
|
| 12 |
+
const progressBar = document.getElementById('progress-bar');
|
| 13 |
+
|
| 14 |
+
const resultsCount = document.getElementById('results-count');
|
| 15 |
+
const resultsPlaceholder = document.getElementById('results-placeholder');
|
| 16 |
+
const resultsTable = document.getElementById('results-table');
|
| 17 |
+
const resultsList = document.getElementById('results-list');
|
| 18 |
+
const selectAllCheckbox = document.getElementById('select-all-checkbox');
|
| 19 |
+
const btnCopyAllTop = document.getElementById('btn-copy-all-top');
|
| 20 |
+
|
| 21 |
+
const bulkActions = document.getElementById('bulk-actions');
|
| 22 |
+
const selectedCount = document.getElementById('selected-count');
|
| 23 |
+
const btnBulkCopy = document.getElementById('btn-bulk-copy');
|
| 24 |
+
const btnBulkOpen = document.getElementById('btn-bulk-open');
|
| 25 |
+
const btnBulkDownload = document.getElementById('btn-bulk-download');
|
| 26 |
+
const toast = document.getElementById('toast');
|
| 27 |
+
|
| 28 |
+
let activeQueue = null;
|
| 29 |
+
let parsedResults = [];
|
| 30 |
+
|
| 31 |
+
// Check if we are running in full tab mode
|
| 32 |
+
const urlParams = new URLSearchParams(window.location.search);
|
| 33 |
+
const isTab = urlParams.get('mode') === 'tab' || window.innerWidth > 700;
|
| 34 |
+
if (isTab) {
|
| 35 |
+
btnExpand.classList.add('hidden');
|
| 36 |
+
// Adapt layout width for tab
|
| 37 |
+
document.body.style.width = '100%';
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
// Expand to tab event
|
| 41 |
+
btnExpand.addEventListener('click', () => {
|
| 42 |
+
chrome.tabs.create({ url: chrome.runtime.getURL('popup.html?mode=tab') });
|
| 43 |
+
});
|
| 44 |
+
|
| 45 |
+
// Clear Input
|
| 46 |
+
btnClearInput.addEventListener('click', () => {
|
| 47 |
+
urlsInput.value = '';
|
| 48 |
+
urlsInput.focus();
|
| 49 |
+
});
|
| 50 |
+
|
| 51 |
+
// Extract HLS Event
|
| 52 |
+
btnExtract.addEventListener('click', () => {
|
| 53 |
+
if (activeQueue) {
|
| 54 |
+
activeQueue.cancel();
|
| 55 |
+
activeQueue = null;
|
| 56 |
+
}
|
| 57 |
+
startExtraction();
|
| 58 |
+
});
|
| 59 |
+
|
| 60 |
+
// Select All Results
|
| 61 |
+
selectAllCheckbox.addEventListener('change', () => {
|
| 62 |
+
const checkboxes = resultsList.querySelectorAll('input[type="checkbox"]:not(:disabled)');
|
| 63 |
+
checkboxes.forEach(cb => {
|
| 64 |
+
cb.checked = selectAllCheckbox.checked;
|
| 65 |
+
});
|
| 66 |
+
updateSelectedCount();
|
| 67 |
+
});
|
| 68 |
+
|
| 69 |
+
// Copy All Successful URLs (Top Button)
|
| 70 |
+
btnCopyAllTop.addEventListener('click', () => {
|
| 71 |
+
const urls = parsedResults
|
| 72 |
+
.filter(item => item.success)
|
| 73 |
+
.map(item => item.hlsUrl);
|
| 74 |
+
if (urls.length === 0) return;
|
| 75 |
+
|
| 76 |
+
navigator.clipboard.writeText(urls.join('\n')).then(() => {
|
| 77 |
+
showToast(`¡Copiados ${urls.length} enlaces!`);
|
| 78 |
+
});
|
| 79 |
+
});
|
| 80 |
+
|
| 81 |
+
// Bulk Actions
|
| 82 |
+
btnBulkCopy.addEventListener('click', () => {
|
| 83 |
+
const urls = getSelectedUrls();
|
| 84 |
+
if (urls.length === 0) return;
|
| 85 |
+
|
| 86 |
+
navigator.clipboard.writeText(urls.join('\n')).then(() => {
|
| 87 |
+
showToast(`¡Copiados ${urls.length} enlaces!`);
|
| 88 |
+
});
|
| 89 |
+
});
|
| 90 |
+
|
| 91 |
+
btnBulkOpen.addEventListener('click', () => {
|
| 92 |
+
const urls = getSelectedUrls();
|
| 93 |
+
if (urls.length === 0) return;
|
| 94 |
+
|
| 95 |
+
if (confirm(`¿Deseas abrir ${urls.length} enlaces en una nueva ventana?`)) {
|
| 96 |
+
chrome.windows.create({ url: urls[0] }, (win) => {
|
| 97 |
+
for (let i = 1; i < urls.length; i++) {
|
| 98 |
+
chrome.tabs.create({ windowId: win.id, url: urls[i] });
|
| 99 |
+
}
|
| 100 |
+
});
|
| 101 |
+
}
|
| 102 |
+
});
|
| 103 |
+
|
| 104 |
+
btnBulkDownload.addEventListener('click', () => {
|
| 105 |
+
const selected = getSelectedItems();
|
| 106 |
+
if (selected.length === 0) return;
|
| 107 |
+
|
| 108 |
+
let m3uText = '#EXTM3U\n';
|
| 109 |
+
selected.forEach(item => {
|
| 110 |
+
m3uText += `#EXTINF:-1,${item.title} [${item.quality}]\n${item.hlsUrl}\n`;
|
| 111 |
+
});
|
| 112 |
+
|
| 113 |
+
const blob = new Blob([m3uText], { type: 'text/plain;charset=utf-8' });
|
| 114 |
+
const downloadUrl = URL.createObjectURL(blob);
|
| 115 |
+
const a = document.createElement('a');
|
| 116 |
+
a.href = downloadUrl;
|
| 117 |
+
a.download = `buscador_hls_lista_${Date.now()}.m3u`;
|
| 118 |
+
a.click();
|
| 119 |
+
URL.revokeObjectURL(downloadUrl);
|
| 120 |
+
showToast('Lista exportada como M3U');
|
| 121 |
+
});
|
| 122 |
+
|
| 123 |
+
// Main Extraction Flow
|
| 124 |
+
async function startExtraction() {
|
| 125 |
+
const rawInput = urlsInput.value.trim();
|
| 126 |
+
if (!rawInput) {
|
| 127 |
+
showToast('Por favor, ingresa al menos una URL.');
|
| 128 |
+
return;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
// Split and clean URLs
|
| 132 |
+
const urls = rawInput.split('\n')
|
| 133 |
+
.map(url => url.trim())
|
| 134 |
+
.filter(url => url.length > 0);
|
| 135 |
+
|
| 136 |
+
if (urls.length === 0) {
|
| 137 |
+
showToast('No se encontraron URLs válidas.');
|
| 138 |
+
return;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
// Reset UI state
|
| 142 |
+
parsedResults = [];
|
| 143 |
+
resultsList.innerHTML = '';
|
| 144 |
+
resultsPlaceholder.classList.add('hidden');
|
| 145 |
+
resultsTable.classList.remove('hidden');
|
| 146 |
+
bulkActions.classList.add('hidden');
|
| 147 |
+
btnCopyAllTop.classList.add('hidden');
|
| 148 |
+
resultsCount.textContent = '0';
|
| 149 |
+
selectAllCheckbox.checked = true;
|
| 150 |
+
|
| 151 |
+
// Show Progress
|
| 152 |
+
progressSection.classList.remove('hidden');
|
| 153 |
+
updateProgress(0, urls.length, 'Iniciando escaneo...');
|
| 154 |
+
|
| 155 |
+
const concurrency = parseInt(concurrencySelect.value, 10);
|
| 156 |
+
const tasks = urls.map(url => {
|
| 157 |
+
const taskFn = () => processVideoUrl(url);
|
| 158 |
+
taskFn.url = url; // attach metadata
|
| 159 |
+
return taskFn;
|
| 160 |
+
});
|
| 161 |
+
|
| 162 |
+
activeQueue = new Queue(
|
| 163 |
+
tasks,
|
| 164 |
+
concurrency,
|
| 165 |
+
// Progress Callback
|
| 166 |
+
(completed, total) => {
|
| 167 |
+
const percent = Math.round((completed / total) * 100);
|
| 168 |
+
updateProgress(percent, total, `Procesando: ${completed} de ${total}`);
|
| 169 |
+
},
|
| 170 |
+
// Completion Callback
|
| 171 |
+
(results) => {
|
| 172 |
+
activeQueue = null;
|
| 173 |
+
progressSection.classList.add('hidden');
|
| 174 |
+
parsedResults = results;
|
| 175 |
+
renderResults();
|
| 176 |
+
}
|
| 177 |
+
);
|
| 178 |
+
|
| 179 |
+
activeQueue.start();
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
// Helper to extract HLS master URL from Pornhub HTML page
|
| 183 |
+
function extractPornhubHls(html) {
|
| 184 |
+
if (!html) return null;
|
| 185 |
+
|
| 186 |
+
// Unescape JSON escaped slashes in HTML (e.g. https:\/\/... -> https://...)
|
| 187 |
+
const unescapedHtml = html.replace(/\\\/javascript/g, '').replace(/\\\//g, '/');
|
| 188 |
+
|
| 189 |
+
// 1. Robust bracket-matching parser for mediaDefinitions array in JS
|
| 190 |
+
let mediaDefs = [];
|
| 191 |
+
const mediaDefIndex = unescapedHtml.indexOf('mediaDefinitions');
|
| 192 |
+
if (mediaDefIndex !== -1) {
|
| 193 |
+
const startArr = unescapedHtml.indexOf('[', mediaDefIndex);
|
| 194 |
+
if (startArr !== -1) {
|
| 195 |
+
let depth = 0;
|
| 196 |
+
let endArr = -1;
|
| 197 |
+
for (let i = startArr; i < unescapedHtml.length; i++) {
|
| 198 |
+
if (unescapedHtml[i] === '[') depth++;
|
| 199 |
+
else if (unescapedHtml[i] === ']') {
|
| 200 |
+
depth--;
|
| 201 |
+
if (depth === 0) {
|
| 202 |
+
endArr = i;
|
| 203 |
+
break;
|
| 204 |
+
}
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
if (endArr !== -1) {
|
| 208 |
+
const jsonStr = unescapedHtml.substring(startArr, endArr + 1);
|
| 209 |
+
try {
|
| 210 |
+
mediaDefs = JSON.parse(jsonStr);
|
| 211 |
+
} catch (e) {
|
| 212 |
+
console.log('Failed parsing mediaDefinitions JSON block', e);
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
if (Array.isArray(mediaDefs) && mediaDefs.length > 0) {
|
| 219 |
+
// Filter valid HLS videoUrls
|
| 220 |
+
const hlsDefs = mediaDefs.filter(item => item.videoUrl && typeof item.videoUrl === 'string' && item.videoUrl.trim() !== '' && (item.format === 'hls' || item.videoUrl.includes('.m3u8')));
|
| 221 |
+
|
| 222 |
+
if (hlsDefs.length > 0) {
|
| 223 |
+
// Sort by quality height descending (1080 > 720 > 480 > 240)
|
| 224 |
+
hlsDefs.sort((a, b) => {
|
| 225 |
+
const qA = parseInt(a.quality, 10) || a.height || 0;
|
| 226 |
+
const qB = parseInt(b.quality, 10) || b.height || 0;
|
| 227 |
+
return qB - qA;
|
| 228 |
+
});
|
| 229 |
+
|
| 230 |
+
// Prioritize path-tokenized URLs (/TOKEN,TIMESTAMP/hls/) if provided by Pornhub
|
| 231 |
+
const pathTokenized = hlsDefs.find(item => /\/[^\/]+,\d+\/hls\//i.test(item.videoUrl));
|
| 232 |
+
if (pathTokenized) return pathTokenized.videoUrl;
|
| 233 |
+
|
| 234 |
+
// Return highest quality HLS videoUrl directly from mediaDefinitions
|
| 235 |
+
return hlsDefs[0].videoUrl;
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
// 2. Direct regex search for master.m3u8 URLs in unescaped HTML
|
| 240 |
+
const masterRegex = /(https?:\/\/[^"'\s\<\>]+\/hls\/[^"'\s\<\>]+\.m3u8[^"'\s\<\>]*)/i;
|
| 241 |
+
const masterMatch = unescapedHtml.match(masterRegex);
|
| 242 |
+
if (masterMatch && masterMatch[1]) {
|
| 243 |
+
return masterMatch[1];
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
return null;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
|
| 253 |
+
// Individual URL processing
|
| 254 |
+
async function processVideoUrl(url) {
|
| 255 |
+
try {
|
| 256 |
+
// Validate schema/domain
|
| 257 |
+
let cleanUrl = url;
|
| 258 |
+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
| 259 |
+
cleanUrl = 'https://' + url;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
const parsedUrl = new URL(cleanUrl);
|
| 263 |
+
const isXVideos = parsedUrl.hostname.includes('xvideos');
|
| 264 |
+
const isPornhub = parsedUrl.hostname.includes('pornhub.com');
|
| 265 |
+
|
| 266 |
+
if (!isXVideos && !isPornhub) {
|
| 267 |
+
throw new Error('Solo se admiten enlaces de XVideos y Pornhub');
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
// 1. Fetch Video Page
|
| 271 |
+
const response = await fetch(cleanUrl);
|
| 272 |
+
if (!response.ok) {
|
| 273 |
+
throw new Error(`Petición fallida (${response.status})`);
|
| 274 |
+
}
|
| 275 |
+
const html = await response.text();
|
| 276 |
+
|
| 277 |
+
// 2. Extract Title
|
| 278 |
+
const title = extractTitle(html, parsedUrl.pathname);
|
| 279 |
+
|
| 280 |
+
let masterHlsUrl = null;
|
| 281 |
+
|
| 282 |
+
if (isXVideos) {
|
| 283 |
+
// Extract XVideos Master HLS Url
|
| 284 |
+
const hlsRegex = /html5player\.setVideoHLS\s*\(\s*['"]([^'"]+)['"]/i;
|
| 285 |
+
const hlsMatch = html.match(hlsRegex);
|
| 286 |
+
|
| 287 |
+
if (hlsMatch && hlsMatch[1]) {
|
| 288 |
+
masterHlsUrl = hlsMatch[1];
|
| 289 |
+
} else {
|
| 290 |
+
// Fallback: Check direct high-quality MP4
|
| 291 |
+
const mp4HighRegex = /html5player\.setVideoUrlHigh\s*\(\s*['"]([^'"]+)['"]/i;
|
| 292 |
+
const mp4HighMatch = html.match(mp4HighRegex);
|
| 293 |
+
if (mp4HighMatch && mp4HighMatch[1]) {
|
| 294 |
+
return {
|
| 295 |
+
originalUrl: cleanUrl,
|
| 296 |
+
title: title,
|
| 297 |
+
hlsUrl: mp4HighMatch[1],
|
| 298 |
+
quality: 'HD (MP4)',
|
| 299 |
+
success: true
|
| 300 |
+
};
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
} else if (isPornhub) {
|
| 304 |
+
// Extract Pornhub Master HLS Url
|
| 305 |
+
masterHlsUrl = extractPornhubHls(html);
|
| 306 |
+
if (masterHlsUrl) {
|
| 307 |
+
masterHlsUrl = convertToPathTokenPornhubUrl(masterHlsUrl);
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
if (masterHlsUrl) {
|
| 312 |
+
// 3. Resolve Maximum Quality m3u8
|
| 313 |
+
const resolved = await resolveMaxQualityHLS(masterHlsUrl);
|
| 314 |
+
let finalHlsUrl = resolved.url;
|
| 315 |
+
if (isPornhub) {
|
| 316 |
+
finalHlsUrl = convertToPathTokenPornhubUrl(finalHlsUrl);
|
| 317 |
+
}
|
| 318 |
+
return {
|
| 319 |
+
originalUrl: cleanUrl,
|
| 320 |
+
title: title,
|
| 321 |
+
hlsUrl: finalHlsUrl,
|
| 322 |
+
quality: resolved.quality,
|
| 323 |
+
success: true
|
| 324 |
+
};
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
throw new Error('No se detectó flujo HLS ni descarga MP4');
|
| 328 |
+
} catch (e) {
|
| 329 |
+
console.error(`Error processing URL: ${url}`, e);
|
| 330 |
+
return {
|
| 331 |
+
originalUrl: url,
|
| 332 |
+
title: url,
|
| 333 |
+
error: e.message,
|
| 334 |
+
success: false
|
| 335 |
+
};
|
| 336 |
+
}
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
// Resolve sub-playlists from Master Playlist to get the absolute maximum quality stream
|
| 340 |
+
async function resolveMaxQualityHLS(masterUrl) {
|
| 341 |
+
try {
|
| 342 |
+
const response = await fetch(masterUrl);
|
| 343 |
+
if (!response.ok) {
|
| 344 |
+
if (masterUrl.includes('phncdn.com') && masterUrl.includes('/master.m3u8')) {
|
| 345 |
+
const directStreamUrl = masterUrl.replace(/\/master\.m3u8/i, '/index-v1-a1.m3u8');
|
| 346 |
+
return { url: directStreamUrl, quality: '1080p (HLS)' };
|
| 347 |
+
}
|
| 348 |
+
return { url: masterUrl, quality: 'HLS' };
|
| 349 |
+
}
|
| 350 |
+
const text = await response.text();
|
| 351 |
+
|
| 352 |
+
const lines = text.split(/\r?\n/);
|
| 353 |
+
const streams = [];
|
| 354 |
+
|
| 355 |
+
for (let i = 0; i < lines.length; i++) {
|
| 356 |
+
const line = lines[i].trim();
|
| 357 |
+
if (line.startsWith('#EXT-X-STREAM-INF:')) {
|
| 358 |
+
// Resolution parsing (e.g. RESOLUTION=1920x1080)
|
| 359 |
+
const resMatch = line.match(/RESOLUTION=(\d+)x(\d+)/i);
|
| 360 |
+
const nameMatch = line.match(/NAME="?([^",]+)"?/i);
|
| 361 |
+
|
| 362 |
+
let height = 0;
|
| 363 |
+
let qualityName = '';
|
| 364 |
+
|
| 365 |
+
if (resMatch) {
|
| 366 |
+
height = parseInt(resMatch[2], 10);
|
| 367 |
+
qualityName = `${height}p`;
|
| 368 |
+
} else if (nameMatch) {
|
| 369 |
+
qualityName = nameMatch[1];
|
| 370 |
+
height = parseInt(qualityName, 10) || 0;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
if (i + 1 < lines.length) {
|
| 374 |
+
const streamUrl = lines[i + 1].trim();
|
| 375 |
+
if (streamUrl && !streamUrl.startsWith('#')) {
|
| 376 |
+
// Build absolute URL relative to the master playlist URL
|
| 377 |
+
const absoluteUrl = new URL(streamUrl, masterUrl).href;
|
| 378 |
+
streams.push({
|
| 379 |
+
url: absoluteUrl,
|
| 380 |
+
height: height,
|
| 381 |
+
name: qualityName || `${height}p`
|
| 382 |
+
});
|
| 383 |
+
}
|
| 384 |
+
}
|
| 385 |
+
}
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
if (streams.length > 0) {
|
| 389 |
+
// Sort by resolution height descending (highest quality first)
|
| 390 |
+
streams.sort((a, b) => b.height - a.height);
|
| 391 |
+
return {
|
| 392 |
+
url: streams[0].url,
|
| 393 |
+
quality: streams[0].name
|
| 394 |
+
};
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
// Check if there are relative m3u8 playlists listed in raw text
|
| 398 |
+
const rawM3u8Regex = /[^\s#]+\.m3u8[^\s]*/g;
|
| 399 |
+
const matches = text.match(rawM3u8Regex);
|
| 400 |
+
if (matches && matches.length > 0) {
|
| 401 |
+
let bestUrl = matches[0];
|
| 402 |
+
// Prefer one containing 1080, 720, or v1
|
| 403 |
+
for (const matchUrl of matches) {
|
| 404 |
+
if (matchUrl.includes('1080') || matchUrl.includes('v1')) {
|
| 405 |
+
bestUrl = matchUrl;
|
| 406 |
+
break;
|
| 407 |
+
}
|
| 408 |
+
}
|
| 409 |
+
return {
|
| 410 |
+
url: new URL(bestUrl, masterUrl).href,
|
| 411 |
+
quality: bestUrl.includes('1080') ? '1080p' : 'HLS'
|
| 412 |
+
};
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
if (masterUrl.includes('phncdn.com') && masterUrl.includes('/master.m3u8')) {
|
| 416 |
+
const directStreamUrl = masterUrl.replace(/\/master\.m3u8/i, '/index-v1-a1.m3u8');
|
| 417 |
+
return { url: directStreamUrl, quality: '1080p (HLS)' };
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
return { url: masterUrl, quality: 'HLS' };
|
| 421 |
+
} catch (e) {
|
| 422 |
+
console.error('resolveMaxQualityHLS failed:', e);
|
| 423 |
+
if (masterUrl.includes('phncdn.com') && masterUrl.includes('/master.m3u8')) {
|
| 424 |
+
const directStreamUrl = masterUrl.replace(/\/master\.m3u8/i, '/index-v1-a1.m3u8');
|
| 425 |
+
return { url: directStreamUrl, quality: '1080p (HLS)' };
|
| 426 |
+
}
|
| 427 |
+
return { url: masterUrl, quality: 'HLS (Default)' };
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
// Scrape Page Title helper
|
| 432 |
+
function extractTitle(html, fallback) {
|
| 433 |
+
const ogTitleMatch = html.match(/<meta\s+property=["']og:title["']\s+content=["']([^"']+)["']/i) ||
|
| 434 |
+
html.match(/<meta\s+content=["']([^"']+)["']\s+property=["']og:title["']/i);
|
| 435 |
+
if (ogTitleMatch && ogTitleMatch[1]) {
|
| 436 |
+
let t = decodeHtmlEntities(ogTitleMatch[1].trim());
|
| 437 |
+
t = t.replace(/\s*-\s*Pornhub\.com\s*/i, '').replace(/\s*-\s*Pornhub\s*/i, '');
|
| 438 |
+
return t;
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
const titleMatch = html.match(/<title>(.*?)<\/title>/i);
|
| 442 |
+
if (titleMatch && titleMatch[1]) {
|
| 443 |
+
let t = titleMatch[1].trim();
|
| 444 |
+
t = t.replace(/\s*-\s*XVideos\.com\s*/i, '');
|
| 445 |
+
t = t.replace(/\s*-\s*XVIDEOS\.ES\s*/i, '');
|
| 446 |
+
t = t.replace(/\s*-\s*XVideos2\.com\s*/i, '');
|
| 447 |
+
t = t.replace(/\s*-\s*Pornhub\.com\s*/i, '');
|
| 448 |
+
t = t.replace(/\s*-\s*Pornhub\s*/i, '');
|
| 449 |
+
return decodeHtmlEntities(t);
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
return fallback;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
function decodeHtmlEntities(str) {
|
| 456 |
+
return str.replace(/&/g, '&')
|
| 457 |
+
.replace(/</g, '<')
|
| 458 |
+
.replace(/>/g, '>')
|
| 459 |
+
.replace(/"/g, '"')
|
| 460 |
+
.replace(/'/g, "'")
|
| 461 |
+
.replace(/ /g, ' ');
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
// Render Results List in UI
|
| 465 |
+
function renderResults() {
|
| 466 |
+
resultsList.innerHTML = '';
|
| 467 |
+
let successCount = 0;
|
| 468 |
+
|
| 469 |
+
parsedResults.forEach((res, index) => {
|
| 470 |
+
const tr = document.createElement('tr');
|
| 471 |
+
|
| 472 |
+
if (!res.success) {
|
| 473 |
+
tr.className = 'error-row';
|
| 474 |
+
tr.innerHTML = `
|
| 475 |
+
<td><input type="checkbox" disabled></td>
|
| 476 |
+
<td>
|
| 477 |
+
<div class="video-cell">
|
| 478 |
+
<span class="video-title" style="color: #ef4444;" title="${res.originalUrl}">Error al procesar</span>
|
| 479 |
+
<span class="video-url">${res.error || 'Error desconocido'}</span>
|
| 480 |
+
</div>
|
| 481 |
+
</td>
|
| 482 |
+
<td><span class="quality-tag quality-error">Fallo</span></td>
|
| 483 |
+
<td>
|
| 484 |
+
<div class="actions-cell">
|
| 485 |
+
<button class="btn-actions-row btn-copy-page" data-url="${res.originalUrl}" title="Copiar URL original">
|
| 486 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 487 |
+
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
|
| 488 |
+
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
|
| 489 |
+
</svg>
|
| 490 |
+
</button>
|
| 491 |
+
</div>
|
| 492 |
+
</td>
|
| 493 |
+
`;
|
| 494 |
+
} else {
|
| 495 |
+
successCount++;
|
| 496 |
+
const qClass = `quality-${res.quality.toLowerCase().replace(/[^a-z0-9]/g, '')}`;
|
| 497 |
+
tr.innerHTML = `
|
| 498 |
+
<td><input type="checkbox" class="result-item-checkbox" data-index="${index}" checked></td>
|
| 499 |
+
<td>
|
| 500 |
+
<div class="video-cell">
|
| 501 |
+
<span class="video-title" title="${res.title}">${res.title}</span>
|
| 502 |
+
<span class="video-url" title="${res.hlsUrl}"><a href="${res.hlsUrl}" target="_blank">${res.hlsUrl}</a></span>
|
| 503 |
+
</div>
|
| 504 |
+
</td>
|
| 505 |
+
<td><span class="quality-tag ${qClass}">${res.quality}</span></td>
|
| 506 |
+
<td>
|
| 507 |
+
<div class="actions-cell">
|
| 508 |
+
<button class="btn-actions-row btn-copy-row" data-index="${index}" title="Copiar enlace HLS">
|
| 509 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 510 |
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
| 511 |
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
| 512 |
+
</svg>
|
| 513 |
+
</button>
|
| 514 |
+
<button class="btn-actions-row btn-open-row" data-url="${res.hlsUrl}" title="Abrir transmisión">
|
| 515 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 516 |
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
|
| 517 |
+
<polyline points="15 3 21 3 21 9"></polyline>
|
| 518 |
+
<line x1="10" y1="14" x2="21" y2="3"></line>
|
| 519 |
+
</svg>
|
| 520 |
+
</button>
|
| 521 |
+
</div>
|
| 522 |
+
</td>
|
| 523 |
+
`;
|
| 524 |
+
}
|
| 525 |
+
resultsList.appendChild(tr);
|
| 526 |
+
});
|
| 527 |
+
|
| 528 |
+
resultsCount.textContent = successCount;
|
| 529 |
+
|
| 530 |
+
if (successCount > 0) {
|
| 531 |
+
btnCopyAllTop.classList.remove('hidden');
|
| 532 |
+
bulkActions.classList.remove('hidden');
|
| 533 |
+
setupRowEventListeners();
|
| 534 |
+
updateSelectedCount();
|
| 535 |
+
} else {
|
| 536 |
+
btnCopyAllTop.classList.add('hidden');
|
| 537 |
+
if (parsedResults.length > 0) {
|
| 538 |
+
// All failed
|
| 539 |
+
setupRowEventListeners();
|
| 540 |
+
} else {
|
| 541 |
+
// Empty
|
| 542 |
+
resultsPlaceholder.classList.remove('hidden');
|
| 543 |
+
resultsTable.classList.add('hidden');
|
| 544 |
+
}
|
| 545 |
+
}
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
// Row operations listeners
|
| 549 |
+
function setupRowEventListeners() {
|
| 550 |
+
// Checkboxes change
|
| 551 |
+
const checkboxes = resultsList.querySelectorAll('.result-item-checkbox');
|
| 552 |
+
checkboxes.forEach(cb => {
|
| 553 |
+
cb.addEventListener('change', () => {
|
| 554 |
+
updateSelectedCount();
|
| 555 |
+
// Sync master select checkbox
|
| 556 |
+
const allChecked = Array.from(checkboxes).every(c => c.checked);
|
| 557 |
+
selectAllCheckbox.checked = allChecked;
|
| 558 |
+
});
|
| 559 |
+
});
|
| 560 |
+
|
| 561 |
+
// Copy row button
|
| 562 |
+
resultsList.querySelectorAll('.btn-copy-row').forEach(btn => {
|
| 563 |
+
btn.addEventListener('click', (e) => {
|
| 564 |
+
const index = parseInt(btn.dataset.index, 10);
|
| 565 |
+
const item = parsedResults[index];
|
| 566 |
+
navigator.clipboard.writeText(item.hlsUrl).then(() => {
|
| 567 |
+
showToast('¡Enlace HLS copiado!');
|
| 568 |
+
btn.classList.add('success-toast');
|
| 569 |
+
setTimeout(() => btn.classList.remove('success-toast'), 1500);
|
| 570 |
+
});
|
| 571 |
+
});
|
| 572 |
+
});
|
| 573 |
+
|
| 574 |
+
// Copy error raw link
|
| 575 |
+
resultsList.querySelectorAll('.btn-copy-page').forEach(btn => {
|
| 576 |
+
btn.addEventListener('click', () => {
|
| 577 |
+
const url = btn.dataset.url;
|
| 578 |
+
navigator.clipboard.writeText(url).then(() => {
|
| 579 |
+
showToast('URL original copiada');
|
| 580 |
+
});
|
| 581 |
+
});
|
| 582 |
+
});
|
| 583 |
+
|
| 584 |
+
// Open row button
|
| 585 |
+
resultsList.querySelectorAll('.btn-open-row').forEach(btn => {
|
| 586 |
+
btn.addEventListener('click', () => {
|
| 587 |
+
const url = btn.dataset.url;
|
| 588 |
+
chrome.tabs.create({ url: url });
|
| 589 |
+
});
|
| 590 |
+
});
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
// Update selected badge
|
| 594 |
+
function updateSelectedCount() {
|
| 595 |
+
const count = getSelectedUrls().length;
|
| 596 |
+
selectedCount.textContent = `${count} seleccionado${count !== 1 ? 's' : ''}`;
|
| 597 |
+
|
| 598 |
+
// Disable/Enable bulk buttons
|
| 599 |
+
btnBulkCopy.disabled = count === 0;
|
| 600 |
+
btnBulkOpen.disabled = count === 0;
|
| 601 |
+
btnBulkDownload.disabled = count === 0;
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
// Retrieve selections
|
| 605 |
+
function getSelectedUrls() {
|
| 606 |
+
const selectedUrls = [];
|
| 607 |
+
const checkboxes = resultsList.querySelectorAll('.result-item-checkbox:checked');
|
| 608 |
+
checkboxes.forEach(cb => {
|
| 609 |
+
const index = parseInt(cb.dataset.index, 10);
|
| 610 |
+
selectedUrls.push(parsedResults[index].hlsUrl);
|
| 611 |
+
});
|
| 612 |
+
return selectedUrls;
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
function getSelectedItems() {
|
| 616 |
+
const selected = [];
|
| 617 |
+
const checkboxes = resultsList.querySelectorAll('.result-item-checkbox:checked');
|
| 618 |
+
checkboxes.forEach(cb => {
|
| 619 |
+
const index = parseInt(cb.dataset.index, 10);
|
| 620 |
+
selected.push(parsedResults[index]);
|
| 621 |
+
});
|
| 622 |
+
return selected;
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
// UI Helpers
|
| 626 |
+
function updateProgress(percentage, total, text) {
|
| 627 |
+
progressBar.style.width = `${percentage}%`;
|
| 628 |
+
progressStatus.textContent = text;
|
| 629 |
+
progressPercentage.textContent = `${percentage}%`;
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
function showToast(message) {
|
| 633 |
+
toast.textContent = message;
|
| 634 |
+
toast.classList.remove('hidden');
|
| 635 |
+
toast.classList.add('show');
|
| 636 |
+
|
| 637 |
+
setTimeout(() => {
|
| 638 |
+
toast.classList.remove('show');
|
| 639 |
+
setTimeout(() => toast.classList.add('hidden'), 300);
|
| 640 |
+
}, 2500);
|
| 641 |
+
}
|
| 642 |
+
});
|
| 643 |
+
|
| 644 |
+
// Simple Queue worker framework to run requests in parallel with concurrency limit
|
| 645 |
+
class Queue {
|
| 646 |
+
constructor(tasks, concurrency, progressCallback, completionCallback) {
|
| 647 |
+
this.tasks = tasks;
|
| 648 |
+
this.concurrency = concurrency;
|
| 649 |
+
this.progressCallback = progressCallback;
|
| 650 |
+
this.completionCallback = completionCallback;
|
| 651 |
+
|
| 652 |
+
this.activeCount = 0;
|
| 653 |
+
this.completedCount = 0;
|
| 654 |
+
this.currentIndex = 0;
|
| 655 |
+
this.results = [];
|
| 656 |
+
this.isCancelled = false;
|
| 657 |
+
}
|
| 658 |
+
|
| 659 |
+
start() {
|
| 660 |
+
if (this.tasks.length === 0) {
|
| 661 |
+
this.completionCallback([]);
|
| 662 |
+
return;
|
| 663 |
+
}
|
| 664 |
+
const limit = Math.min(this.concurrency, this.tasks.length);
|
| 665 |
+
for (let i = 0; i < limit; i++) {
|
| 666 |
+
this.next();
|
| 667 |
+
}
|
| 668 |
+
}
|
| 669 |
+
|
| 670 |
+
cancel() {
|
| 671 |
+
this.isCancelled = true;
|
| 672 |
+
}
|
| 673 |
+
|
| 674 |
+
next() {
|
| 675 |
+
if (this.isCancelled || this.currentIndex >= this.tasks.length) {
|
| 676 |
+
if (this.activeCount === 0) {
|
| 677 |
+
this.completionCallback(this.results);
|
| 678 |
+
}
|
| 679 |
+
return;
|
| 680 |
+
}
|
| 681 |
+
|
| 682 |
+
const index = this.currentIndex++;
|
| 683 |
+
const task = this.tasks[index];
|
| 684 |
+
this.activeCount++;
|
| 685 |
+
|
| 686 |
+
task().then(result => {
|
| 687 |
+
if (!this.isCancelled) {
|
| 688 |
+
this.results[index] = result;
|
| 689 |
+
}
|
| 690 |
+
}).catch(err => {
|
| 691 |
+
if (!this.isCancelled) {
|
| 692 |
+
this.results[index] = {
|
| 693 |
+
originalUrl: task.url || '',
|
| 694 |
+
title: task.url || 'Error',
|
| 695 |
+
error: err.message,
|
| 696 |
+
success: false
|
| 697 |
+
};
|
| 698 |
+
}
|
| 699 |
+
}).finally(() => {
|
| 700 |
+
this.activeCount--;
|
| 701 |
+
this.completedCount++;
|
| 702 |
+
|
| 703 |
+
if (!this.isCancelled) {
|
| 704 |
+
this.progressCallback(this.completedCount, this.tasks.length);
|
| 705 |
+
this.next();
|
| 706 |
+
}
|
| 707 |
+
});
|
| 708 |
+
}
|
| 709 |
+
}
|
detector de enlaces - copia/background.js
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
let videoScanState = {
|
| 2 |
+
isScanning: false,
|
| 3 |
+
scannedCount: 0,
|
| 4 |
+
totalCount: 0,
|
| 5 |
+
foundUrls: [],
|
| 6 |
+
albumUrls: [],
|
| 7 |
+
error: null
|
| 8 |
+
};
|
| 9 |
+
|
| 10 |
+
let imageScanState = {
|
| 11 |
+
isScanning: false,
|
| 12 |
+
scannedCount: 0,
|
| 13 |
+
totalCount: 0,
|
| 14 |
+
foundUrls: [],
|
| 15 |
+
albumUrls: [],
|
| 16 |
+
error: null
|
| 17 |
+
};
|
| 18 |
+
|
| 19 |
+
function isAlbumImageUrl(url) {
|
| 20 |
+
if (!url) return false;
|
| 21 |
+
const lower = url.toLowerCase();
|
| 22 |
+
if (lower.includes('/avatar/') || lower.includes('/icon/') || lower.includes('/logo/') || lower.includes('logo') || lower.includes('/thumbs/') || lower.includes('/img/')) {
|
| 23 |
+
return false;
|
| 24 |
+
}
|
| 25 |
+
return true;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
let activeNativePort = null;
|
| 29 |
+
let activeTaskState = {
|
| 30 |
+
isProcessing: false,
|
| 31 |
+
type: null,
|
| 32 |
+
status: 'idle',
|
| 33 |
+
info: '',
|
| 34 |
+
current: 0,
|
| 35 |
+
total: 0,
|
| 36 |
+
file: null,
|
| 37 |
+
error: null
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
// Initialize task state from storage if present
|
| 41 |
+
chrome.storage.local.get(['activeTask', 'videoScanState', 'imageScanState'], (res) => {
|
| 42 |
+
if (res.activeTask) activeTaskState = res.activeTask;
|
| 43 |
+
if (res.videoScanState) videoScanState = res.videoScanState;
|
| 44 |
+
if (res.imageScanState) imageScanState = res.imageScanState;
|
| 45 |
+
});
|
| 46 |
+
|
| 47 |
+
function updateTaskState(newState) {
|
| 48 |
+
activeTaskState = { ...activeTaskState, ...newState };
|
| 49 |
+
chrome.storage.local.set({ activeTask: activeTaskState }).catch(() => {});
|
| 50 |
+
chrome.runtime.sendMessage({ type: 'TASK_UPDATE', payload: activeTaskState }).catch(() => {});
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
function runNativeTask(msg, sendResponse) {
|
| 54 |
+
if (activeTaskState.isProcessing) {
|
| 55 |
+
if (sendResponse) sendResponse({ success: false, message: 'Un proceso ya está en ejecución' });
|
| 56 |
+
return;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
updateTaskState({
|
| 60 |
+
isProcessing: true,
|
| 61 |
+
type: msg.type,
|
| 62 |
+
status: 'started',
|
| 63 |
+
info: 'Iniciando conexión con Python...',
|
| 64 |
+
current: 0,
|
| 65 |
+
total: 0,
|
| 66 |
+
file: null,
|
| 67 |
+
error: null
|
| 68 |
+
});
|
| 69 |
+
|
| 70 |
+
try {
|
| 71 |
+
if (activeNativePort) {
|
| 72 |
+
try { activeNativePort.disconnect(); } catch (e) {}
|
| 73 |
+
activeNativePort = null;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
activeNativePort = chrome.runtime.connectNative("com.linkdetector.kemono");
|
| 77 |
+
|
| 78 |
+
activeNativePort.onMessage.addListener((nativeMsg) => {
|
| 79 |
+
if (nativeMsg.status === "progress") {
|
| 80 |
+
let infoStr = nativeMsg.info;
|
| 81 |
+
if (!infoStr && nativeMsg.current) {
|
| 82 |
+
infoStr = `Procesando ${nativeMsg.current}/${nativeMsg.total || '?'}`;
|
| 83 |
+
}
|
| 84 |
+
updateTaskState({
|
| 85 |
+
status: "progress",
|
| 86 |
+
current: nativeMsg.current || 0,
|
| 87 |
+
total: nativeMsg.total || 0,
|
| 88 |
+
info: infoStr || "Procesando en segundo plano..."
|
| 89 |
+
});
|
| 90 |
+
} else if (nativeMsg.status === "done") {
|
| 91 |
+
updateTaskState({
|
| 92 |
+
isProcessing: false,
|
| 93 |
+
status: "done",
|
| 94 |
+
info: nativeMsg.file ? `¡Guardado en ${nativeMsg.file}!` : "¡Completado exitosamente!",
|
| 95 |
+
file: nativeMsg.file
|
| 96 |
+
});
|
| 97 |
+
try { activeNativePort.disconnect(); } catch (e) {}
|
| 98 |
+
activeNativePort = null;
|
| 99 |
+
} else if (nativeMsg.status === "error") {
|
| 100 |
+
updateTaskState({
|
| 101 |
+
isProcessing: false,
|
| 102 |
+
status: "error",
|
| 103 |
+
error: nativeMsg.message || "Error en proceso Python",
|
| 104 |
+
info: "Error: " + (nativeMsg.message || "Error en Python")
|
| 105 |
+
});
|
| 106 |
+
try { activeNativePort.disconnect(); } catch (e) {}
|
| 107 |
+
activeNativePort = null;
|
| 108 |
+
}
|
| 109 |
+
});
|
| 110 |
+
|
| 111 |
+
activeNativePort.onDisconnect.addListener(() => {
|
| 112 |
+
let errMsg = chrome.runtime.lastError ? chrome.runtime.lastError.message : "Desconectado de Host";
|
| 113 |
+
if (activeTaskState.isProcessing) {
|
| 114 |
+
updateTaskState({
|
| 115 |
+
isProcessing: false,
|
| 116 |
+
status: "error",
|
| 117 |
+
error: errMsg,
|
| 118 |
+
info: errMsg.includes("host not found") ? "No se encontró el Host de Python. Ejecuta instalar_python_host.bat" : ("Conexión cerrada: " + errMsg)
|
| 119 |
+
});
|
| 120 |
+
}
|
| 121 |
+
activeNativePort = null;
|
| 122 |
+
});
|
| 123 |
+
|
| 124 |
+
// Obtener cookies de kemono.cr, kemono.su y pawchive.st para pasarlas a Python
|
| 125 |
+
chrome.cookies.getAll({ domain: "kemono.cr" }, (cookiesCR) => {
|
| 126 |
+
chrome.cookies.getAll({ domain: "kemono.su" }, (cookiesSU) => {
|
| 127 |
+
chrome.cookies.getAll({ domain: "pawchive.st" }, (cookiesPawchive) => {
|
| 128 |
+
let allCookies = [...cookiesCR, ...cookiesSU, ...cookiesPawchive];
|
| 129 |
+
let cookieStr = allCookies.map(c => c.name + "=" + c.value).join("; ");
|
| 130 |
+
let ua = navigator.userAgent;
|
| 131 |
+
|
| 132 |
+
msg.cookies = cookieStr;
|
| 133 |
+
msg.userAgent = ua;
|
| 134 |
+
|
| 135 |
+
if (activeNativePort) {
|
| 136 |
+
activeNativePort.postMessage(msg);
|
| 137 |
+
if (sendResponse) sendResponse({ success: true, state: activeTaskState });
|
| 138 |
+
}
|
| 139 |
+
});
|
| 140 |
+
});
|
| 141 |
+
});
|
| 142 |
+
} catch (e) {
|
| 143 |
+
updateTaskState({
|
| 144 |
+
isProcessing: false,
|
| 145 |
+
status: "error",
|
| 146 |
+
error: e.message,
|
| 147 |
+
info: "Error: " + e.message
|
| 148 |
+
});
|
| 149 |
+
if (sendResponse) sendResponse({ success: false, error: e.message });
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
| 154 |
+
if (message.type === 'GET_STATE') {
|
| 155 |
+
sendResponse({ video: videoScanState, image: imageScanState, activeTask: activeTaskState });
|
| 156 |
+
return true;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
if (message.type === 'START_NATIVE_TASK') {
|
| 160 |
+
runNativeTask(message.payload, sendResponse);
|
| 161 |
+
return true;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
if (message.type === 'GET_TASK_STATE') {
|
| 165 |
+
sendResponse(activeTaskState);
|
| 166 |
+
return true;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
if (message.type === 'FETCH_SURRIT') {
|
| 170 |
+
fetch(message.url, {
|
| 171 |
+
headers: {
|
| 172 |
+
'Referer': message.referer || 'https://surrit.store/',
|
| 173 |
+
'Origin': 'https://surrit.store'
|
| 174 |
+
}
|
| 175 |
+
})
|
| 176 |
+
.then(res => {
|
| 177 |
+
if (!res.ok) throw new Error('HTTP status ' + res.status);
|
| 178 |
+
return res.json();
|
| 179 |
+
})
|
| 180 |
+
.then(data => sendResponse({ success: true, data }))
|
| 181 |
+
.catch(err => sendResponse({ success: false, error: err.message }));
|
| 182 |
+
return true;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
if (message.type === 'START_SCAN') {
|
| 186 |
+
if (!videoScanState.isScanning) {
|
| 187 |
+
startScan(message.payload.albumUrls, message.payload.currentVideos);
|
| 188 |
+
}
|
| 189 |
+
sendResponse(videoScanState);
|
| 190 |
+
return true;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
if (message.type === 'RESET_SCAN') {
|
| 194 |
+
if (!videoScanState.isScanning) {
|
| 195 |
+
videoScanState = {
|
| 196 |
+
isScanning: false,
|
| 197 |
+
scannedCount: 0,
|
| 198 |
+
totalCount: 0,
|
| 199 |
+
foundUrls: [],
|
| 200 |
+
albumUrls: [],
|
| 201 |
+
error: null
|
| 202 |
+
};
|
| 203 |
+
chrome.storage.local.set({ videoScanState });
|
| 204 |
+
}
|
| 205 |
+
sendResponse(videoScanState);
|
| 206 |
+
return true;
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
if (message.type === 'START_IMAGE_SCAN') {
|
| 210 |
+
if (!imageScanState.isScanning) {
|
| 211 |
+
startImageScan(message.payload.albumUrls, message.payload.currentImages);
|
| 212 |
+
}
|
| 213 |
+
sendResponse(imageScanState);
|
| 214 |
+
return true;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
if (message.type === 'RESET_IMAGE_SCAN') {
|
| 218 |
+
if (!imageScanState.isScanning) {
|
| 219 |
+
imageScanState = {
|
| 220 |
+
isScanning: false,
|
| 221 |
+
scannedCount: 0,
|
| 222 |
+
totalCount: 0,
|
| 223 |
+
foundUrls: [],
|
| 224 |
+
albumUrls: [],
|
| 225 |
+
error: null
|
| 226 |
+
};
|
| 227 |
+
chrome.storage.local.set({ imageScanState });
|
| 228 |
+
}
|
| 229 |
+
sendResponse(imageScanState);
|
| 230 |
+
return true;
|
| 231 |
+
}
|
| 232 |
+
});
|
| 233 |
+
|
| 234 |
+
async function startScan(albumUrls, initialVideos) {
|
| 235 |
+
videoScanState.isScanning = true;
|
| 236 |
+
videoScanState.albumUrls = albumUrls;
|
| 237 |
+
videoScanState.totalCount = albumUrls.length;
|
| 238 |
+
videoScanState.scannedCount = 0;
|
| 239 |
+
videoScanState.foundUrls = Array.from(new Set(initialVideos || []));
|
| 240 |
+
videoScanState.error = null;
|
| 241 |
+
|
| 242 |
+
chrome.storage.local.set({ videoScanState });
|
| 243 |
+
chrome.runtime.sendMessage({ type: 'SCAN_UPDATE', payload: videoScanState }).catch(() => {});
|
| 244 |
+
|
| 245 |
+
for (const url of albumUrls) {
|
| 246 |
+
videoScanState.scannedCount++;
|
| 247 |
+
try {
|
| 248 |
+
let res = await fetch(url);
|
| 249 |
+
let text = await res.text();
|
| 250 |
+
|
| 251 |
+
let newUrls = new Set();
|
| 252 |
+
let srcMatches = text.matchAll(/src=["'](https?:\/\/[^"'\s]+\.mp4)['"]/gi);
|
| 253 |
+
for (const match of srcMatches) {
|
| 254 |
+
newUrls.add(match[1]);
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
let hrefMatches = text.matchAll(/href=["'](https?:\/\/[^"'\s]+\.mp4)['"]/gi);
|
| 258 |
+
for (const match of hrefMatches) {
|
| 259 |
+
newUrls.add(match[1]);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
for (const u of newUrls) {
|
| 263 |
+
if (!videoScanState.foundUrls.includes(u)) {
|
| 264 |
+
videoScanState.foundUrls.push(u);
|
| 265 |
+
}
|
| 266 |
+
}
|
| 267 |
+
} catch (e) {
|
| 268 |
+
console.error("Error fetching album", url, e);
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
chrome.storage.local.set({ videoScanState });
|
| 272 |
+
chrome.runtime.sendMessage({ type: 'SCAN_UPDATE', payload: videoScanState }).catch(() => {});
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
videoScanState.isScanning = false;
|
| 276 |
+
chrome.storage.local.set({ videoScanState });
|
| 277 |
+
chrome.runtime.sendMessage({ type: 'SCAN_UPDATE', payload: videoScanState }).catch(() => {});
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
async function startImageScan(albumUrls, initialImages) {
|
| 281 |
+
imageScanState.isScanning = true;
|
| 282 |
+
imageScanState.albumUrls = albumUrls;
|
| 283 |
+
imageScanState.totalCount = albumUrls.length;
|
| 284 |
+
imageScanState.scannedCount = 0;
|
| 285 |
+
imageScanState.foundUrls = Array.from(new Set(initialImages || []));
|
| 286 |
+
imageScanState.error = null;
|
| 287 |
+
|
| 288 |
+
chrome.storage.local.set({ imageScanState });
|
| 289 |
+
chrome.runtime.sendMessage({ type: 'IMAGE_SCAN_UPDATE', payload: imageScanState }).catch(() => {});
|
| 290 |
+
|
| 291 |
+
for (const url of albumUrls) {
|
| 292 |
+
imageScanState.scannedCount++;
|
| 293 |
+
const albumMatch = url.match(/erome\.com\/a\/([a-zA-Z0-9]+)/);
|
| 294 |
+
const albumId = albumMatch ? albumMatch[1] : null;
|
| 295 |
+
|
| 296 |
+
try {
|
| 297 |
+
let res = await fetch(url);
|
| 298 |
+
let text = await res.text();
|
| 299 |
+
|
| 300 |
+
let newUrls = new Set();
|
| 301 |
+
let imgMatches = text.matchAll(/https?:\/\/[a-z0-9\.]*erome\.com\/[^"'\s\)]+\.(?:jpg|jpeg|png|webp)(?:\?[^"'\s\)]+)?/gi);
|
| 302 |
+
for (const match of imgMatches) {
|
| 303 |
+
const imgUrl = match[0];
|
| 304 |
+
if (isAlbumImageUrl(imgUrl)) {
|
| 305 |
+
if (albumId && imgUrl.toLowerCase().includes('/' + albumId.toLowerCase() + '/')) {
|
| 306 |
+
newUrls.add(imgUrl);
|
| 307 |
+
}
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
for (const u of newUrls) {
|
| 312 |
+
if (!imageScanState.foundUrls.includes(u)) {
|
| 313 |
+
imageScanState.foundUrls.push(u);
|
| 314 |
+
}
|
| 315 |
+
}
|
| 316 |
+
} catch (e) {
|
| 317 |
+
console.error("Error fetching album", url, e);
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
chrome.storage.local.set({ imageScanState });
|
| 321 |
+
chrome.runtime.sendMessage({ type: 'IMAGE_SCAN_UPDATE', payload: imageScanState }).catch(() => {});
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
imageScanState.isScanning = false;
|
| 325 |
+
chrome.storage.local.set({ imageScanState });
|
| 326 |
+
chrome.runtime.sendMessage({ type: 'IMAGE_SCAN_UPDATE', payload: imageScanState }).catch(() => {});
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
// Proxy for Native Messaging (content scripts -> native host)
|
| 330 |
+
chrome.runtime.onConnect.addListener((port) => {
|
| 331 |
+
if (port.name === "kemono-native-proxy") {
|
| 332 |
+
const messageListener = (msg) => {
|
| 333 |
+
if (msg.type === "EXTRACT_KEMONO" || msg.type === "SAVE_KEMONO" || msg.type === "DOWNLOAD_IMAGES_KEMONO") {
|
| 334 |
+
runNativeTask(msg);
|
| 335 |
+
}
|
| 336 |
+
};
|
| 337 |
+
port.onMessage.addListener(messageListener);
|
| 338 |
+
|
| 339 |
+
const updateListener = (msg) => {
|
| 340 |
+
if (msg.type === "TASK_UPDATE") {
|
| 341 |
+
try { port.postMessage(msg.payload); } catch (e) {}
|
| 342 |
+
}
|
| 343 |
+
};
|
| 344 |
+
chrome.runtime.onMessage.addListener(updateListener);
|
| 345 |
+
|
| 346 |
+
port.onDisconnect.addListener(() => {
|
| 347 |
+
chrome.runtime.onMessage.removeListener(updateListener);
|
| 348 |
+
// DO NOT DISCONNECT activeNativePort HERE! Let native task complete in background!
|
| 349 |
+
});
|
| 350 |
+
}
|
| 351 |
+
});
|
detector de enlaces - copia/host/__pycache__/kemono_host.cpython-311.pyc
ADDED
|
Binary file (18.1 kB). View file
|
|
|
detector de enlaces - copia/host/com.linkdetector.kemono.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "com.linkdetector.kemono",
|
| 3 |
+
"description": "Extractor de enlaces de Kemono",
|
| 4 |
+
"path": "C:\\Users\\Gonzalo\\Desktop\\extesione sherrameitnas\\detector de enlaces - copia\\host\\kemono_host.bat",
|
| 5 |
+
"type": "stdio",
|
| 6 |
+
"allowed_origins": [
|
| 7 |
+
"chrome-extension://nonloheakmkaplfdedilgmlkdhohfnbc/"
|
| 8 |
+
]
|
| 9 |
+
}
|
detector de enlaces - copia/host/kemono_host.bat
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
pip show cloudscraper >nul 2>&1
|
| 3 |
+
if errorlevel 1 (
|
| 4 |
+
pip install cloudscraper
|
| 5 |
+
)
|
| 6 |
+
python "%~dp0kemono_host.py" %*
|
detector de enlaces - copia/host/kemono_host.py
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import json
|
| 3 |
+
import struct
|
| 4 |
+
import os
|
| 5 |
+
import time
|
| 6 |
+
import urllib.parse
|
| 7 |
+
import urllib.request
|
| 8 |
+
import re
|
| 9 |
+
try:
|
| 10 |
+
import cloudscraper
|
| 11 |
+
except ImportError:
|
| 12 |
+
cloudscraper = None
|
| 13 |
+
import concurrent.futures
|
| 14 |
+
import threading
|
| 15 |
+
|
| 16 |
+
def get_message():
|
| 17 |
+
raw_length = sys.stdin.buffer.read(4)
|
| 18 |
+
if len(raw_length) == 0:
|
| 19 |
+
return None
|
| 20 |
+
message_length = struct.unpack('@I', raw_length)[0]
|
| 21 |
+
message = sys.stdin.buffer.read(message_length).decode('utf-8')
|
| 22 |
+
return json.loads(message)
|
| 23 |
+
|
| 24 |
+
def encode_message(message_content):
|
| 25 |
+
encoded_content = json.dumps(message_content).encode('utf-8')
|
| 26 |
+
encoded_length = struct.pack('@I', len(encoded_content))
|
| 27 |
+
return {'length': encoded_length, 'content': encoded_content}
|
| 28 |
+
|
| 29 |
+
def send_message(message_content):
|
| 30 |
+
encoded = encode_message(message_content)
|
| 31 |
+
sys.stdout.buffer.write(encoded['length'])
|
| 32 |
+
sys.stdout.buffer.write(encoded['content'])
|
| 33 |
+
sys.stdout.buffer.flush()
|
| 34 |
+
|
| 35 |
+
def extract_links(urls, cookie_str, user_agent):
|
| 36 |
+
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
|
| 37 |
+
output_file = os.path.join(desktop, 'kemono_downloads_extraidos.txt')
|
| 38 |
+
|
| 39 |
+
send_message({"status": "started", "total": len(urls)})
|
| 40 |
+
|
| 41 |
+
unique_urls = list(set([u.rstrip('/') for u in urls]))
|
| 42 |
+
|
| 43 |
+
count = 0
|
| 44 |
+
scraper = cloudscraper.create_scraper(browser={'browser': 'chrome', 'platform': 'windows', 'desktop': True}) if cloudscraper else None
|
| 45 |
+
|
| 46 |
+
with open(output_file, 'a', encoding='utf-8') as f:
|
| 47 |
+
f.write("\n=========================================\n")
|
| 48 |
+
f.write(f"NUEVA EXTRACCION - {time.strftime('%Y-%m-%d %H:%M:%S')}\n")
|
| 49 |
+
f.write("=========================================\n\n")
|
| 50 |
+
|
| 51 |
+
# Configurar headers exactos del navegador Chrome del usuario
|
| 52 |
+
headers = {
|
| 53 |
+
'User-Agent': user_agent or 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
| 54 |
+
'Cookie': cookie_str or '',
|
| 55 |
+
'Accept': 'application/json, text/plain, */*'
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
for url in unique_urls:
|
| 59 |
+
count += 1
|
| 60 |
+
try:
|
| 61 |
+
parsed = urllib.parse.urlparse(url)
|
| 62 |
+
api_path = '/api/v1' + parsed.path
|
| 63 |
+
api_url = f"{parsed.scheme}://{parsed.netloc}{api_path}"
|
| 64 |
+
|
| 65 |
+
if scraper:
|
| 66 |
+
response = scraper.get(api_url, headers=headers)
|
| 67 |
+
response.raise_for_status()
|
| 68 |
+
data = response.json()
|
| 69 |
+
else:
|
| 70 |
+
req = urllib.request.Request(api_url, headers=headers)
|
| 71 |
+
with urllib.request.urlopen(req) as response:
|
| 72 |
+
data = json.loads(response.read().decode())
|
| 73 |
+
|
| 74 |
+
post_data = data.get('post', data)
|
| 75 |
+
title = post_data.get('title', 'Desconocido').strip()
|
| 76 |
+
author = post_data.get('user', 'Desconocido')
|
| 77 |
+
|
| 78 |
+
download_links = []
|
| 79 |
+
|
| 80 |
+
def is_image(name):
|
| 81 |
+
return bool(re.search(r'\.(jpg|jpeg|png|webp|gif|avif)$', name or '', re.I))
|
| 82 |
+
|
| 83 |
+
def construct_link(file_obj):
|
| 84 |
+
if not file_obj or not file_obj.get('path'): return None
|
| 85 |
+
path = file_obj['path']
|
| 86 |
+
if not path.startswith('http') and not path.startswith('/data'):
|
| 87 |
+
path = '/data' + ('' if path.startswith('/') else '/') + path
|
| 88 |
+
link = path if path.startswith('http') else f"{parsed.scheme}://{parsed.netloc}{path}"
|
| 89 |
+
if file_obj.get('name'):
|
| 90 |
+
link += f"?f={urllib.parse.quote(file_obj['name'])}"
|
| 91 |
+
return link
|
| 92 |
+
|
| 93 |
+
# Main file
|
| 94 |
+
if post_data.get('file') and post_data['file'].get('path'):
|
| 95 |
+
if not is_image(post_data['file'].get('name')):
|
| 96 |
+
lk = construct_link(post_data['file'])
|
| 97 |
+
if lk: download_links.append(lk)
|
| 98 |
+
|
| 99 |
+
# Attachments
|
| 100 |
+
attachs = post_data.get('attachments', []) or data.get('attachments', [])
|
| 101 |
+
for att in attachs:
|
| 102 |
+
if not is_image(att.get('name')):
|
| 103 |
+
lk = construct_link(att)
|
| 104 |
+
if lk: download_links.append(lk)
|
| 105 |
+
|
| 106 |
+
# Content links
|
| 107 |
+
content = post_data.get('content', '')
|
| 108 |
+
if content:
|
| 109 |
+
# Find all links in href="..." or basic urls
|
| 110 |
+
hrefs = re.findall(r'href=["\'](https?://[^"\']+)["\']', content)
|
| 111 |
+
urls_in_text = re.findall(r'(https?://[^\s<"\'\)]+)', content)
|
| 112 |
+
for u in set(hrefs + urls_in_text):
|
| 113 |
+
if ('kemono.cr' not in u and 'kemono.su' not in u and 'pawchive.st' not in u) or '/downloads' in u or '/data/' in u:
|
| 114 |
+
download_links.append(u)
|
| 115 |
+
|
| 116 |
+
download_links = list(set(download_links))
|
| 117 |
+
|
| 118 |
+
post_text = f"Titulo: {title}\nEnlace original: {url}\nAutor: {author}\nEnlaces de descarga:\n"
|
| 119 |
+
if download_links:
|
| 120 |
+
for idx, link in enumerate(download_links, 1):
|
| 121 |
+
post_text += f"({idx}) {link}\n"
|
| 122 |
+
else:
|
| 123 |
+
post_text += "No hay enlaces\n"
|
| 124 |
+
post_text += "\n"
|
| 125 |
+
|
| 126 |
+
f.write(post_text)
|
| 127 |
+
send_message({"status": "progress", "current": count, "total": len(unique_urls)})
|
| 128 |
+
|
| 129 |
+
time.sleep(1) # Be nice to the API
|
| 130 |
+
|
| 131 |
+
except Exception as e:
|
| 132 |
+
f.write(f"ERROR: {url} -> {str(e)}\n\n")
|
| 133 |
+
send_message({"status": "progress", "current": count, "total": len(unique_urls), "error": str(e)})
|
| 134 |
+
|
| 135 |
+
send_message({"status": "done", "file": output_file})
|
| 136 |
+
|
| 137 |
+
def clean_filename(name):
|
| 138 |
+
"""Remove invalid characters for Windows paths"""
|
| 139 |
+
return re.sub(r'[\\/:*?"<>|]', '', str(name)).strip()
|
| 140 |
+
|
| 141 |
+
def download_kemono_images(posts, cookie_str, user_agent):
|
| 142 |
+
downloads_dir = os.path.join(os.environ['USERPROFILE'], 'Downloads')
|
| 143 |
+
base_dir = os.path.join(downloads_dir, 'Kemono Images')
|
| 144 |
+
os.makedirs(base_dir, exist_ok=True)
|
| 145 |
+
|
| 146 |
+
send_message({"status": "started", "total": len(posts)})
|
| 147 |
+
|
| 148 |
+
scraper = cloudscraper.create_scraper(browser={'browser': 'chrome', 'platform': 'windows', 'desktop': True}) if cloudscraper else None
|
| 149 |
+
|
| 150 |
+
headers = {
|
| 151 |
+
'User-Agent': user_agent or 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
| 152 |
+
'Cookie': cookie_str or '',
|
| 153 |
+
'Accept': 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8'
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
total_images_all = sum(len(post.get('images', [])) for post in posts)
|
| 157 |
+
images_downloaded = 0
|
| 158 |
+
lock = threading.Lock()
|
| 159 |
+
|
| 160 |
+
def download_image(img_info):
|
| 161 |
+
nonlocal images_downloaded
|
| 162 |
+
|
| 163 |
+
post = img_info['post']
|
| 164 |
+
idx = img_info['idx']
|
| 165 |
+
img_url = img_info['url']
|
| 166 |
+
post_dir = img_info['dir']
|
| 167 |
+
title_clean = img_info['title']
|
| 168 |
+
|
| 169 |
+
try:
|
| 170 |
+
if not img_url.startswith('http'):
|
| 171 |
+
parsed = urllib.parse.urlparse(post.get('url'))
|
| 172 |
+
img_url = f"{parsed.scheme}://{parsed.netloc}{img_url}"
|
| 173 |
+
|
| 174 |
+
extMatch = re.search(r'\.(jpg|jpeg|png|webp|gif|avif)', img_url, re.I)
|
| 175 |
+
ext = extMatch.group(0).lower() if extMatch else '.jpg'
|
| 176 |
+
|
| 177 |
+
filename = f"img_{idx:03d}{ext}"
|
| 178 |
+
filepath = os.path.join(post_dir, filename)
|
| 179 |
+
|
| 180 |
+
if not os.path.exists(filepath):
|
| 181 |
+
if scraper:
|
| 182 |
+
response = scraper.get(img_url, headers=headers, stream=True)
|
| 183 |
+
response.raise_for_status()
|
| 184 |
+
with open(filepath, 'wb') as f:
|
| 185 |
+
for chunk in response.iter_content(chunk_size=8192):
|
| 186 |
+
if chunk: f.write(chunk)
|
| 187 |
+
else:
|
| 188 |
+
req = urllib.request.Request(img_url, headers=headers)
|
| 189 |
+
with urllib.request.urlopen(req) as response, open(filepath, 'wb') as out_file:
|
| 190 |
+
while True:
|
| 191 |
+
chunk = response.read(65536)
|
| 192 |
+
if not chunk: break
|
| 193 |
+
out_file.write(chunk)
|
| 194 |
+
except Exception:
|
| 195 |
+
pass
|
| 196 |
+
|
| 197 |
+
with lock:
|
| 198 |
+
images_downloaded += 1
|
| 199 |
+
if images_downloaded % 2 == 0 or images_downloaded == total_images_all:
|
| 200 |
+
send_message({"status": "progress", "current": images_downloaded, "total": total_images_all, "info": f"Descargando {images_downloaded}/{total_images_all}..."})
|
| 201 |
+
|
| 202 |
+
tasks = []
|
| 203 |
+
for post in posts:
|
| 204 |
+
author_clean = clean_filename(post.get('author', 'Unknown Author'))
|
| 205 |
+
title_clean = clean_filename(post.get('title', 'Unknown Title'))
|
| 206 |
+
|
| 207 |
+
url = post.get('url', '')
|
| 208 |
+
post_id = url.rstrip('/').split('/')[-1] if '/' in url else ''
|
| 209 |
+
if post_id and post_id.isdigit():
|
| 210 |
+
title_clean = f"{title_clean} [{post_id}]"
|
| 211 |
+
|
| 212 |
+
is_duplicate = post.get('isDuplicate', False)
|
| 213 |
+
base_target_dir = os.path.join(base_dir, 'Duplicados') if is_duplicate else base_dir
|
| 214 |
+
|
| 215 |
+
dup_idx = post.get('dupIndex')
|
| 216 |
+
if dup_idx:
|
| 217 |
+
title_clean = f"{title_clean} (Repetido {dup_idx})"
|
| 218 |
+
|
| 219 |
+
post_dir = os.path.join(base_target_dir, author_clean, title_clean)
|
| 220 |
+
os.makedirs(post_dir, exist_ok=True)
|
| 221 |
+
|
| 222 |
+
images = post.get('images', [])
|
| 223 |
+
for idx, img_url in enumerate(images, 1):
|
| 224 |
+
tasks.append({
|
| 225 |
+
'post': post,
|
| 226 |
+
'idx': idx,
|
| 227 |
+
'url': img_url,
|
| 228 |
+
'dir': post_dir,
|
| 229 |
+
'title': title_clean
|
| 230 |
+
})
|
| 231 |
+
|
| 232 |
+
with concurrent.futures.ThreadPoolExecutor(max_workers=30) as executor:
|
| 233 |
+
executor.map(download_image, tasks)
|
| 234 |
+
|
| 235 |
+
send_message({"status": "done", "file": base_dir})
|
| 236 |
+
|
| 237 |
+
def get_unique_filename(filepath):
|
| 238 |
+
if not os.path.exists(filepath):
|
| 239 |
+
return filepath
|
| 240 |
+
dir_name, file_name = os.path.split(filepath)
|
| 241 |
+
name, ext = os.path.splitext(file_name)
|
| 242 |
+
counter = 1
|
| 243 |
+
while True:
|
| 244 |
+
new_name = f"{name} ({counter}){ext}"
|
| 245 |
+
new_path = os.path.join(dir_name, new_name)
|
| 246 |
+
if not os.path.exists(new_path):
|
| 247 |
+
return new_path
|
| 248 |
+
counter += 1
|
| 249 |
+
|
| 250 |
+
if __name__ == '__main__':
|
| 251 |
+
while True:
|
| 252 |
+
try:
|
| 253 |
+
msg = get_message()
|
| 254 |
+
if msg and msg.get('type') == 'EXTRACT_KEMONO':
|
| 255 |
+
extract_links(msg.get('urls', []), msg.get('cookies'), msg.get('userAgent'))
|
| 256 |
+
elif msg and msg.get('type') == 'SAVE_KEMONO':
|
| 257 |
+
text_links = msg.get('textLinks', '')
|
| 258 |
+
text_no_links = msg.get('textNoLinks', '')
|
| 259 |
+
|
| 260 |
+
downloads_dir = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Downloads')
|
| 261 |
+
base_links = os.path.join(downloads_dir, 'kemono_con_descargas.txt')
|
| 262 |
+
base_no_links = os.path.join(downloads_dir, 'kemono_sin_descargas.txt')
|
| 263 |
+
|
| 264 |
+
try:
|
| 265 |
+
if text_links:
|
| 266 |
+
final_links = get_unique_filename(base_links)
|
| 267 |
+
with open(final_links, 'w', encoding='utf-8') as f:
|
| 268 |
+
f.write(text_links)
|
| 269 |
+
if text_no_links:
|
| 270 |
+
final_no_links = get_unique_filename(base_no_links)
|
| 271 |
+
with open(final_no_links, 'w', encoding='utf-8') as f:
|
| 272 |
+
f.write(text_no_links)
|
| 273 |
+
|
| 274 |
+
send_message({"status": "done", "file": "Descargas"})
|
| 275 |
+
except Exception as e:
|
| 276 |
+
send_message({"status": "error", "message": str(e)})
|
| 277 |
+
elif msg and msg.get('type') == 'DOWNLOAD_IMAGES_KEMONO':
|
| 278 |
+
download_kemono_images(msg.get('data', []), msg.get('cookies'), msg.get('userAgent'))
|
| 279 |
+
elif msg:
|
| 280 |
+
send_message({"status": "error", "message": "Unknown command"})
|
| 281 |
+
else:
|
| 282 |
+
break
|
| 283 |
+
except Exception as e:
|
| 284 |
+
send_message({"status": "error", "message": str(e)})
|
| 285 |
+
break
|
detector de enlaces - copia/inject.py
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import re
|
| 3 |
+
|
| 4 |
+
with open('popup.js', 'r', encoding='utf-8') as f:
|
| 5 |
+
content = f.read()
|
| 6 |
+
|
| 7 |
+
start_idx = content.find(' // Toggle Logic para Kemono Descargas')
|
| 8 |
+
end_idx = content.find(' // Toggle Logic para Facebook')
|
| 9 |
+
|
| 10 |
+
if start_idx != -1 and end_idx != -1:
|
| 11 |
+
downloads_block = content[start_idx:end_idx]
|
| 12 |
+
|
| 13 |
+
images_block = downloads_block.replace('toggleKemonoDownloads', 'toggleKemonoImages')
|
| 14 |
+
images_block = images_block.replace('__kemonoDownloadsActive', '__kemonoImagesActive')
|
| 15 |
+
images_block = images_block.replace('kemono-dl-', 'kemono-img-')
|
| 16 |
+
images_block = images_block.replace('#fbbf24', '#14b8a6')
|
| 17 |
+
images_block = images_block.replace('#f59e0b', '#0d9488')
|
| 18 |
+
images_block = images_block.replace('¡Guardado en Descargas!', '¡Enviado a Descargar Imágenes!')
|
| 19 |
+
|
| 20 |
+
extraction_start = images_block.find('let outputWithLinks =')
|
| 21 |
+
extraction_end = images_block.find('document.body.removeChild(iframe);')
|
| 22 |
+
|
| 23 |
+
new_extraction = '''let extractionPayload = [];
|
| 24 |
+
|
| 25 |
+
let count = 0;
|
| 26 |
+
const CONCURRENCY_LIMIT = 4;
|
| 27 |
+
let queue = [...uniqueUrls];
|
| 28 |
+
|
| 29 |
+
const extractWorker = async (workerId) => {
|
| 30 |
+
let iframe = document.createElement('iframe');
|
| 31 |
+
iframe.id = `kemono-extractor-frame-${workerId}`;
|
| 32 |
+
iframe.style.width = '1px';
|
| 33 |
+
iframe.style.height = '1px';
|
| 34 |
+
iframe.style.opacity = '0';
|
| 35 |
+
iframe.style.pointerEvents = 'none';
|
| 36 |
+
iframe.style.position = 'fixed';
|
| 37 |
+
iframe.style.bottom = '0';
|
| 38 |
+
document.body.appendChild(iframe);
|
| 39 |
+
|
| 40 |
+
while (queue.length > 0) {
|
| 41 |
+
const url = queue.shift();
|
| 42 |
+
count++;
|
| 43 |
+
copyBtn.textContent = `Analizando páginas... ${Math.round((count/total)*100)}%`;
|
| 44 |
+
|
| 45 |
+
try {
|
| 46 |
+
let loaded = false;
|
| 47 |
+
iframe.onload = () => { loaded = true; };
|
| 48 |
+
iframe.src = url;
|
| 49 |
+
|
| 50 |
+
let waitTimer = 0;
|
| 51 |
+
while (!loaded && waitTimer < 15000) {
|
| 52 |
+
await new Promise(r => setTimeout(r, 200));
|
| 53 |
+
waitTimer += 200;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
await new Promise(r => setTimeout(r, 2500 + Math.random() * 500));
|
| 57 |
+
|
| 58 |
+
const doc = iframe.contentDocument;
|
| 59 |
+
if (!doc) throw new Error("Página inaccesible");
|
| 60 |
+
|
| 61 |
+
let titleEl = doc.querySelector('.post__title span') || doc.querySelector('.post__title') || doc.querySelector('h1');
|
| 62 |
+
let title = titleEl ? titleEl.innerText.trim() : 'Desconocido';
|
| 63 |
+
|
| 64 |
+
let authorEl = doc.querySelector('.post__user-name') || doc.querySelector('.post__author');
|
| 65 |
+
let author = authorEl ? authorEl.innerText.trim() : 'Desconocido';
|
| 66 |
+
|
| 67 |
+
let imageLinks = [];
|
| 68 |
+
const isImage = (str) => /\.(jpg|jpeg|png|webp|gif|avif)(\?|$|\w)/i.test(str || '');
|
| 69 |
+
|
| 70 |
+
// Attachments
|
| 71 |
+
doc.querySelectorAll('a.post__attachment-link, .post__attachment a').forEach(a => {
|
| 72 |
+
let href = a.getAttribute('href');
|
| 73 |
+
let name = a.getAttribute('download') || a.innerText.trim();
|
| 74 |
+
if (isImage(href) || isImage(name)) {
|
| 75 |
+
if (!href.startsWith('http')) href = new URL(href, url).href;
|
| 76 |
+
imageLinks.push(href);
|
| 77 |
+
}
|
| 78 |
+
});
|
| 79 |
+
|
| 80 |
+
// Images inside content
|
| 81 |
+
doc.querySelectorAll('.post__content img, .post__body img, .post__content a, .post__body a').forEach(el => {
|
| 82 |
+
let src = el.getAttribute('src') || el.getAttribute('href');
|
| 83 |
+
if (isImage(src)) {
|
| 84 |
+
if (!src.startsWith('http')) src = new URL(src, url).href;
|
| 85 |
+
imageLinks.push(src);
|
| 86 |
+
}
|
| 87 |
+
});
|
| 88 |
+
|
| 89 |
+
imageLinks = [...new Set(imageLinks)];
|
| 90 |
+
|
| 91 |
+
if (imageLinks.length > 0) {
|
| 92 |
+
extractionPayload.push({
|
| 93 |
+
url: url,
|
| 94 |
+
title: title,
|
| 95 |
+
author: author,
|
| 96 |
+
images: imageLinks
|
| 97 |
+
});
|
| 98 |
+
|
| 99 |
+
try {
|
| 100 |
+
const urlPath = new URL(url).pathname;
|
| 101 |
+
const cardAnchor = document.querySelector(`.post-card a[href="${urlPath}"]`) || document.querySelector(`.post-card a[href$="${urlPath}"]`);
|
| 102 |
+
if (cardAnchor) {
|
| 103 |
+
const card = cardAnchor.closest('.post-card');
|
| 104 |
+
if (card) {
|
| 105 |
+
card.classList.add('kemono-img-success');
|
| 106 |
+
setTimeout(() => card.classList.remove('kemono-img-success'), 150);
|
| 107 |
+
setTimeout(() => card.classList.add('kemono-img-success'), 300);
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
} catch(e) {}
|
| 111 |
+
}
|
| 112 |
+
} catch (err) {
|
| 113 |
+
console.error("Error cargando " + url, err);
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
document.body.removeChild(iframe);
|
| 117 |
+
};'''
|
| 118 |
+
|
| 119 |
+
images_block = images_block[:extraction_start] + new_extraction + images_block[extraction_end + len('document.body.removeChild(iframe);'):]
|
| 120 |
+
|
| 121 |
+
images_block = images_block.replace('type: "SAVE_KEMONO"', 'type: "DOWNLOAD_IMAGES_KEMONO"')
|
| 122 |
+
images_block = re.sub(r'textLinks:.*,', 'data: extractionPayload', images_block)
|
| 123 |
+
images_block = re.sub(r'textNoLinks:.*', '', images_block)
|
| 124 |
+
|
| 125 |
+
images_block = images_block.replace('// Toggle Logic para Kemono Descargas', '// Toggle Logic para Kemono Imagenes')
|
| 126 |
+
images_block = images_block.replace('Procesar Enlaces', 'Procesar Imágenes')
|
| 127 |
+
|
| 128 |
+
new_content = content[:end_idx] + images_block + '\n' + content[end_idx:]
|
| 129 |
+
|
| 130 |
+
with open('popup.js', 'w', encoding='utf-8') as f:
|
| 131 |
+
f.write(new_content)
|
| 132 |
+
|
| 133 |
+
print("Injection successful.")
|
| 134 |
+
else:
|
| 135 |
+
print("Could not find blocks")
|
detector de enlaces - copia/instalar_python_host.bat
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
setlocal
|
| 3 |
+
echo ========================================================
|
| 4 |
+
echo INSTALADOR DEL HOST DE DESCARGAS DE KEMONO (PYTHON)
|
| 5 |
+
echo ========================================================
|
| 6 |
+
echo.
|
| 7 |
+
echo Para que Chrome pueda conectar con el script de Python,
|
| 8 |
+
echo necesitamos el "ID" de tu extension.
|
| 9 |
+
echo.
|
| 10 |
+
echo 1. Abre Chrome y ve a chrome://extensions/
|
| 11 |
+
echo 2. Busca "Detector de Enlaces Erome"
|
| 12 |
+
echo 3. Copia el ID (ejemplo: aabbccddeeffgghhiijjkkllmmnnoopp)
|
| 13 |
+
echo.
|
| 14 |
+
set /p EXT_ID="Pega el ID de la extension y presiona ENTER: "
|
| 15 |
+
|
| 16 |
+
echo.
|
| 17 |
+
echo Creando manifest JSON para el host...
|
| 18 |
+
|
| 19 |
+
set MANIFEST_PATH=%~dp0host\com.linkdetector.kemono.json
|
| 20 |
+
set BAT_PATH=%~dp0host\kemono_host.bat
|
| 21 |
+
set BAT_PATH=%BAT_PATH:\=\\%
|
| 22 |
+
|
| 23 |
+
> "%MANIFEST_PATH%" echo {
|
| 24 |
+
>> "%MANIFEST_PATH%" echo "name": "com.linkdetector.kemono",
|
| 25 |
+
>> "%MANIFEST_PATH%" echo "description": "Extractor de enlaces de Kemono",
|
| 26 |
+
>> "%MANIFEST_PATH%" echo "path": "%BAT_PATH%",
|
| 27 |
+
>> "%MANIFEST_PATH%" echo "type": "stdio",
|
| 28 |
+
>> "%MANIFEST_PATH%" echo "allowed_origins": [
|
| 29 |
+
>> "%MANIFEST_PATH%" echo "chrome-extension://%EXT_ID%/"
|
| 30 |
+
>> "%MANIFEST_PATH%" echo ]
|
| 31 |
+
>> "%MANIFEST_PATH%" echo }
|
| 32 |
+
|
| 33 |
+
echo Archivo JSON creado en: %MANIFEST_PATH%
|
| 34 |
+
echo.
|
| 35 |
+
echo Registrando en Windows Registry...
|
| 36 |
+
REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\com.linkdetector.kemono" /ve /t REG_SZ /d "%MANIFEST_PATH%" /f
|
| 37 |
+
|
| 38 |
+
echo.
|
| 39 |
+
echo ========================================================
|
| 40 |
+
echo INSTALACION COMPLETADA
|
| 41 |
+
echo ========================================================
|
| 42 |
+
echo Ya puedes usar la opcion de Extraer Descargas Kemono.
|
| 43 |
+
echo Los enlaces se guardaran automaticamente en tu Escritorio
|
| 44 |
+
echo en un archivo llamado "kemono_downloads_extraidos.txt".
|
| 45 |
+
echo.
|
| 46 |
+
pause
|
detector de enlaces - copia/manifest.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"manifest_version": 3,
|
| 3 |
+
"name": "Detector de Enlaces Erome",
|
| 4 |
+
"version": "1.3",
|
| 5 |
+
"description": "Extrae enlaces directos de video (.mp4) de la página actual y escanea álbumes a fondo en segundo plano.",
|
| 6 |
+
"permissions": ["activeTab", "scripting", "nativeMessaging", "cookies", "storage"],
|
| 7 |
+
"host_permissions": [
|
| 8 |
+
"*://*.erome.com/*",
|
| 9 |
+
"*://*.facebook.com/*",
|
| 10 |
+
"*://*.tiktok.com/*",
|
| 11 |
+
"*://*.kemono.cr/*",
|
| 12 |
+
"*://*.kemono.su/*",
|
| 13 |
+
"*://*.pawchive.st/*",
|
| 14 |
+
"*://*.eporner.com/*",
|
| 15 |
+
"*://*.xhamster.com/*",
|
| 16 |
+
"*://*.ixxx.com/*",
|
| 17 |
+
"*://*.xhand.net/*",
|
| 18 |
+
"*://*.123av.com/*",
|
| 19 |
+
"*://*.123av.org/*",
|
| 20 |
+
"*://*.123av.me/*",
|
| 21 |
+
"*://*.missav.com/*",
|
| 22 |
+
"*://*.missav.ws/*",
|
| 23 |
+
"*://*.surrit.store/*",
|
| 24 |
+
"*://*.surrit.com/*",
|
| 25 |
+
"*://*.ladys.one/*",
|
| 26 |
+
"*://*.twpornstars.com/*",
|
| 27 |
+
"*://*.leakgallery.com/*",
|
| 28 |
+
"*://*.x.com/*",
|
| 29 |
+
"*://*.twitter.com/*",
|
| 30 |
+
"*://*.xvideos.com/*",
|
| 31 |
+
"*://*.xvideos.es/*",
|
| 32 |
+
"*://*.instagram.com/*",
|
| 33 |
+
"*://*.pornhub.com/*"
|
| 34 |
+
],
|
| 35 |
+
"background": {
|
| 36 |
+
"service_worker": "background.js"
|
| 37 |
+
},
|
| 38 |
+
"action": {
|
| 39 |
+
"default_popup": "popup.html"
|
| 40 |
+
}
|
| 41 |
+
}
|
detector de enlaces - copia/popup.html
ADDED
|
@@ -0,0 +1,866 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="es">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 6 |
+
<style>
|
| 7 |
+
:root {
|
| 8 |
+
--bg: #09090b;
|
| 9 |
+
--surface: #18181b;
|
| 10 |
+
--border: #27272a;
|
| 11 |
+
--text: #f4f4f5;
|
| 12 |
+
--text-muted: #a1a1aa;
|
| 13 |
+
--accent: #8b5cf6;
|
| 14 |
+
--accent-hover: #7c3aed;
|
| 15 |
+
--success: #10b981;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
* { box-sizing: border-box; }
|
| 19 |
+
|
| 20 |
+
@keyframes spin { 100% { transform: rotate(360deg); } }
|
| 21 |
+
|
| 22 |
+
body {
|
| 23 |
+
width: 500px;
|
| 24 |
+
font-family: 'Inter', sans-serif;
|
| 25 |
+
padding: 20px;
|
| 26 |
+
margin: 0;
|
| 27 |
+
background-color: var(--bg);
|
| 28 |
+
color: var(--text);
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.header {
|
| 32 |
+
display: flex;
|
| 33 |
+
align-items: center;
|
| 34 |
+
justify-content: space-between;
|
| 35 |
+
margin-bottom: 20px;
|
| 36 |
+
padding-bottom: 15px;
|
| 37 |
+
border-bottom: 1px solid var(--border);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
h3 {
|
| 41 |
+
margin: 0;
|
| 42 |
+
font-size: 18px;
|
| 43 |
+
font-weight: 700;
|
| 44 |
+
background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
|
| 45 |
+
-webkit-background-clip: text;
|
| 46 |
+
background-clip: text;
|
| 47 |
+
-webkit-text-fill-color: transparent;
|
| 48 |
+
display: flex;
|
| 49 |
+
align-items: center;
|
| 50 |
+
gap: 8px;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.badge {
|
| 54 |
+
background: rgba(139, 92, 246, 0.15);
|
| 55 |
+
color: #c4b5fd;
|
| 56 |
+
padding: 4px 10px;
|
| 57 |
+
border-radius: 12px;
|
| 58 |
+
font-size: 11px;
|
| 59 |
+
font-weight: 600;
|
| 60 |
+
letter-spacing: 0.5px;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
ul {
|
| 64 |
+
list-style-type: none;
|
| 65 |
+
padding: 0;
|
| 66 |
+
margin: 0;
|
| 67 |
+
display: flex;
|
| 68 |
+
flex-direction: column;
|
| 69 |
+
gap: 12px;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
li {
|
| 73 |
+
background: var(--surface);
|
| 74 |
+
padding: 12px;
|
| 75 |
+
border-radius: 10px;
|
| 76 |
+
border: 1px solid var(--border);
|
| 77 |
+
display: flex;
|
| 78 |
+
flex-direction: column;
|
| 79 |
+
gap: 10px;
|
| 80 |
+
transition: transform 0.2s, border-color 0.2s;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
li:hover {
|
| 84 |
+
border-color: #3f3f46;
|
| 85 |
+
transform: translateY(-2px);
|
| 86 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.url-container {
|
| 90 |
+
background: #000;
|
| 91 |
+
padding: 10px;
|
| 92 |
+
border-radius: 6px;
|
| 93 |
+
border: 1px solid #27272a;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.url {
|
| 97 |
+
font-size: 11px;
|
| 98 |
+
word-break: break-all;
|
| 99 |
+
color: var(--text-muted);
|
| 100 |
+
font-family: 'Consolas', monospace;
|
| 101 |
+
line-height: 1.4;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
button {
|
| 105 |
+
background: var(--surface);
|
| 106 |
+
color: var(--text);
|
| 107 |
+
border: 1px solid var(--border);
|
| 108 |
+
padding: 8px 12px;
|
| 109 |
+
border-radius: 6px;
|
| 110 |
+
cursor: pointer;
|
| 111 |
+
font-size: 13px;
|
| 112 |
+
font-weight: 600;
|
| 113 |
+
transition: all 0.2s ease;
|
| 114 |
+
display: flex;
|
| 115 |
+
align-items: center;
|
| 116 |
+
justify-content: center;
|
| 117 |
+
gap: 6px;
|
| 118 |
+
width: 100%;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
button:hover:not(:disabled) {
|
| 122 |
+
background: #27272a;
|
| 123 |
+
border-color: #52525b;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
button:disabled {
|
| 127 |
+
opacity: 0.6;
|
| 128 |
+
cursor: not-allowed;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
button.primary {
|
| 132 |
+
background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
|
| 133 |
+
color: white;
|
| 134 |
+
border: none;
|
| 135 |
+
margin-bottom: 20px;
|
| 136 |
+
padding: 12px;
|
| 137 |
+
font-size: 14px;
|
| 138 |
+
box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
button.primary:hover:not(:disabled) {
|
| 142 |
+
background: linear-gradient(135deg, var(--accent-hover) 0%, #5b21b6 100%);
|
| 143 |
+
transform: translateY(-1px);
|
| 144 |
+
box-shadow: 0 6px 16px rgba(109, 40, 217, 0.4);
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
button.secondary {
|
| 148 |
+
background: #27272a;
|
| 149 |
+
color: white;
|
| 150 |
+
border: 1px solid #3f3f46;
|
| 151 |
+
margin-bottom: 20px;
|
| 152 |
+
padding: 12px;
|
| 153 |
+
font-size: 14px;
|
| 154 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
| 155 |
+
}
|
| 156 |
+
button.secondary:hover:not(:disabled) {
|
| 157 |
+
background: #3f3f46;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
button.success {
|
| 161 |
+
background: var(--success) !important;
|
| 162 |
+
color: white !important;
|
| 163 |
+
border-color: var(--success) !important;
|
| 164 |
+
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.status {
|
| 168 |
+
text-align: center;
|
| 169 |
+
font-size: 13px;
|
| 170 |
+
color: var(--text-muted);
|
| 171 |
+
padding: 30px 20px;
|
| 172 |
+
background: var(--surface);
|
| 173 |
+
border-radius: 8px;
|
| 174 |
+
border: 1px dashed #3f3f46;
|
| 175 |
+
display: flex;
|
| 176 |
+
flex-direction: column;
|
| 177 |
+
align-items: center;
|
| 178 |
+
gap: 10px;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.tool-list {
|
| 182 |
+
display: flex;
|
| 183 |
+
flex-direction: column;
|
| 184 |
+
gap: 15px;
|
| 185 |
+
}
|
| 186 |
+
.tool-card {
|
| 187 |
+
background: var(--surface);
|
| 188 |
+
border: 1px solid var(--border);
|
| 189 |
+
border-radius: 12px;
|
| 190 |
+
overflow: hidden;
|
| 191 |
+
transition: all 0.2s ease;
|
| 192 |
+
}
|
| 193 |
+
.tool-card:hover { border-color: #3f3f46; }
|
| 194 |
+
|
| 195 |
+
.tool-header {
|
| 196 |
+
display: flex;
|
| 197 |
+
align-items: center;
|
| 198 |
+
justify-content: space-between;
|
| 199 |
+
padding: 16px;
|
| 200 |
+
background: rgba(255,255,255,0.02);
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.tool-info {
|
| 204 |
+
display: flex;
|
| 205 |
+
align-items: center;
|
| 206 |
+
gap: 14px;
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
.tool-icon {
|
| 210 |
+
width: 38px;
|
| 211 |
+
height: 38px;
|
| 212 |
+
background: rgba(255,255,255,0.05);
|
| 213 |
+
border: 1px solid var(--border);
|
| 214 |
+
border-radius: 10px;
|
| 215 |
+
display: flex;
|
| 216 |
+
align-items: center;
|
| 217 |
+
justify-content: center;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.tool-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 2px; }
|
| 221 |
+
.tool-desc { font-size: 11px; color: var(--text-muted); }
|
| 222 |
+
|
| 223 |
+
.tool-body {
|
| 224 |
+
padding: 16px;
|
| 225 |
+
border-top: 1px solid var(--border);
|
| 226 |
+
background: rgba(0,0,0,0.2);
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
/* Toggle Switch */
|
| 230 |
+
.switch {
|
| 231 |
+
position: relative;
|
| 232 |
+
display: inline-block;
|
| 233 |
+
width: 44px;
|
| 234 |
+
height: 24px;
|
| 235 |
+
}
|
| 236 |
+
.switch input { opacity: 0; width: 0; height: 0; }
|
| 237 |
+
.slider {
|
| 238 |
+
position: absolute;
|
| 239 |
+
cursor: pointer;
|
| 240 |
+
top: 0; left: 0; right: 0; bottom: 0;
|
| 241 |
+
background-color: #3f3f46;
|
| 242 |
+
transition: .3s;
|
| 243 |
+
}
|
| 244 |
+
.slider:before {
|
| 245 |
+
position: absolute;
|
| 246 |
+
content: "";
|
| 247 |
+
height: 18px; width: 18px;
|
| 248 |
+
left: 3px; bottom: 3px;
|
| 249 |
+
background-color: white;
|
| 250 |
+
transition: .3s;
|
| 251 |
+
}
|
| 252 |
+
input:checked + .slider { background-color: var(--success); }
|
| 253 |
+
input:checked + .slider:before { transform: translateX(20px); }
|
| 254 |
+
.slider.round { border-radius: 24px; }
|
| 255 |
+
.slider.round:before { border-radius: 50%; }
|
| 256 |
+
.icon-btn {
|
| 257 |
+
background: transparent;
|
| 258 |
+
border: none;
|
| 259 |
+
color: var(--text-muted);
|
| 260 |
+
cursor: pointer;
|
| 261 |
+
display: flex;
|
| 262 |
+
align-items: center;
|
| 263 |
+
justify-content: center;
|
| 264 |
+
padding: 4px;
|
| 265 |
+
border-radius: 4px;
|
| 266 |
+
transition: all 0.2s;
|
| 267 |
+
}
|
| 268 |
+
.icon-btn:hover {
|
| 269 |
+
color: var(--text);
|
| 270 |
+
background: rgba(255,255,255,0.1);
|
| 271 |
+
}
|
| 272 |
+
</style>
|
| 273 |
+
</head>
|
| 274 |
+
<body>
|
| 275 |
+
<div class="header">
|
| 276 |
+
<div style="display:flex; align-items:center; gap:8px;">
|
| 277 |
+
<h3>
|
| 278 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="url(#grad)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
| 279 |
+
<defs>
|
| 280 |
+
<linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%">
|
| 281 |
+
<stop offset="0%" style="stop-color:#a78bfa" />
|
| 282 |
+
<stop offset="100%" style="stop-color:#ec4899" />
|
| 283 |
+
</linearGradient>
|
| 284 |
+
</defs>
|
| 285 |
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
| 286 |
+
<polyline points="7 10 12 15 17 10"></polyline>
|
| 287 |
+
<line x1="12" y1="15" x2="12" y2="3"></line>
|
| 288 |
+
</svg>
|
| 289 |
+
LinkDetector
|
| 290 |
+
</h3>
|
| 291 |
+
<button id="info-btn" class="icon-btn" title="Información de Herramientas">
|
| 292 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
|
| 293 |
+
</button>
|
| 294 |
+
</div>
|
| 295 |
+
<span id="count-badge" class="badge" style="display:none;">0 videos</span>
|
| 296 |
+
</div>
|
| 297 |
+
|
| 298 |
+
<div id="info-panel" style="display: none; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 15px; margin-bottom: 15px; font-size: 13px; color: var(--text-muted); line-height: 1.5;">
|
| 299 |
+
<strong style="color: #fff; display:block; margin-bottom: 10px; font-size: 14px;">Guía de Herramientas</strong>
|
| 300 |
+
|
| 301 |
+
<div style="margin-bottom: 10px;">
|
| 302 |
+
<b style="color: #ec4899; display:flex; align-items:center; gap:5px;">
|
| 303 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 304 |
+
Modo Extractor Erome
|
| 305 |
+
</b>
|
| 306 |
+
Escanea álbumes y extrae los enlaces de todos los videos. Exclusivo para Erome.
|
| 307 |
+
</div>
|
| 308 |
+
|
| 309 |
+
<div>
|
| 310 |
+
<b style="color: #a78bfa; display:flex; align-items:center; gap:5px;">
|
| 311 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 312 |
+
Modo Selector Kemono
|
| 313 |
+
</b>
|
| 314 |
+
Inyecta un menú en la página para dar clic en las portadas de Kemono y copiar la url de varias publicaciones a la vez. Solo aparece en Kemono.
|
| 315 |
+
</div>
|
| 316 |
+
|
| 317 |
+
<div style="margin-top: 10px;">
|
| 318 |
+
<b style="color: #fbbf24; display:flex; align-items:center; gap:5px;">
|
| 319 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
|
| 320 |
+
Extraer Descargas Kemono
|
| 321 |
+
</b>
|
| 322 |
+
Selecciona portadas en Kemono: pero en lugar de copiar el enlace del post, entra a cada post por ti y extrae los enlaces directos de descarga (ZIPs, Mega, Drive).
|
| 323 |
+
</div>
|
| 324 |
+
|
| 325 |
+
<div style="margin-top: 10px;">
|
| 326 |
+
<b style="color: #14b8a6; display:flex; align-items:center; gap:5px;">
|
| 327 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
| 328 |
+
Extraer Imágenes Kemono
|
| 329 |
+
</b>
|
| 330 |
+
Selecciona posts en Kemono para procesarlos en segundo plano, extraer todas sus imágenes y descargarlas organizadas en carpetas con Python.
|
| 331 |
+
</div>
|
| 332 |
+
|
| 333 |
+
<div style="margin-top: 10px;">
|
| 334 |
+
<b style="color: #60a5fa; display:flex; align-items:center; gap:5px;">
|
| 335 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>
|
| 336 |
+
Modo Selector Facebook
|
| 337 |
+
</b>
|
| 338 |
+
Selecciona reels interactivamente como en Kemono, o presiona "Buscar enlaces" para recolectar todos los videos que has visto al bajar página. Solo para Facebook.
|
| 339 |
+
</div>
|
| 340 |
+
|
| 341 |
+
<div style="margin-top: 10px;">
|
| 342 |
+
<b style="color: #ff5500; display:flex; align-items:center; gap:5px;">
|
| 343 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 344 |
+
Modo Selector Eporner
|
| 345 |
+
</b>
|
| 346 |
+
Selecciona miniaturas en Eporner de forma interactiva y copia los enlaces de los videos. Solo aparece en Eporner.
|
| 347 |
+
</div>
|
| 348 |
+
|
| 349 |
+
<div style="margin-top: 10px;">
|
| 350 |
+
<b style="color: #ef4444; display:flex; align-items:center; gap:5px;">
|
| 351 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 352 |
+
Modo Selector XHamster
|
| 353 |
+
</b>
|
| 354 |
+
Selecciona miniaturas en XHamster de forma interactiva y copia los enlaces de los videos. Solo aparece en XHamster.
|
| 355 |
+
</div>
|
| 356 |
+
|
| 357 |
+
<div style="margin-top: 10px;">
|
| 358 |
+
<b style="color: #ec4899; display:flex; align-items:center; gap:5px;">
|
| 359 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 360 |
+
Modo Selector iXXX
|
| 361 |
+
</b>
|
| 362 |
+
Selecciona miniaturas en iXXX de forma interactiva y copia los enlaces decodificados. Solo aparece en iXXX.
|
| 363 |
+
</div>
|
| 364 |
+
|
| 365 |
+
<div style="margin-top: 10px;">
|
| 366 |
+
<b style="color: #a78bfa; display:flex; align-items:center; gap:5px;">
|
| 367 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 368 |
+
Modo Selector XHand
|
| 369 |
+
</b>
|
| 370 |
+
Selecciona miniaturas en XHand de forma interactiva y copia sus enlaces. Solo aparece en XHand.
|
| 371 |
+
</div>
|
| 372 |
+
|
| 373 |
+
<div style="margin-top: 10px;">
|
| 374 |
+
<b style="color: #ec4899; display:flex; align-items:center; gap:5px;">
|
| 375 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 376 |
+
Modo Extractor Ladys.one
|
| 377 |
+
</b>
|
| 378 |
+
Extrae todos los videos directos (.mp4) de las páginas y perfiles en Ladys.one.
|
| 379 |
+
</div>
|
| 380 |
+
|
| 381 |
+
<div style="margin-top: 10px;">
|
| 382 |
+
<b style="color: #60a5fa; display:flex; align-items:center; gap:5px;">
|
| 383 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 384 |
+
Modo Extractor TWPornstars
|
| 385 |
+
</b>
|
| 386 |
+
Extrae automáticamente todos los videos directos (.mp4) de los perfiles en TWPornstars.
|
| 387 |
+
</div>
|
| 388 |
+
|
| 389 |
+
<div style="margin-top: 10px;">
|
| 390 |
+
<b style="color: #10b981; display:flex; align-items:center; gap:5px;">
|
| 391 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 392 |
+
Modo Extractor LeakGallery
|
| 393 |
+
</b>
|
| 394 |
+
Extrae automáticamente todos los videos directos (.mp4) de los perfiles en LeakGallery.
|
| 395 |
+
</div>
|
| 396 |
+
|
| 397 |
+
<div style="margin-top: 10px;">
|
| 398 |
+
<b style="color: #000000; background: #fff; padding: 2px 4px; border-radius: 4px; display:inline-flex; align-items:center; gap:5px;">
|
| 399 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4l11.733 16h4.267l-11.733 -16z" /><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" /></svg>
|
| 400 |
+
Auto Extractor X (Videos)
|
| 401 |
+
</b>
|
| 402 |
+
<br>Inyecta un menú flotante que busca y extrae automáticamente los enlaces a todos los videos de un perfil de X haciendo scroll.
|
| 403 |
+
</div>
|
| 404 |
+
</div>
|
| 405 |
+
|
| 406 |
+
<div class="tool-list">
|
| 407 |
+
|
| 408 |
+
<div id="no-tools-msg" class="status" style="display:none; margin-bottom: 0;">
|
| 409 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color:#ef4444; margin-bottom: 8px;"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
| 410 |
+
<span>Esta extensión está diseñada principalmente para <b>Kemono</b>, <b>Pawchive</b>, <b>Erome</b>, <b>Eporner</b>, <b>Pornhub</b>, <b>XHamster</b>, <b>iXXX</b>, <b>XHand</b>, <b>Ladys.one</b>, <b>TWPornstars</b>, <b>LeakGallery</b> y <b>X (Twitter)</b>. Navega a una de esas páginas para usar las herramientas.</span>
|
| 411 |
+
</div>
|
| 412 |
+
|
| 413 |
+
<!-- Módulo Erome Videos -->
|
| 414 |
+
<div class="tool-card" id="card-video">
|
| 415 |
+
<div class="tool-header">
|
| 416 |
+
<div class="tool-info">
|
| 417 |
+
<div class="tool-icon">
|
| 418 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ec4899;"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 419 |
+
</div>
|
| 420 |
+
<div class="tool-text">
|
| 421 |
+
<div class="tool-title">Modo Extractor Erome (Videos)</div>
|
| 422 |
+
<div class="tool-desc">Extrae todos los videos de álbumes en Erome.</div>
|
| 423 |
+
</div>
|
| 424 |
+
</div>
|
| 425 |
+
<label class="switch">
|
| 426 |
+
<input type="checkbox" id="toggle-video">
|
| 427 |
+
<span class="slider round"></span>
|
| 428 |
+
</label>
|
| 429 |
+
</div>
|
| 430 |
+
<div id="container-video" class="tool-body" style="display: none;">
|
| 431 |
+
<div id="status" class="status" style="display:none;">
|
| 432 |
+
<svg class="spinner" width="24" height="24" viewBox="0 0 50 50" style="animation:spin 1s linear infinite;"><circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-dasharray="31.4 31.4" stroke-linecap="round" style="opacity:0.5;"></circle></svg>
|
| 433 |
+
<span>Escaneando página...</span>
|
| 434 |
+
</div>
|
| 435 |
+
<button id="deep-scan" class="secondary" style="display:none;">
|
| 436 |
+
🔍 Escanear álbumes a fondo
|
| 437 |
+
</button>
|
| 438 |
+
<button id="copy-all" class="primary" style="display:none;">
|
| 439 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
| 440 |
+
Copiar Todos
|
| 441 |
+
</button>
|
| 442 |
+
<ul id="video-list"></ul>
|
| 443 |
+
</div>
|
| 444 |
+
</div>
|
| 445 |
+
|
| 446 |
+
<!-- Módulo Erome Imágenes -->
|
| 447 |
+
<div class="tool-card" id="card-erome-images">
|
| 448 |
+
<div class="tool-header">
|
| 449 |
+
<div class="tool-info">
|
| 450 |
+
<div class="tool-icon">
|
| 451 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ec4899;"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
| 452 |
+
</div>
|
| 453 |
+
<div class="tool-text">
|
| 454 |
+
<div class="tool-title">Modo Extractor Erome (Imágenes)</div>
|
| 455 |
+
<div class="tool-desc">Extrae todas las imágenes de álbumes en Erome.</div>
|
| 456 |
+
</div>
|
| 457 |
+
</div>
|
| 458 |
+
<label class="switch">
|
| 459 |
+
<input type="checkbox" id="toggle-erome-images">
|
| 460 |
+
<span class="slider round"></span>
|
| 461 |
+
</label>
|
| 462 |
+
</div>
|
| 463 |
+
<div id="container-erome-images" class="tool-body" style="display: none;">
|
| 464 |
+
<div id="status-erome-images" class="status" style="display:none;">
|
| 465 |
+
<svg class="spinner" width="24" height="24" viewBox="0 0 50 50" style="animation:spin 1s linear infinite;"><circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-dasharray="31.4 31.4" stroke-linecap="round" style="opacity:0.5;"></circle></svg>
|
| 466 |
+
<span>Escaneando página...</span>
|
| 467 |
+
</div>
|
| 468 |
+
<button id="deep-scan-erome-images" class="secondary" style="display:none;">
|
| 469 |
+
🔍 Escanear álbumes a fondo
|
| 470 |
+
</button>
|
| 471 |
+
<button id="copy-all-erome-images" class="primary" style="display:none;">
|
| 472 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
| 473 |
+
Copiar Todos
|
| 474 |
+
</button>
|
| 475 |
+
<ul id="image-list"></ul>
|
| 476 |
+
</div>
|
| 477 |
+
</div>
|
| 478 |
+
|
| 479 |
+
<!-- Módulo Kemono -->
|
| 480 |
+
<div class="tool-card" id="card-kemono">
|
| 481 |
+
<div class="tool-header">
|
| 482 |
+
<div class="tool-info">
|
| 483 |
+
<div class="tool-icon">
|
| 484 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #a78bfa;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 485 |
+
</div>
|
| 486 |
+
<div class="tool-text">
|
| 487 |
+
<div class="tool-title">Modo Selector Kemono</div>
|
| 488 |
+
<div class="tool-desc">Elige portadas interactivamente para copiar.</div>
|
| 489 |
+
</div>
|
| 490 |
+
</div>
|
| 491 |
+
<label class="switch">
|
| 492 |
+
<input type="checkbox" id="toggle-kemono">
|
| 493 |
+
<span class="slider round"></span>
|
| 494 |
+
</label>
|
| 495 |
+
</div>
|
| 496 |
+
</div>
|
| 497 |
+
|
| 498 |
+
<!-- Módulo Kemono Descargas -->
|
| 499 |
+
<div class="tool-card" id="card-kemono-downloads">
|
| 500 |
+
<div class="tool-header">
|
| 501 |
+
<div class="tool-info">
|
| 502 |
+
<div class="tool-icon">
|
| 503 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #fbbf24;"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
|
| 504 |
+
</div>
|
| 505 |
+
<div class="tool-text">
|
| 506 |
+
<div class="tool-title">Extraer Descargas Kemono</div>
|
| 507 |
+
<div class="tool-desc">Selecciona posts para extraer sus archivos (Zips, Mega, Drive).</div>
|
| 508 |
+
</div>
|
| 509 |
+
</div>
|
| 510 |
+
<label class="switch">
|
| 511 |
+
<input type="checkbox" id="toggle-kemono-downloads">
|
| 512 |
+
<span class="slider round"></span>
|
| 513 |
+
</label>
|
| 514 |
+
</div>
|
| 515 |
+
</div>
|
| 516 |
+
|
| 517 |
+
<!-- Módulo Kemono Imagenes -->
|
| 518 |
+
<div class="tool-card" id="card-kemono-images">
|
| 519 |
+
<div class="tool-header">
|
| 520 |
+
<div class="tool-info">
|
| 521 |
+
<div class="tool-icon">
|
| 522 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #14b8a6;"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
| 523 |
+
</div>
|
| 524 |
+
<div class="tool-text">
|
| 525 |
+
<div class="tool-title">Extraer Imágenes Kemono</div>
|
| 526 |
+
<div class="tool-desc">Extrae y descarga las imágenes en carpetas automáticamente.</div>
|
| 527 |
+
</div>
|
| 528 |
+
</div>
|
| 529 |
+
<label class="switch">
|
| 530 |
+
<input type="checkbox" id="toggle-kemono-images">
|
| 531 |
+
<span class="slider round"></span>
|
| 532 |
+
</label>
|
| 533 |
+
</div>
|
| 534 |
+
</div>
|
| 535 |
+
|
| 536 |
+
|
| 537 |
+
<!-- Módulo Facebook -->
|
| 538 |
+
<div class="tool-card" id="card-facebook">
|
| 539 |
+
<div class="tool-header">
|
| 540 |
+
<div class="tool-info">
|
| 541 |
+
<div class="tool-icon">
|
| 542 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #60a5fa;"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>
|
| 543 |
+
</div>
|
| 544 |
+
<div class="tool-text">
|
| 545 |
+
<div class="tool-title">Modo Selector Facebook</div>
|
| 546 |
+
<div class="tool-desc">Selecciona o extrae reels y videos en lote.</div>
|
| 547 |
+
</div>
|
| 548 |
+
</div>
|
| 549 |
+
<label class="switch">
|
| 550 |
+
<input type="checkbox" id="toggle-facebook">
|
| 551 |
+
<span class="slider round"></span>
|
| 552 |
+
</label>
|
| 553 |
+
</div>
|
| 554 |
+
</div>
|
| 555 |
+
|
| 556 |
+
<!-- Módulo TikTok -->
|
| 557 |
+
<div class="tool-card" id="card-tiktok">
|
| 558 |
+
<div class="tool-header">
|
| 559 |
+
<div class="tool-info">
|
| 560 |
+
<div class="tool-icon">
|
| 561 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ff0050;"><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"></path></svg>
|
| 562 |
+
</div>
|
| 563 |
+
<div class="tool-text">
|
| 564 |
+
<div class="tool-title">Modo Selector TikTok</div>
|
| 565 |
+
<div class="tool-desc">Selecciona videos interactivamente o escanea perfiles.</div>
|
| 566 |
+
</div>
|
| 567 |
+
</div>
|
| 568 |
+
<label class="switch">
|
| 569 |
+
<input type="checkbox" id="toggle-tiktok">
|
| 570 |
+
<span class="slider round"></span>
|
| 571 |
+
</label>
|
| 572 |
+
</div>
|
| 573 |
+
</div>
|
| 574 |
+
|
| 575 |
+
<!-- Módulo Eporner -->
|
| 576 |
+
<div class="tool-card" id="card-eporner">
|
| 577 |
+
<div class="tool-header">
|
| 578 |
+
<div class="tool-info">
|
| 579 |
+
<div class="tool-icon">
|
| 580 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ff5500;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 581 |
+
</div>
|
| 582 |
+
<div class="tool-text">
|
| 583 |
+
<div class="tool-title">Modo Selector Eporner</div>
|
| 584 |
+
<div class="tool-desc">Selecciona videos interactivamente y copia sus enlaces.</div>
|
| 585 |
+
</div>
|
| 586 |
+
</div>
|
| 587 |
+
<label class="switch">
|
| 588 |
+
<input type="checkbox" id="toggle-eporner">
|
| 589 |
+
<span class="slider round"></span>
|
| 590 |
+
</label>
|
| 591 |
+
</div>
|
| 592 |
+
</div>
|
| 593 |
+
|
| 594 |
+
<!-- Módulo XHamster -->
|
| 595 |
+
<div class="tool-card" id="card-xhamster">
|
| 596 |
+
<div class="tool-header">
|
| 597 |
+
<div class="tool-info">
|
| 598 |
+
<div class="tool-icon">
|
| 599 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ef4444;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 600 |
+
</div>
|
| 601 |
+
<div class="tool-text">
|
| 602 |
+
<div class="tool-title">Modo Selector XHamster</div>
|
| 603 |
+
<div class="tool-desc">Selecciona videos interactivamente y copia sus enlaces.</div>
|
| 604 |
+
</div>
|
| 605 |
+
</div>
|
| 606 |
+
<label class="switch">
|
| 607 |
+
<input type="checkbox" id="toggle-xhamster">
|
| 608 |
+
<span class="slider round"></span>
|
| 609 |
+
</label>
|
| 610 |
+
</div>
|
| 611 |
+
</div>
|
| 612 |
+
|
| 613 |
+
<!-- Módulo iXXX -->
|
| 614 |
+
<div class="tool-card" id="card-ixxx">
|
| 615 |
+
<div class="tool-header">
|
| 616 |
+
<div class="tool-info">
|
| 617 |
+
<div class="tool-icon">
|
| 618 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ec4899;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 619 |
+
</div>
|
| 620 |
+
<div class="tool-text">
|
| 621 |
+
<div class="tool-title">Modo Selector iXXX</div>
|
| 622 |
+
<div class="tool-desc">Selecciona videos interactivamente y copia sus enlaces.</div>
|
| 623 |
+
</div>
|
| 624 |
+
</div>
|
| 625 |
+
<label class="switch">
|
| 626 |
+
<input type="checkbox" id="toggle-ixxx">
|
| 627 |
+
<span class="slider round"></span>
|
| 628 |
+
</label>
|
| 629 |
+
</div>
|
| 630 |
+
</div>
|
| 631 |
+
|
| 632 |
+
<!-- Módulo XHand -->
|
| 633 |
+
<div class="tool-card" id="card-xhand">
|
| 634 |
+
<div class="tool-header">
|
| 635 |
+
<div class="tool-info">
|
| 636 |
+
<div class="tool-icon">
|
| 637 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #a78bfa;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 638 |
+
</div>
|
| 639 |
+
<div class="tool-text">
|
| 640 |
+
<div class="tool-title">Modo Selector XHand</div>
|
| 641 |
+
<div class="tool-desc">Selecciona videos interactivamente y copia sus enlaces.</div>
|
| 642 |
+
</div>
|
| 643 |
+
</div>
|
| 644 |
+
<label class="switch">
|
| 645 |
+
<input type="checkbox" id="toggle-xhand">
|
| 646 |
+
<span class="slider round"></span>
|
| 647 |
+
</label>
|
| 648 |
+
</div>
|
| 649 |
+
</div>
|
| 650 |
+
|
| 651 |
+
<!-- Módulo JAV -->
|
| 652 |
+
<div class="tool-card" id="card-jav">
|
| 653 |
+
<div class="tool-header">
|
| 654 |
+
<div class="tool-info">
|
| 655 |
+
<div class="tool-icon">
|
| 656 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #f43f5e;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 657 |
+
</div>
|
| 658 |
+
<div class="tool-text">
|
| 659 |
+
<div class="tool-title">Modo Selector JAV</div>
|
| 660 |
+
<div class="tool-desc">Extrae enlaces HLS (.m3u8) de reproductores Surrit en 123AV y MissAV.</div>
|
| 661 |
+
</div>
|
| 662 |
+
</div>
|
| 663 |
+
<label class="switch">
|
| 664 |
+
<input type="checkbox" id="toggle-jav">
|
| 665 |
+
<span class="slider round"></span>
|
| 666 |
+
</label>
|
| 667 |
+
</div>
|
| 668 |
+
<div id="container-jav" class="tool-body" style="display: none;">
|
| 669 |
+
<div id="status-jav" class="status" style="display:none; margin-bottom: 12px;">
|
| 670 |
+
<svg class="spinner" width="24" height="24" viewBox="0 0 50 50" style="animation:spin 1s linear infinite;"><circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-dasharray="31.4 31.4" stroke-linecap="round" style="opacity:0.5;"></circle></svg>
|
| 671 |
+
<span>Escaneando reproductor JAV...</span>
|
| 672 |
+
</div>
|
| 673 |
+
<button id="scan-jav" class="primary" style="margin-bottom: 12px;">
|
| 674 |
+
🔍 Escanear y Generar Enlace
|
| 675 |
+
</button>
|
| 676 |
+
<button id="copy-all-jav" class="primary" style="display:none; margin-bottom: 12px;">
|
| 677 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
| 678 |
+
Copiar Todos
|
| 679 |
+
</button>
|
| 680 |
+
<ul id="jav-list"></ul>
|
| 681 |
+
</div>
|
| 682 |
+
</div>
|
| 683 |
+
|
| 684 |
+
<!-- Módulo Ladys.one -->
|
| 685 |
+
<div class="tool-card" id="card-ladys" style="display: none;">
|
| 686 |
+
<div class="tool-header">
|
| 687 |
+
<div class="tool-info">
|
| 688 |
+
<div class="tool-icon">
|
| 689 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ec4899;"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 690 |
+
</div>
|
| 691 |
+
<div class="tool-text">
|
| 692 |
+
<div class="tool-title">Modo Extractor Ladys.one</div>
|
| 693 |
+
<div class="tool-desc">Extrae todos los videos directos (.mp4) de la página de Ladys.one.</div>
|
| 694 |
+
</div>
|
| 695 |
+
</div>
|
| 696 |
+
<label class="switch">
|
| 697 |
+
<input type="checkbox" id="toggle-ladys">
|
| 698 |
+
<span class="slider round"></span>
|
| 699 |
+
</label>
|
| 700 |
+
</div>
|
| 701 |
+
<div id="container-ladys" class="tool-body" style="display: none;">
|
| 702 |
+
<div id="status-ladys" class="status" style="display:none; margin-bottom: 12px;">
|
| 703 |
+
<svg class="spinner" width="24" height="24" viewBox="0 0 50 50" style="animation:spin 1s linear infinite;"><circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-dasharray="31.4 31.4" stroke-linecap="round" style="opacity:0.5;"></circle></svg>
|
| 704 |
+
<span>Escaneando videos de Ladys.one...</span>
|
| 705 |
+
</div>
|
| 706 |
+
<button id="scan-ladys" class="primary" style="margin-bottom: 12px;">
|
| 707 |
+
🔍 Escanear videos de Ladys.one
|
| 708 |
+
</button>
|
| 709 |
+
<button id="copy-all-ladys" class="primary" style="display:none; margin-bottom: 12px;">
|
| 710 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
| 711 |
+
Copiar Todos
|
| 712 |
+
</button>
|
| 713 |
+
<ul id="ladys-list"></ul>
|
| 714 |
+
</div>
|
| 715 |
+
</div>
|
| 716 |
+
|
| 717 |
+
<!-- Módulo TWPornstars -->
|
| 718 |
+
<div class="tool-card" id="card-twpornstars" style="display: none;">
|
| 719 |
+
<div class="tool-header">
|
| 720 |
+
<div class="tool-info">
|
| 721 |
+
<div class="tool-icon">
|
| 722 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #60a5fa;"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 723 |
+
</div>
|
| 724 |
+
<div class="tool-text">
|
| 725 |
+
<div class="tool-title">Modo Extractor TWPornstars</div>
|
| 726 |
+
<div class="tool-desc">Extrae todos los videos directos (.mp4) de los perfiles de TWPornstars.</div>
|
| 727 |
+
</div>
|
| 728 |
+
</div>
|
| 729 |
+
<label class="switch">
|
| 730 |
+
<input type="checkbox" id="toggle-twpornstars">
|
| 731 |
+
<span class="slider round"></span>
|
| 732 |
+
</label>
|
| 733 |
+
</div>
|
| 734 |
+
<div id="container-twpornstars" class="tool-body" style="display: none;">
|
| 735 |
+
<div id="status-twpornstars" class="status" style="display:none; margin-bottom: 12px;">
|
| 736 |
+
<svg class="spinner" width="24" height="24" viewBox="0 0 50 50" style="animation:spin 1s linear infinite;"><circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-dasharray="31.4 31.4" stroke-linecap="round" style="opacity:0.5;"></circle></svg>
|
| 737 |
+
<span>Escaneando videos de TWPornstars...</span>
|
| 738 |
+
</div>
|
| 739 |
+
<button id="scan-twpornstars" class="primary" style="margin-bottom: 12px;">
|
| 740 |
+
🔍 Escanear videos de TWPornstars
|
| 741 |
+
</button>
|
| 742 |
+
<button id="deep-scan-twpornstars" class="secondary" style="display:none; margin-bottom: 12px;">
|
| 743 |
+
🔍 Escanear todas las páginas
|
| 744 |
+
</button>
|
| 745 |
+
<button id="copy-all-twpornstars" class="primary" style="display:none; margin-bottom: 12px;">
|
| 746 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
| 747 |
+
Copiar Todos
|
| 748 |
+
</button>
|
| 749 |
+
<ul id="twpornstars-list"></ul>
|
| 750 |
+
</div>
|
| 751 |
+
</div>
|
| 752 |
+
|
| 753 |
+
<!-- Módulo LeakGallery -->
|
| 754 |
+
<div class="tool-card" id="card-leakgallery" style="display: none;">
|
| 755 |
+
<div class="tool-header">
|
| 756 |
+
<div class="tool-info">
|
| 757 |
+
<div class="tool-icon">
|
| 758 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #10b981;"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 759 |
+
</div>
|
| 760 |
+
<div class="tool-text">
|
| 761 |
+
<div class="tool-title">Modo Extractor LeakGallery</div>
|
| 762 |
+
<div class="tool-desc">Extrae todos los videos directos (.mp4) de los perfiles de LeakGallery.</div>
|
| 763 |
+
</div>
|
| 764 |
+
</div>
|
| 765 |
+
<label class="switch">
|
| 766 |
+
<input type="checkbox" id="toggle-leakgallery">
|
| 767 |
+
<span class="slider round"></span>
|
| 768 |
+
</label>
|
| 769 |
+
</div>
|
| 770 |
+
<div id="container-leakgallery" class="tool-body" style="display: none;">
|
| 771 |
+
<div id="status-leakgallery" class="status" style="display:none; margin-bottom: 12px;">
|
| 772 |
+
<svg class="spinner" width="24" height="24" viewBox="0 0 50 50" style="animation:spin 1s linear infinite;"><circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-dasharray="31.4 31.4" stroke-linecap="round" style="opacity:0.5;"></circle></svg>
|
| 773 |
+
<span>Escaneando videos de LeakGallery...</span>
|
| 774 |
+
</div>
|
| 775 |
+
<button id="scan-leakgallery" class="primary" style="margin-bottom: 12px;">
|
| 776 |
+
🔍 Escanear videos de LeakGallery
|
| 777 |
+
</button>
|
| 778 |
+
<button id="copy-all-leakgallery" class="primary" style="display:none; margin-bottom: 12px;">
|
| 779 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
| 780 |
+
Copiar Todos
|
| 781 |
+
</button>
|
| 782 |
+
<ul id="leakgallery-list"></ul>
|
| 783 |
+
</div>
|
| 784 |
+
</div>
|
| 785 |
+
|
| 786 |
+
<!-- Módulo XVideos -->
|
| 787 |
+
<div class="tool-card" id="card-xvideos" style="display: none;">
|
| 788 |
+
<div class="tool-header">
|
| 789 |
+
<div class="tool-info">
|
| 790 |
+
<div class="tool-icon">
|
| 791 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #a855f7;"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
| 792 |
+
</div>
|
| 793 |
+
<div class="tool-text">
|
| 794 |
+
<div class="tool-title">Modo Selector XVideos</div>
|
| 795 |
+
<div class="tool-desc">Selecciona miniaturas en XVideos de forma interactiva y copia los enlaces.</div>
|
| 796 |
+
</div>
|
| 797 |
+
</div>
|
| 798 |
+
<label class="switch">
|
| 799 |
+
<input type="checkbox" id="toggle-xvideos">
|
| 800 |
+
<span class="slider round"></span>
|
| 801 |
+
</label>
|
| 802 |
+
</div>
|
| 803 |
+
</div>
|
| 804 |
+
|
| 805 |
+
<!-- Módulo Pornhub -->
|
| 806 |
+
<div class="tool-card" id="card-pornhub" style="display: none;">
|
| 807 |
+
<div class="tool-header">
|
| 808 |
+
<div class="tool-info">
|
| 809 |
+
<div class="tool-icon">
|
| 810 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ff9000;"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>
|
| 811 |
+
</div>
|
| 812 |
+
<div class="tool-text">
|
| 813 |
+
<div class="tool-title">Modo Selector Pornhub</div>
|
| 814 |
+
<div class="tool-desc">Selecciona miniaturas en Pornhub de forma interactiva y copia los enlaces de los videos.</div>
|
| 815 |
+
</div>
|
| 816 |
+
</div>
|
| 817 |
+
<label class="switch">
|
| 818 |
+
<input type="checkbox" id="toggle-pornhub">
|
| 819 |
+
<span class="slider round"></span>
|
| 820 |
+
</label>
|
| 821 |
+
</div>
|
| 822 |
+
</div>
|
| 823 |
+
|
| 824 |
+
<!-- Módulo Instagram -->
|
| 825 |
+
<div class="tool-card" id="card-instagram" style="display: none;">
|
| 826 |
+
<div class="tool-header">
|
| 827 |
+
<div class="tool-info">
|
| 828 |
+
<div class="tool-icon">
|
| 829 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #e1306c;"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg>
|
| 830 |
+
</div>
|
| 831 |
+
<div class="tool-text">
|
| 832 |
+
<div class="tool-title">Modo Selector Instagram</div>
|
| 833 |
+
<div class="tool-desc">Selecciona publicaciones en Instagram de forma interactiva y copia los enlaces.</div>
|
| 834 |
+
</div>
|
| 835 |
+
</div>
|
| 836 |
+
<label class="switch">
|
| 837 |
+
<input type="checkbox" id="toggle-instagram">
|
| 838 |
+
<span class="slider round"></span>
|
| 839 |
+
</label>
|
| 840 |
+
</div>
|
| 841 |
+
</div>
|
| 842 |
+
|
| 843 |
+
<!-- Módulo X (Twitter) -->
|
| 844 |
+
<div class="tool-card" id="card-x" style="display: none;">
|
| 845 |
+
<div class="tool-header">
|
| 846 |
+
<div class="tool-info">
|
| 847 |
+
<div class="tool-icon" style="background: #000; color: #fff; border-color: #333;">
|
| 848 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4l11.733 16h4.267l-11.733 -16z" /><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" /></svg>
|
| 849 |
+
</div>
|
| 850 |
+
<div class="tool-text">
|
| 851 |
+
<div class="tool-title">Auto Extractor X (Videos)</div>
|
| 852 |
+
<div class="tool-desc">Extrae todos los videos del usuario haciendo scroll automáticamente.</div>
|
| 853 |
+
</div>
|
| 854 |
+
</div>
|
| 855 |
+
<label class="switch">
|
| 856 |
+
<input type="checkbox" id="toggle-x">
|
| 857 |
+
<span class="slider round"></span>
|
| 858 |
+
</label>
|
| 859 |
+
</div>
|
| 860 |
+
</div>
|
| 861 |
+
|
| 862 |
+
</div>
|
| 863 |
+
|
| 864 |
+
<script src="popup.js"></script>
|
| 865 |
+
</body>
|
| 866 |
+
</html>
|
detector de enlaces - copia/popup.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
detector de enlaces - copia/src/eporner/selector.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(window.__epornerSelectorActive) return;
|
| 3 |
+
window.__epornerSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'eporner-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const selectAllBtn = document.createElement('button');
|
| 34 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 35 |
+
selectAllBtn.style.cssText = `
|
| 36 |
+
background: #3f3f46;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 8px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: 600;
|
| 43 |
+
font-size: 13px;
|
| 44 |
+
transition: background 0.2s;
|
| 45 |
+
`;
|
| 46 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 47 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 48 |
+
|
| 49 |
+
const copyBtn = document.createElement('button');
|
| 50 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 51 |
+
copyBtn.style.cssText = `
|
| 52 |
+
background: #ff5500;
|
| 53 |
+
color: white;
|
| 54 |
+
border: none;
|
| 55 |
+
padding: 10px;
|
| 56 |
+
border-radius: 6px;
|
| 57 |
+
cursor: pointer;
|
| 58 |
+
font-weight: bold;
|
| 59 |
+
`;
|
| 60 |
+
|
| 61 |
+
const closeBtn = document.createElement('button');
|
| 62 |
+
closeBtn.id = 'eporner-close-btn';
|
| 63 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 64 |
+
closeBtn.style.cssText = `
|
| 65 |
+
background: #27272a;
|
| 66 |
+
color: white;
|
| 67 |
+
border: 1px solid #3f3f46;
|
| 68 |
+
padding: 8px;
|
| 69 |
+
border-radius: 6px;
|
| 70 |
+
cursor: pointer;
|
| 71 |
+
font-size: 13px;
|
| 72 |
+
`;
|
| 73 |
+
|
| 74 |
+
container.appendChild(countDisplay);
|
| 75 |
+
container.appendChild(selectAllBtn);
|
| 76 |
+
container.appendChild(copyBtn);
|
| 77 |
+
container.appendChild(closeBtn);
|
| 78 |
+
document.body.appendChild(container);
|
| 79 |
+
|
| 80 |
+
const style = document.createElement('style');
|
| 81 |
+
style.id = 'eporner-style';
|
| 82 |
+
style.textContent = `
|
| 83 |
+
.eporner-selector-selected {
|
| 84 |
+
position: relative !important;
|
| 85 |
+
outline: 4px solid #10b981 !important;
|
| 86 |
+
outline-offset: -4px !important;
|
| 87 |
+
}
|
| 88 |
+
.eporner-selector-selected::after {
|
| 89 |
+
content: '✓' !important;
|
| 90 |
+
position: absolute !important;
|
| 91 |
+
top: 10px !important;
|
| 92 |
+
left: 10px !important;
|
| 93 |
+
background: #10b981 !important;
|
| 94 |
+
color: white !important;
|
| 95 |
+
border-radius: 50% !important;
|
| 96 |
+
width: 28px !important;
|
| 97 |
+
height: 28px !important;
|
| 98 |
+
display: flex !important;
|
| 99 |
+
align-items: center !important;
|
| 100 |
+
justify-content: center !important;
|
| 101 |
+
font-weight: bold !important;
|
| 102 |
+
font-size: 16px !important;
|
| 103 |
+
z-index: 2147483647 !important;
|
| 104 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5) !important;
|
| 105 |
+
pointer-events: none !important;
|
| 106 |
+
}
|
| 107 |
+
`;
|
| 108 |
+
document.head.appendChild(style);
|
| 109 |
+
|
| 110 |
+
// Helper to get normalized URLs for matching
|
| 111 |
+
const getCleanUrl = (href) => {
|
| 112 |
+
if (!href) return '';
|
| 113 |
+
let url = href.split('?')[0].split('#')[0].trim();
|
| 114 |
+
if (url.endsWith('/')) {
|
| 115 |
+
url = url.slice(0, -1);
|
| 116 |
+
}
|
| 117 |
+
return url;
|
| 118 |
+
};
|
| 119 |
+
|
| 120 |
+
// Helper to check if an anchor is a thumbnail cover rather than text title (robust and crash-proof)
|
| 121 |
+
const isThumbnailAnchor = (a) => {
|
| 122 |
+
if (!a) return false;
|
| 123 |
+
if (a.__isThumbnail) return true;
|
| 124 |
+
|
| 125 |
+
// 1. If it contains an image, video, canvas, or thumbnail class-like elements
|
| 126 |
+
if (a.querySelector('img, picture, canvas, video, [class*="thumb"], [class*="img"], [class*="preview"], [class*="cover"]')) return true;
|
| 127 |
+
|
| 128 |
+
// 2. Safe class name parsing (prevent crashes on animated SVG string wrappers)
|
| 129 |
+
let className = '';
|
| 130 |
+
if (typeof a.className === 'string') {
|
| 131 |
+
className = a.className.toLowerCase();
|
| 132 |
+
} else if (a.className && typeof a.className.baseVal === 'string') {
|
| 133 |
+
className = a.className.baseVal.toLowerCase();
|
| 134 |
+
}
|
| 135 |
+
if (className.includes('thumb') || className.includes('img') || className.includes('preview') || className.includes('cover') || className.includes('vimg')) return true;
|
| 136 |
+
|
| 137 |
+
// 3. Fallback: if it has short text content and wraps some tag, it is likely a thumbnail (like Eporner lazy loaders)
|
| 138 |
+
const textLen = a.textContent.trim().length;
|
| 139 |
+
if (textLen < 15 && a.querySelector('*')) return true;
|
| 140 |
+
|
| 141 |
+
return false;
|
| 142 |
+
};
|
| 143 |
+
|
| 144 |
+
// Capture and save initial attributes before they are mutated by site scripts
|
| 145 |
+
const initAnchors = () => {
|
| 146 |
+
document.querySelectorAll('a[href*="/video-"]').forEach(a => {
|
| 147 |
+
if (isThumbnailAnchor(a)) {
|
| 148 |
+
a.__isThumbnail = true;
|
| 149 |
+
if (!a.__originalVideoUrl) {
|
| 150 |
+
const url = getCleanUrl(a.href);
|
| 151 |
+
if (url && !url.startsWith('javascript') && url !== '#' && !url.includes('void(0)')) {
|
| 152 |
+
a.__originalVideoUrl = url;
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
});
|
| 157 |
+
};
|
| 158 |
+
|
| 159 |
+
// Run initial scan
|
| 160 |
+
initAnchors();
|
| 161 |
+
|
| 162 |
+
// Scan periodically to catch new elements (scroll/pagination)
|
| 163 |
+
const initInterval = setInterval(initAnchors, 800);
|
| 164 |
+
|
| 165 |
+
const toggleCardSelection = (url, select) => {
|
| 166 |
+
initAnchors();
|
| 167 |
+
document.querySelectorAll('a[href*="/video-"]').forEach(a => {
|
| 168 |
+
if (a.__originalVideoUrl === url && a.__isThumbnail) {
|
| 169 |
+
if (select) {
|
| 170 |
+
a.classList.add('eporner-selector-selected');
|
| 171 |
+
} else {
|
| 172 |
+
a.classList.remove('eporner-selector-selected');
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
});
|
| 176 |
+
};
|
| 177 |
+
|
| 178 |
+
const clickHandler = (e) => {
|
| 179 |
+
const card = e.target.closest('a[href*="/video-"]');
|
| 180 |
+
if (card) {
|
| 181 |
+
initAnchors();
|
| 182 |
+
if (card.__isThumbnail) {
|
| 183 |
+
let url = card.__originalVideoUrl;
|
| 184 |
+
if (!url && card.href && !card.href.startsWith('javascript') && card.href !== '#') {
|
| 185 |
+
url = getCleanUrl(card.href);
|
| 186 |
+
card.__originalVideoUrl = url;
|
| 187 |
+
}
|
| 188 |
+
if (!url) return;
|
| 189 |
+
|
| 190 |
+
e.preventDefault();
|
| 191 |
+
e.stopPropagation();
|
| 192 |
+
|
| 193 |
+
if (selectedLinks.has(url)) {
|
| 194 |
+
selectedLinks.delete(url);
|
| 195 |
+
toggleCardSelection(url, false);
|
| 196 |
+
} else {
|
| 197 |
+
selectedLinks.add(url);
|
| 198 |
+
toggleCardSelection(url, true);
|
| 199 |
+
}
|
| 200 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
document.addEventListener('click', clickHandler, true);
|
| 206 |
+
|
| 207 |
+
selectAllBtn.onclick = () => {
|
| 208 |
+
initAnchors();
|
| 209 |
+
const links = [];
|
| 210 |
+
document.querySelectorAll('a[href*="/video-"]').forEach(a => {
|
| 211 |
+
if (a.__isThumbnail && a.__originalVideoUrl) {
|
| 212 |
+
links.push(a);
|
| 213 |
+
}
|
| 214 |
+
});
|
| 215 |
+
|
| 216 |
+
let allSelected = true;
|
| 217 |
+
links.forEach(a => {
|
| 218 |
+
const url = a.__originalVideoUrl;
|
| 219 |
+
if (!selectedLinks.has(url)) {
|
| 220 |
+
allSelected = false;
|
| 221 |
+
}
|
| 222 |
+
});
|
| 223 |
+
|
| 224 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 225 |
+
links.forEach(a => {
|
| 226 |
+
const url = a.__originalVideoUrl;
|
| 227 |
+
selectedLinks.delete(url);
|
| 228 |
+
toggleCardSelection(url, false);
|
| 229 |
+
});
|
| 230 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 231 |
+
} else {
|
| 232 |
+
links.forEach(a => {
|
| 233 |
+
const url = a.__originalVideoUrl;
|
| 234 |
+
if (!selectedLinks.has(url)) {
|
| 235 |
+
selectedLinks.add(url);
|
| 236 |
+
toggleCardSelection(url, true);
|
| 237 |
+
}
|
| 238 |
+
});
|
| 239 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 240 |
+
}
|
| 241 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 242 |
+
};
|
| 243 |
+
|
| 244 |
+
copyBtn.onclick = () => {
|
| 245 |
+
if (selectedLinks.size === 0) return;
|
| 246 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 247 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 248 |
+
const ogText = copyBtn.textContent;
|
| 249 |
+
copyBtn.textContent = '¡Copiados!';
|
| 250 |
+
copyBtn.style.background = '#10b981';
|
| 251 |
+
setTimeout(() => {
|
| 252 |
+
copyBtn.textContent = ogText;
|
| 253 |
+
copyBtn.style.background = '#ff5500';
|
| 254 |
+
}, 2000);
|
| 255 |
+
});
|
| 256 |
+
};
|
| 257 |
+
|
| 258 |
+
closeBtn.onclick = () => {
|
| 259 |
+
clearInterval(initInterval);
|
| 260 |
+
document.removeEventListener('click', clickHandler, true);
|
| 261 |
+
container.remove();
|
| 262 |
+
style.remove();
|
| 263 |
+
|
| 264 |
+
document.querySelectorAll('.eporner-selector-selected').forEach(el => el.classList.remove('eporner-selector-selected'));
|
| 265 |
+
|
| 266 |
+
window.__epornerSelectorActive = false;
|
| 267 |
+
|
| 268 |
+
try {
|
| 269 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'eporner' });
|
| 270 |
+
} catch (e) {
|
| 271 |
+
console.log("Could not notify popup, it is probably closed");
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
window.dispatchEvent(new Event('EPORNER_OFF'));
|
| 275 |
+
};
|
| 276 |
+
})();
|
detector de enlaces - copia/src/erome/quick_scan.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
let urls = new Set();
|
| 3 |
+
let albumLinks = new Set();
|
| 4 |
+
|
| 5 |
+
try {
|
| 6 |
+
document.querySelectorAll('video').forEach(v => {
|
| 7 |
+
if (v.src && !v.src.startsWith('blob:')) urls.add(v.src);
|
| 8 |
+
v.querySelectorAll('source').forEach(s => {
|
| 9 |
+
if (s.src && !s.src.startsWith('blob:')) urls.add(s.src);
|
| 10 |
+
});
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
+
document.querySelectorAll('a').forEach(a => {
|
| 14 |
+
if (a.href && typeof a.href === 'string') {
|
| 15 |
+
if (a.href.includes('.mp4')) {
|
| 16 |
+
urls.add(a.href);
|
| 17 |
+
} else if (a.href.includes('facebook.com/reel/') || a.href.match(/facebook\.com\/.*\/videos\//)) {
|
| 18 |
+
urls.add(a.href.split('?')[0]);
|
| 19 |
+
} else if (a.href.includes('facebook.com/watch')) {
|
| 20 |
+
urls.add(a.href);
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
if (a.href.match(/erome\.com\/a\/[a-zA-Z0-9]+/)) {
|
| 24 |
+
albumLinks.add(a.href);
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
});
|
| 28 |
+
} catch(e) {
|
| 29 |
+
return { error: e.message };
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
return {
|
| 33 |
+
videos: Array.from(urls),
|
| 34 |
+
albums: Array.from(albumLinks)
|
| 35 |
+
};
|
| 36 |
+
})();
|
detector de enlaces - copia/src/erome/quick_scan_images.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
let urls = new Set();
|
| 3 |
+
let albumLinks = new Set();
|
| 4 |
+
// Extract album ID from current page URL
|
| 5 |
+
const pageUrl = window.location.href;
|
| 6 |
+
const albumMatch = pageUrl.match(/erome\.com\/a\/([a-zA-Z0-9]+)/);
|
| 7 |
+
const currentAlbumId = albumMatch ? albumMatch[1] : null;
|
| 8 |
+
|
| 9 |
+
const isAlbumImageUrl = (url) => {
|
| 10 |
+
if (!url) return false;
|
| 11 |
+
const lower = url.toLowerCase();
|
| 12 |
+
if (lower.includes('/avatar/') || lower.includes('/icon/') || lower.includes('/logo/') || lower.includes('logo') || lower.includes('/thumbs/') || lower.includes('/img/')) {
|
| 13 |
+
return false;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
// If we are on an album page, only include images that belong to the current album ID
|
| 17 |
+
if (currentAlbumId) {
|
| 18 |
+
if (!lower.includes('/' + currentAlbumId.toLowerCase() + '/')) {
|
| 19 |
+
return false;
|
| 20 |
+
}
|
| 21 |
+
} else {
|
| 22 |
+
// On non-album pages (e.g. search/home), we don't want to collect cover thumbnails of albums as images.
|
| 23 |
+
return false;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
return lower.includes('erome.com') && (lower.endsWith('.jpg') || lower.endsWith('.jpeg') || lower.endsWith('.png') || lower.endsWith('.webp') || lower.includes('.jpg?') || lower.includes('.jpeg?') || lower.includes('.png?') || lower.includes('.webp?'));
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
try {
|
| 30 |
+
document.querySelectorAll('img').forEach(img => {
|
| 31 |
+
const src = img.src || img.getAttribute('data-src') || img.getAttribute('data-lazy');
|
| 32 |
+
if (src && isAlbumImageUrl(src)) {
|
| 33 |
+
urls.add(src);
|
| 34 |
+
}
|
| 35 |
+
});
|
| 36 |
+
|
| 37 |
+
document.querySelectorAll('[style*="background-image"]').forEach(el => {
|
| 38 |
+
const style = el.getAttribute('style');
|
| 39 |
+
const match = style.match(/url\(['"]?([^'"]+)['"]?\)/);
|
| 40 |
+
if (match && isAlbumImageUrl(match[1])) {
|
| 41 |
+
urls.add(match[1]);
|
| 42 |
+
}
|
| 43 |
+
});
|
| 44 |
+
|
| 45 |
+
document.querySelectorAll('a').forEach(a => {
|
| 46 |
+
if (a.href && typeof a.href === 'string') {
|
| 47 |
+
if (a.href.match(/erome\.com\/a\/[a-zA-Z0-9]+/)) {
|
| 48 |
+
albumLinks.add(a.href);
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
});
|
| 52 |
+
} catch(e) {
|
| 53 |
+
return { error: e.message };
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
return {
|
| 57 |
+
images: Array.from(urls),
|
| 58 |
+
albums: Array.from(albumLinks)
|
| 59 |
+
};
|
| 60 |
+
})();
|
detector de enlaces - copia/src/facebook/selector.js
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (document.getElementById('fb-floating-ui')) return;
|
| 3 |
+
window.__fbSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'fb-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 2147483647;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const autoScanBtn = document.createElement('button');
|
| 34 |
+
autoScanBtn.textContent = 'Buscar enlaces de videos';
|
| 35 |
+
autoScanBtn.style.cssText = `
|
| 36 |
+
background: #2563eb;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 10px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: bold;
|
| 43 |
+
`;
|
| 44 |
+
|
| 45 |
+
const copyBtn = document.createElement('button');
|
| 46 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 47 |
+
copyBtn.style.cssText = `
|
| 48 |
+
background: #8b5cf6;
|
| 49 |
+
color: white;
|
| 50 |
+
border: none;
|
| 51 |
+
padding: 10px;
|
| 52 |
+
border-radius: 6px;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
font-weight: bold;
|
| 55 |
+
`;
|
| 56 |
+
|
| 57 |
+
const selectAllBtn = document.createElement('button');
|
| 58 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 59 |
+
selectAllBtn.style.cssText = `
|
| 60 |
+
background: #3f3f46;
|
| 61 |
+
color: white;
|
| 62 |
+
border: none;
|
| 63 |
+
padding: 8px;
|
| 64 |
+
border-radius: 6px;
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
font-weight: 600;
|
| 67 |
+
font-size: 13px;
|
| 68 |
+
transition: background 0.2s;
|
| 69 |
+
`;
|
| 70 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 71 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 72 |
+
|
| 73 |
+
const closeBtn = document.createElement('button');
|
| 74 |
+
closeBtn.id = 'fb-close-btn';
|
| 75 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 76 |
+
closeBtn.style.cssText = `
|
| 77 |
+
background: #27272a;
|
| 78 |
+
color: white;
|
| 79 |
+
border: 1px solid #3f3f46;
|
| 80 |
+
padding: 8px;
|
| 81 |
+
border-radius: 6px;
|
| 82 |
+
cursor: pointer;
|
| 83 |
+
font-size: 13px;
|
| 84 |
+
`;
|
| 85 |
+
|
| 86 |
+
container.appendChild(countDisplay);
|
| 87 |
+
container.appendChild(autoScanBtn);
|
| 88 |
+
container.appendChild(selectAllBtn);
|
| 89 |
+
container.appendChild(copyBtn);
|
| 90 |
+
container.appendChild(closeBtn);
|
| 91 |
+
(document.body || document.documentElement).appendChild(container);
|
| 92 |
+
|
| 93 |
+
const style = document.createElement('style');
|
| 94 |
+
style.id = 'fb-style';
|
| 95 |
+
style.textContent = `
|
| 96 |
+
.fb-selector-hover {
|
| 97 |
+
outline: 3px solid #60a5fa !important;
|
| 98 |
+
cursor: crosshair !important;
|
| 99 |
+
transition: all 0.2s;
|
| 100 |
+
}
|
| 101 |
+
.fb-selector-selected {
|
| 102 |
+
outline: 4px solid #10b981 !important;
|
| 103 |
+
opacity: 0.8;
|
| 104 |
+
position: relative;
|
| 105 |
+
}
|
| 106 |
+
.fb-selector-selected::after {
|
| 107 |
+
content: '✓';
|
| 108 |
+
position: absolute;
|
| 109 |
+
top: 10px;
|
| 110 |
+
right: 10px;
|
| 111 |
+
background: #10b981;
|
| 112 |
+
color: white;
|
| 113 |
+
border-radius: 50%;
|
| 114 |
+
width: 30px;
|
| 115 |
+
height: 30px;
|
| 116 |
+
display: flex;
|
| 117 |
+
align-items: center;
|
| 118 |
+
justify-content: center;
|
| 119 |
+
font-weight: bold;
|
| 120 |
+
font-size: 16px;
|
| 121 |
+
z-index: 10;
|
| 122 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
|
| 123 |
+
}
|
| 124 |
+
`;
|
| 125 |
+
(document.head || document.documentElement).appendChild(style);
|
| 126 |
+
|
| 127 |
+
const getPostCard = (el) => el.closest('a[href*="/reel/"], a[href*="/videos/"], a[href*="/watch/"]');
|
| 128 |
+
|
| 129 |
+
let isDragging = false;
|
| 130 |
+
let dragMode = null;
|
| 131 |
+
|
| 132 |
+
const mouseOver = (e) => {
|
| 133 |
+
const card = getPostCard(e.target);
|
| 134 |
+
if (card) {
|
| 135 |
+
if (isDragging) {
|
| 136 |
+
e.preventDefault();
|
| 137 |
+
e.stopPropagation();
|
| 138 |
+
|
| 139 |
+
const url = card.href.split('?')[0];
|
| 140 |
+
|
| 141 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 142 |
+
selectedLinks.add(url);
|
| 143 |
+
card.classList.add('fb-selector-selected');
|
| 144 |
+
card.classList.remove('fb-selector-hover');
|
| 145 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 146 |
+
selectedLinks.delete(url);
|
| 147 |
+
card.classList.remove('fb-selector-selected');
|
| 148 |
+
}
|
| 149 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 150 |
+
} else {
|
| 151 |
+
if (!card.classList.contains('fb-selector-selected')) {
|
| 152 |
+
card.classList.add('fb-selector-hover');
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
};
|
| 157 |
+
|
| 158 |
+
const mouseOut = (e) => {
|
| 159 |
+
const card = getPostCard(e.target);
|
| 160 |
+
if (card) {
|
| 161 |
+
card.classList.remove('fb-selector-hover');
|
| 162 |
+
}
|
| 163 |
+
};
|
| 164 |
+
|
| 165 |
+
const mouseDown = (e) => {
|
| 166 |
+
const card = getPostCard(e.target);
|
| 167 |
+
if (card) {
|
| 168 |
+
e.preventDefault();
|
| 169 |
+
isDragging = true;
|
| 170 |
+
|
| 171 |
+
const url = card.href.split('?')[0];
|
| 172 |
+
|
| 173 |
+
if (selectedLinks.has(url)) {
|
| 174 |
+
dragMode = 'deselect';
|
| 175 |
+
selectedLinks.delete(url);
|
| 176 |
+
card.classList.remove('fb-selector-selected');
|
| 177 |
+
} else {
|
| 178 |
+
dragMode = 'select';
|
| 179 |
+
selectedLinks.add(url);
|
| 180 |
+
card.classList.add('fb-selector-selected');
|
| 181 |
+
card.classList.remove('fb-selector-hover');
|
| 182 |
+
}
|
| 183 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 184 |
+
}
|
| 185 |
+
};
|
| 186 |
+
|
| 187 |
+
const mouseUp = (e) => {
|
| 188 |
+
isDragging = false;
|
| 189 |
+
dragMode = null;
|
| 190 |
+
};
|
| 191 |
+
|
| 192 |
+
const dragStart = (e) => {
|
| 193 |
+
const card = getPostCard(e.target);
|
| 194 |
+
if (card) e.preventDefault();
|
| 195 |
+
};
|
| 196 |
+
|
| 197 |
+
const click = (e) => {
|
| 198 |
+
const card = getPostCard(e.target);
|
| 199 |
+
if (card) {
|
| 200 |
+
e.preventDefault();
|
| 201 |
+
e.stopPropagation();
|
| 202 |
+
}
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 206 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 207 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 208 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 209 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 210 |
+
document.addEventListener('click', click, true);
|
| 211 |
+
|
| 212 |
+
let scanInterval = null;
|
| 213 |
+
|
| 214 |
+
autoScanBtn.onclick = () => {
|
| 215 |
+
if (window.__fbIsScanning) {
|
| 216 |
+
clearInterval(scanInterval);
|
| 217 |
+
window.__fbIsScanning = false;
|
| 218 |
+
autoScanBtn.textContent = 'Buscar enlaces de videos';
|
| 219 |
+
autoScanBtn.style.background = '#2563eb';
|
| 220 |
+
return;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
window.__fbIsScanning = true;
|
| 224 |
+
autoScanBtn.textContent = 'Buscando... (0)';
|
| 225 |
+
autoScanBtn.style.background = '#ef4444';
|
| 226 |
+
|
| 227 |
+
let lastHeight = 0;
|
| 228 |
+
let retries = 0;
|
| 229 |
+
const maxRetries = 5;
|
| 230 |
+
|
| 231 |
+
scanInterval = setInterval(() => {
|
| 232 |
+
window.scrollTo(0, document.body.scrollHeight);
|
| 233 |
+
|
| 234 |
+
const links = document.querySelectorAll('a[href*="/reel/"], a[href*="/videos/"], a[href*="/watch/"]');
|
| 235 |
+
let addedNew = false;
|
| 236 |
+
links.forEach(a => {
|
| 237 |
+
let cleanUrl = a.href.split('?')[0];
|
| 238 |
+
if (!selectedLinks.has(cleanUrl)) {
|
| 239 |
+
selectedLinks.add(cleanUrl);
|
| 240 |
+
a.classList.add('fb-selector-selected');
|
| 241 |
+
a.classList.remove('fb-selector-hover');
|
| 242 |
+
addedNew = true;
|
| 243 |
+
}
|
| 244 |
+
});
|
| 245 |
+
|
| 246 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 247 |
+
autoScanBtn.textContent = 'Detener búsqueda (' + selectedLinks.size + ')';
|
| 248 |
+
|
| 249 |
+
if (document.body.scrollHeight === lastHeight && !addedNew) {
|
| 250 |
+
retries++;
|
| 251 |
+
if (retries >= maxRetries) {
|
| 252 |
+
clearInterval(scanInterval);
|
| 253 |
+
window.__fbIsScanning = false;
|
| 254 |
+
autoScanBtn.textContent = 'Buscar enlaces de videos';
|
| 255 |
+
autoScanBtn.style.background = '#2563eb';
|
| 256 |
+
}
|
| 257 |
+
} else {
|
| 258 |
+
retries = 0;
|
| 259 |
+
}
|
| 260 |
+
lastHeight = document.body.scrollHeight;
|
| 261 |
+
}, 1500);
|
| 262 |
+
};
|
| 263 |
+
|
| 264 |
+
selectAllBtn.onclick = () => {
|
| 265 |
+
const cards = document.querySelectorAll('a[href*="/reel/"], a[href*="/videos/"], a[href*="/watch/"]');
|
| 266 |
+
let allSelected = true;
|
| 267 |
+
|
| 268 |
+
cards.forEach(card => {
|
| 269 |
+
const url = card.href.split('?')[0];
|
| 270 |
+
if (!selectedLinks.has(url)) {
|
| 271 |
+
allSelected = false;
|
| 272 |
+
}
|
| 273 |
+
});
|
| 274 |
+
|
| 275 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 276 |
+
cards.forEach(card => {
|
| 277 |
+
card.classList.remove('fb-selector-selected');
|
| 278 |
+
const url = card.href.split('?')[0];
|
| 279 |
+
selectedLinks.delete(url);
|
| 280 |
+
});
|
| 281 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 282 |
+
} else {
|
| 283 |
+
cards.forEach(card => {
|
| 284 |
+
const url = card.href.split('?')[0];
|
| 285 |
+
if (!selectedLinks.has(url)) {
|
| 286 |
+
selectedLinks.add(url);
|
| 287 |
+
card.classList.add('fb-selector-selected');
|
| 288 |
+
card.classList.remove('fb-selector-hover');
|
| 289 |
+
}
|
| 290 |
+
});
|
| 291 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 292 |
+
}
|
| 293 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 294 |
+
};
|
| 295 |
+
|
| 296 |
+
copyBtn.onclick = () => {
|
| 297 |
+
if (selectedLinks.size === 0) return;
|
| 298 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 299 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 300 |
+
const ogText = copyBtn.textContent;
|
| 301 |
+
copyBtn.textContent = '¡Copiados!';
|
| 302 |
+
copyBtn.style.background = '#10b981';
|
| 303 |
+
setTimeout(() => {
|
| 304 |
+
copyBtn.textContent = ogText;
|
| 305 |
+
copyBtn.style.background = '#8b5cf6';
|
| 306 |
+
}, 2000);
|
| 307 |
+
});
|
| 308 |
+
};
|
| 309 |
+
|
| 310 |
+
closeBtn.onclick = () => {
|
| 311 |
+
if (scanInterval) clearInterval(scanInterval);
|
| 312 |
+
window.__fbIsScanning = false;
|
| 313 |
+
|
| 314 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 315 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 316 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 317 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 318 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 319 |
+
document.removeEventListener('click', click, true);
|
| 320 |
+
container.remove();
|
| 321 |
+
style.remove();
|
| 322 |
+
document.querySelectorAll('.fb-selector-selected').forEach(el => el.classList.remove('fb-selector-selected'));
|
| 323 |
+
document.querySelectorAll('.fb-selector-hover').forEach(el => el.classList.remove('fb-selector-hover'));
|
| 324 |
+
window.__fbSelectorActive = false;
|
| 325 |
+
|
| 326 |
+
window.dispatchEvent(new Event('FB_OFF'));
|
| 327 |
+
};
|
| 328 |
+
})();
|
detector de enlaces - copia/src/instagram/selector.js
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (document.getElementById('instagram-floating-ui')) return;
|
| 3 |
+
window.__instagramSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'instagram-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 16px;
|
| 16 |
+
border-radius: 12px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 2147483647;
|
| 19 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
| 20 |
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 220px;
|
| 25 |
+
user-select: none;
|
| 26 |
+
`;
|
| 27 |
+
|
| 28 |
+
const countDisplay = document.createElement('div');
|
| 29 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 30 |
+
countDisplay.style.cssText = `
|
| 31 |
+
font-weight: 700;
|
| 32 |
+
text-align: center;
|
| 33 |
+
font-size: 15px;
|
| 34 |
+
color: #ffffff;
|
| 35 |
+
margin-bottom: 2px;
|
| 36 |
+
`;
|
| 37 |
+
|
| 38 |
+
const autoScanBtn = document.createElement('button');
|
| 39 |
+
autoScanBtn.textContent = 'Buscar videos y fotos';
|
| 40 |
+
autoScanBtn.style.cssText = `
|
| 41 |
+
background: #e1306c;
|
| 42 |
+
color: #ffffff;
|
| 43 |
+
border: none;
|
| 44 |
+
padding: 10px 12px;
|
| 45 |
+
border-radius: 8px;
|
| 46 |
+
cursor: pointer;
|
| 47 |
+
font-weight: 700;
|
| 48 |
+
font-size: 14px;
|
| 49 |
+
transition: background 0.2s ease;
|
| 50 |
+
`;
|
| 51 |
+
autoScanBtn.onmouseover = () => {
|
| 52 |
+
if (!window.__instagramIsScanning) autoScanBtn.style.background = '#c13584';
|
| 53 |
+
};
|
| 54 |
+
autoScanBtn.onmouseout = () => {
|
| 55 |
+
if (!window.__instagramIsScanning) autoScanBtn.style.background = '#e1306c';
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
const selectAllBtn = document.createElement('button');
|
| 59 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 60 |
+
selectAllBtn.style.cssText = `
|
| 61 |
+
background: #3f3f46;
|
| 62 |
+
color: #ffffff;
|
| 63 |
+
border: none;
|
| 64 |
+
padding: 9px 12px;
|
| 65 |
+
border-radius: 8px;
|
| 66 |
+
cursor: pointer;
|
| 67 |
+
font-weight: 600;
|
| 68 |
+
font-size: 13.5px;
|
| 69 |
+
transition: background 0.2s ease;
|
| 70 |
+
`;
|
| 71 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 72 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 73 |
+
|
| 74 |
+
const copyBtn = document.createElement('button');
|
| 75 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 76 |
+
copyBtn.style.cssText = `
|
| 77 |
+
background: #8b5cf6;
|
| 78 |
+
color: #ffffff;
|
| 79 |
+
border: none;
|
| 80 |
+
padding: 11px 16px;
|
| 81 |
+
border-radius: 8px;
|
| 82 |
+
cursor: pointer;
|
| 83 |
+
font-weight: 700;
|
| 84 |
+
font-size: 15px;
|
| 85 |
+
transition: background 0.2s ease, transform 0.1s ease;
|
| 86 |
+
`;
|
| 87 |
+
copyBtn.onmouseover = () => copyBtn.style.background = '#7c3aed';
|
| 88 |
+
copyBtn.onmouseout = () => copyBtn.style.background = '#8b5cf6';
|
| 89 |
+
|
| 90 |
+
const closeBtn = document.createElement('button');
|
| 91 |
+
closeBtn.id = 'instagram-close-btn';
|
| 92 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 93 |
+
closeBtn.style.cssText = `
|
| 94 |
+
background: #27272a;
|
| 95 |
+
color: #e4e4e7;
|
| 96 |
+
border: 1px solid #3f3f46;
|
| 97 |
+
padding: 8px 12px;
|
| 98 |
+
border-radius: 8px;
|
| 99 |
+
cursor: pointer;
|
| 100 |
+
font-weight: 500;
|
| 101 |
+
font-size: 13px;
|
| 102 |
+
transition: background 0.2s ease;
|
| 103 |
+
`;
|
| 104 |
+
closeBtn.onmouseover = () => closeBtn.style.background = '#3f3f46';
|
| 105 |
+
closeBtn.onmouseout = () => closeBtn.style.background = '#27272a';
|
| 106 |
+
|
| 107 |
+
container.appendChild(countDisplay);
|
| 108 |
+
container.appendChild(autoScanBtn);
|
| 109 |
+
container.appendChild(selectAllBtn);
|
| 110 |
+
container.appendChild(copyBtn);
|
| 111 |
+
container.appendChild(closeBtn);
|
| 112 |
+
(document.body || document.documentElement).appendChild(container);
|
| 113 |
+
|
| 114 |
+
const style = document.createElement('style');
|
| 115 |
+
style.id = 'instagram-selector-style';
|
| 116 |
+
style.textContent = `
|
| 117 |
+
.instagram-selector-hover {
|
| 118 |
+
box-shadow: 0 0 12px rgba(225, 48, 108, 0.6) !important;
|
| 119 |
+
outline: 4px solid #e1306c !important;
|
| 120 |
+
outline-offset: -4px !important;
|
| 121 |
+
cursor: crosshair !important;
|
| 122 |
+
transition: all 0.15s ease;
|
| 123 |
+
position: relative !important;
|
| 124 |
+
z-index: 9999 !important;
|
| 125 |
+
}
|
| 126 |
+
.instagram-selector-selected {
|
| 127 |
+
box-shadow: 0 0 15px rgba(16, 185, 129, 0.7) !important;
|
| 128 |
+
outline: 4px solid #10b981 !important;
|
| 129 |
+
outline-offset: -4px !important;
|
| 130 |
+
position: relative !important;
|
| 131 |
+
z-index: 9998 !important;
|
| 132 |
+
}
|
| 133 |
+
.instagram-selector-selected::after,
|
| 134 |
+
.instagram-selector-selected:hover::after {
|
| 135 |
+
content: '✓' !important;
|
| 136 |
+
position: absolute !important;
|
| 137 |
+
top: 8px !important;
|
| 138 |
+
left: 8px !important;
|
| 139 |
+
background: #10b981 !important;
|
| 140 |
+
color: white !important;
|
| 141 |
+
border-radius: 50% !important;
|
| 142 |
+
width: 28px !important;
|
| 143 |
+
height: 28px !important;
|
| 144 |
+
display: flex !important;
|
| 145 |
+
align-items: center !important;
|
| 146 |
+
justify-content: center !important;
|
| 147 |
+
font-weight: bold !important;
|
| 148 |
+
font-size: 16px !important;
|
| 149 |
+
z-index: 2147483647 !important;
|
| 150 |
+
box-shadow: 0 2px 6px rgba(0,0,0,0.6) !important;
|
| 151 |
+
pointer-events: none !important;
|
| 152 |
+
}
|
| 153 |
+
`;
|
| 154 |
+
(document.head || document.documentElement).appendChild(style);
|
| 155 |
+
|
| 156 |
+
const getCleanUrl = (hrefOrAnchor) => {
|
| 157 |
+
if (!hrefOrAnchor) return '';
|
| 158 |
+
let raw = typeof hrefOrAnchor === 'string' ? hrefOrAnchor : (hrefOrAnchor.href || hrefOrAnchor.getAttribute('href') || '');
|
| 159 |
+
if (!raw) return '';
|
| 160 |
+
try {
|
| 161 |
+
let full = new URL(raw, window.location.origin).href;
|
| 162 |
+
let clean = full.split('?')[0].split('#')[0].trim();
|
| 163 |
+
if (clean.endsWith('/')) clean = clean.slice(0, -1);
|
| 164 |
+
return clean;
|
| 165 |
+
} catch(e) {
|
| 166 |
+
return '';
|
| 167 |
+
}
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
const isInstagramPostUrl = (url) => {
|
| 171 |
+
if (!url) return false;
|
| 172 |
+
try {
|
| 173 |
+
const parsed = new URL(url);
|
| 174 |
+
const path = parsed.pathname;
|
| 175 |
+
const parts = path.split('/').filter(Boolean);
|
| 176 |
+
const idx = parts.findIndex(p => {
|
| 177 |
+
const lower = p.toLowerCase();
|
| 178 |
+
return lower === 'p' || lower === 'reel' || lower === 'reels';
|
| 179 |
+
});
|
| 180 |
+
if (idx !== -1 && parts[idx + 1] && parts[idx + 1].length > 0) {
|
| 181 |
+
return true;
|
| 182 |
+
}
|
| 183 |
+
} catch (e) {
|
| 184 |
+
const lower = url.toLowerCase();
|
| 185 |
+
if (lower.endsWith('/reels') || lower.endsWith('/reels/') || lower.endsWith('/p') || lower.endsWith('/p/')) {
|
| 186 |
+
return false;
|
| 187 |
+
}
|
| 188 |
+
return lower.includes('/p/') || lower.includes('/reel/') || lower.includes('/reels/');
|
| 189 |
+
}
|
| 190 |
+
return false;
|
| 191 |
+
};
|
| 192 |
+
|
| 193 |
+
const getPostCard = (el) => {
|
| 194 |
+
if (!el || el.closest('#instagram-floating-ui')) return null;
|
| 195 |
+
|
| 196 |
+
const anchor = el.closest('a');
|
| 197 |
+
if (!anchor) return null;
|
| 198 |
+
|
| 199 |
+
const url = getCleanUrl(anchor);
|
| 200 |
+
if (!isInstagramPostUrl(url)) return null;
|
| 201 |
+
|
| 202 |
+
return { card: anchor, anchor, url };
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
const getVisualTarget = (cardObj) => {
|
| 206 |
+
if (!cardObj) return null;
|
| 207 |
+
return cardObj.anchor;
|
| 208 |
+
};
|
| 209 |
+
|
| 210 |
+
const toggleCardSelection = (url, select) => {
|
| 211 |
+
document.querySelectorAll('a').forEach(el => {
|
| 212 |
+
const cardObj = getPostCard(el);
|
| 213 |
+
if (cardObj && cardObj.url === url) {
|
| 214 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 215 |
+
if (visualTarget) {
|
| 216 |
+
if (select) {
|
| 217 |
+
visualTarget.classList.add('instagram-selector-selected');
|
| 218 |
+
visualTarget.classList.remove('instagram-selector-hover');
|
| 219 |
+
} else {
|
| 220 |
+
visualTarget.classList.remove('instagram-selector-selected');
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
});
|
| 225 |
+
};
|
| 226 |
+
|
| 227 |
+
let isDragging = false;
|
| 228 |
+
let dragMode = null;
|
| 229 |
+
|
| 230 |
+
const mouseOver = (e) => {
|
| 231 |
+
if (e.target.closest('#instagram-floating-ui')) return;
|
| 232 |
+
const cardObj = getPostCard(e.target);
|
| 233 |
+
if (cardObj) {
|
| 234 |
+
const { url } = cardObj;
|
| 235 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 236 |
+
if (!visualTarget) return;
|
| 237 |
+
|
| 238 |
+
if (isDragging) {
|
| 239 |
+
e.preventDefault();
|
| 240 |
+
e.stopPropagation();
|
| 241 |
+
|
| 242 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 243 |
+
selectedLinks.add(url);
|
| 244 |
+
toggleCardSelection(url, true);
|
| 245 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 246 |
+
selectedLinks.delete(url);
|
| 247 |
+
toggleCardSelection(url, false);
|
| 248 |
+
}
|
| 249 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 250 |
+
} else {
|
| 251 |
+
if (!visualTarget.classList.contains('instagram-selector-selected')) {
|
| 252 |
+
visualTarget.classList.add('instagram-selector-hover');
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
};
|
| 257 |
+
|
| 258 |
+
const mouseOut = (e) => {
|
| 259 |
+
if (e.target.closest('#instagram-floating-ui')) return;
|
| 260 |
+
const cardObj = getPostCard(e.target);
|
| 261 |
+
if (cardObj) {
|
| 262 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 263 |
+
if (visualTarget) {
|
| 264 |
+
visualTarget.classList.remove('instagram-selector-hover');
|
| 265 |
+
}
|
| 266 |
+
}
|
| 267 |
+
};
|
| 268 |
+
|
| 269 |
+
const mouseDown = (e) => {
|
| 270 |
+
if (e.target.closest('#instagram-floating-ui')) return;
|
| 271 |
+
|
| 272 |
+
const cardObj = getPostCard(e.target);
|
| 273 |
+
if (cardObj) {
|
| 274 |
+
e.preventDefault();
|
| 275 |
+
e.stopPropagation();
|
| 276 |
+
if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
|
| 277 |
+
isDragging = true;
|
| 278 |
+
|
| 279 |
+
const { url } = cardObj;
|
| 280 |
+
|
| 281 |
+
if (selectedLinks.has(url)) {
|
| 282 |
+
dragMode = 'deselect';
|
| 283 |
+
selectedLinks.delete(url);
|
| 284 |
+
toggleCardSelection(url, false);
|
| 285 |
+
} else {
|
| 286 |
+
dragMode = 'select';
|
| 287 |
+
selectedLinks.add(url);
|
| 288 |
+
toggleCardSelection(url, true);
|
| 289 |
+
}
|
| 290 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 291 |
+
}
|
| 292 |
+
};
|
| 293 |
+
|
| 294 |
+
const mouseUp = () => {
|
| 295 |
+
isDragging = false;
|
| 296 |
+
dragMode = null;
|
| 297 |
+
};
|
| 298 |
+
|
| 299 |
+
const dragStart = (e) => {
|
| 300 |
+
if (e.target.closest('#instagram-floating-ui')) return;
|
| 301 |
+
const cardObj = getPostCard(e.target);
|
| 302 |
+
if (cardObj) {
|
| 303 |
+
e.preventDefault();
|
| 304 |
+
e.stopPropagation();
|
| 305 |
+
}
|
| 306 |
+
};
|
| 307 |
+
|
| 308 |
+
const click = (e) => {
|
| 309 |
+
if (e.target.closest('#instagram-floating-ui')) return;
|
| 310 |
+
const cardObj = getPostCard(e.target);
|
| 311 |
+
if (cardObj) {
|
| 312 |
+
e.preventDefault();
|
| 313 |
+
e.stopPropagation();
|
| 314 |
+
if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
|
| 315 |
+
}
|
| 316 |
+
};
|
| 317 |
+
|
| 318 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 319 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 320 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 321 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 322 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 323 |
+
document.addEventListener('click', click, true);
|
| 324 |
+
|
| 325 |
+
let scanInterval = null;
|
| 326 |
+
let observer = null;
|
| 327 |
+
|
| 328 |
+
const updateDOMHighlights = () => {
|
| 329 |
+
let countChanged = false;
|
| 330 |
+
document.querySelectorAll('a').forEach(el => {
|
| 331 |
+
const cardObj = getPostCard(el);
|
| 332 |
+
if (cardObj) {
|
| 333 |
+
const { url } = cardObj;
|
| 334 |
+
|
| 335 |
+
// If scanning is active, automatically select any new post/reel URLs found
|
| 336 |
+
if (window.__instagramIsScanning && !selectedLinks.has(url)) {
|
| 337 |
+
selectedLinks.add(url);
|
| 338 |
+
countChanged = true;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 342 |
+
if (visualTarget) {
|
| 343 |
+
if (selectedLinks.has(url)) {
|
| 344 |
+
visualTarget.classList.add('instagram-selector-selected');
|
| 345 |
+
visualTarget.classList.remove('instagram-selector-hover');
|
| 346 |
+
} else {
|
| 347 |
+
visualTarget.classList.remove('instagram-selector-selected');
|
| 348 |
+
}
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
});
|
| 352 |
+
|
| 353 |
+
if (countChanged) {
|
| 354 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 355 |
+
if (window.__instagramIsScanning) {
|
| 356 |
+
autoScanBtn.textContent = 'Detener búsqueda (' + selectedLinks.size + ')';
|
| 357 |
+
}
|
| 358 |
+
}
|
| 359 |
+
};
|
| 360 |
+
|
| 361 |
+
let updateTimeout = null;
|
| 362 |
+
const scheduleUpdateHighlights = () => {
|
| 363 |
+
if (updateTimeout) return;
|
| 364 |
+
updateTimeout = setTimeout(() => {
|
| 365 |
+
updateDOMHighlights();
|
| 366 |
+
updateTimeout = null;
|
| 367 |
+
}, 150);
|
| 368 |
+
};
|
| 369 |
+
|
| 370 |
+
observer = new MutationObserver((mutations) => {
|
| 371 |
+
let hasChanges = false;
|
| 372 |
+
for (let i = 0; i < mutations.length; i++) {
|
| 373 |
+
if (mutations[i].addedNodes.length > 0) {
|
| 374 |
+
hasChanges = true;
|
| 375 |
+
break;
|
| 376 |
+
}
|
| 377 |
+
}
|
| 378 |
+
if (hasChanges) {
|
| 379 |
+
scheduleUpdateHighlights();
|
| 380 |
+
}
|
| 381 |
+
});
|
| 382 |
+
observer.observe(document.body, { childList: true, subtree: true });
|
| 383 |
+
|
| 384 |
+
// Initial highlight of already existing links
|
| 385 |
+
updateDOMHighlights();
|
| 386 |
+
|
| 387 |
+
autoScanBtn.onclick = () => {
|
| 388 |
+
if (window.__instagramIsScanning) {
|
| 389 |
+
clearInterval(scanInterval);
|
| 390 |
+
window.__instagramIsScanning = false;
|
| 391 |
+
autoScanBtn.textContent = 'Buscar videos y fotos';
|
| 392 |
+
autoScanBtn.style.background = '#e1306c';
|
| 393 |
+
return;
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
window.__instagramIsScanning = true;
|
| 397 |
+
autoScanBtn.textContent = 'Buscando... (' + selectedLinks.size + ')';
|
| 398 |
+
autoScanBtn.style.background = '#27272a';
|
| 399 |
+
|
| 400 |
+
let lastScrollY = -1;
|
| 401 |
+
let lastCount = selectedLinks.size;
|
| 402 |
+
let retries = 0;
|
| 403 |
+
const maxRetries = 20; // 20 * 600ms = 12 seconds of wait time at bottom
|
| 404 |
+
|
| 405 |
+
scanInterval = setInterval(() => {
|
| 406 |
+
// Scroll window
|
| 407 |
+
window.scrollBy(0, 600);
|
| 408 |
+
|
| 409 |
+
// Scroll any scrollable div containers on the page
|
| 410 |
+
document.querySelectorAll('div').forEach(el => {
|
| 411 |
+
const style = window.getComputedStyle(el);
|
| 412 |
+
if ((style.overflowY === 'auto' || style.overflowY === 'scroll') && el.scrollHeight > el.clientHeight) {
|
| 413 |
+
el.scrollBy(0, 600);
|
| 414 |
+
}
|
| 415 |
+
});
|
| 416 |
+
|
| 417 |
+
// Scan and highlight
|
| 418 |
+
updateDOMHighlights();
|
| 419 |
+
|
| 420 |
+
const currentScrollY = window.scrollY || document.documentElement.scrollTop;
|
| 421 |
+
const currentCount = selectedLinks.size;
|
| 422 |
+
|
| 423 |
+
// If scroll position didn't change and we didn't find new links, we might be at the end
|
| 424 |
+
if (currentScrollY === lastScrollY && currentCount === lastCount) {
|
| 425 |
+
retries++;
|
| 426 |
+
if (retries >= maxRetries) {
|
| 427 |
+
clearInterval(scanInterval);
|
| 428 |
+
window.__instagramIsScanning = false;
|
| 429 |
+
autoScanBtn.textContent = 'Buscar videos y fotos';
|
| 430 |
+
autoScanBtn.style.background = '#e1306c';
|
| 431 |
+
}
|
| 432 |
+
} else {
|
| 433 |
+
retries = 0;
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
lastScrollY = currentScrollY;
|
| 437 |
+
lastCount = currentCount;
|
| 438 |
+
|
| 439 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 440 |
+
autoScanBtn.textContent = 'Detener búsqueda (' + selectedLinks.size + ')';
|
| 441 |
+
}, 600);
|
| 442 |
+
};
|
| 443 |
+
|
| 444 |
+
selectAllBtn.onclick = () => {
|
| 445 |
+
const postUrls = new Set();
|
| 446 |
+
document.querySelectorAll('a').forEach(a => {
|
| 447 |
+
const url = getCleanUrl(a);
|
| 448 |
+
if (isInstagramPostUrl(url)) {
|
| 449 |
+
postUrls.add(url);
|
| 450 |
+
}
|
| 451 |
+
});
|
| 452 |
+
|
| 453 |
+
let allSelected = true;
|
| 454 |
+
postUrls.forEach(url => {
|
| 455 |
+
if (!selectedLinks.has(url)) {
|
| 456 |
+
allSelected = false;
|
| 457 |
+
}
|
| 458 |
+
});
|
| 459 |
+
|
| 460 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 461 |
+
postUrls.forEach(url => {
|
| 462 |
+
selectedLinks.delete(url);
|
| 463 |
+
toggleCardSelection(url, false);
|
| 464 |
+
});
|
| 465 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 466 |
+
} else {
|
| 467 |
+
postUrls.forEach(url => {
|
| 468 |
+
selectedLinks.add(url);
|
| 469 |
+
toggleCardSelection(url, true);
|
| 470 |
+
});
|
| 471 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 472 |
+
}
|
| 473 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 474 |
+
};
|
| 475 |
+
|
| 476 |
+
copyBtn.onclick = () => {
|
| 477 |
+
if (selectedLinks.size === 0) return;
|
| 478 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 479 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 480 |
+
const ogText = copyBtn.textContent;
|
| 481 |
+
const ogBg = copyBtn.style.background;
|
| 482 |
+
copyBtn.textContent = '¡Copiados!';
|
| 483 |
+
copyBtn.style.background = '#10b981';
|
| 484 |
+
setTimeout(() => {
|
| 485 |
+
copyBtn.textContent = ogText;
|
| 486 |
+
copyBtn.style.background = ogBg || '#8b5cf6';
|
| 487 |
+
}, 2000);
|
| 488 |
+
});
|
| 489 |
+
};
|
| 490 |
+
|
| 491 |
+
closeBtn.onclick = () => {
|
| 492 |
+
if (scanInterval) clearInterval(scanInterval);
|
| 493 |
+
window.__instagramIsScanning = false;
|
| 494 |
+
|
| 495 |
+
if (observer) {
|
| 496 |
+
observer.disconnect();
|
| 497 |
+
observer = null;
|
| 498 |
+
}
|
| 499 |
+
|
| 500 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 501 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 502 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 503 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 504 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 505 |
+
document.removeEventListener('click', click, true);
|
| 506 |
+
container.remove();
|
| 507 |
+
style.remove();
|
| 508 |
+
document.querySelectorAll('.instagram-selector-selected').forEach(el => el.classList.remove('instagram-selector-selected'));
|
| 509 |
+
document.querySelectorAll('.instagram-selector-hover').forEach(el => el.classList.remove('instagram-selector-hover'));
|
| 510 |
+
window.__instagramSelectorActive = false;
|
| 511 |
+
|
| 512 |
+
try {
|
| 513 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'instagram' });
|
| 514 |
+
} catch (e) {
|
| 515 |
+
console.log("Could not notify popup, it is probably closed");
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
window.dispatchEvent(new Event('INSTAGRAM_OFF'));
|
| 519 |
+
};
|
| 520 |
+
})();
|
detector de enlaces - copia/src/ixxx/selector.js
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
(() => {
|
| 2 |
+
if (window.__ixxxSelectorActive) return;
|
| 3 |
+
window.__ixxxSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'ixxx-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const selectAllBtn = document.createElement('button');
|
| 34 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 35 |
+
selectAllBtn.style.cssText = `
|
| 36 |
+
background: #3f3f46;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 8px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: 600;
|
| 43 |
+
font-size: 13px;
|
| 44 |
+
transition: background 0.2s;
|
| 45 |
+
`;
|
| 46 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 47 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 48 |
+
|
| 49 |
+
const copyBtn = document.createElement('button');
|
| 50 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 51 |
+
copyBtn.style.cssText = `
|
| 52 |
+
background: #ec4899;
|
| 53 |
+
color: white;
|
| 54 |
+
border: none;
|
| 55 |
+
padding: 10px;
|
| 56 |
+
border-radius: 6px;
|
| 57 |
+
cursor: pointer;
|
| 58 |
+
font-weight: bold;
|
| 59 |
+
`;
|
| 60 |
+
|
| 61 |
+
const closeBtn = document.createElement('button');
|
| 62 |
+
closeBtn.id = 'ixxx-close-btn';
|
| 63 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 64 |
+
closeBtn.style.cssText = `
|
| 65 |
+
background: #27272a;
|
| 66 |
+
color: white;
|
| 67 |
+
border: 1px solid #3f3f46;
|
| 68 |
+
padding: 8px;
|
| 69 |
+
border-radius: 6px;
|
| 70 |
+
cursor: pointer;
|
| 71 |
+
font-size: 13px;
|
| 72 |
+
`;
|
| 73 |
+
|
| 74 |
+
container.appendChild(countDisplay);
|
| 75 |
+
container.appendChild(selectAllBtn);
|
| 76 |
+
container.appendChild(copyBtn);
|
| 77 |
+
container.appendChild(closeBtn);
|
| 78 |
+
document.body.appendChild(container);
|
| 79 |
+
|
| 80 |
+
const style = document.createElement('style');
|
| 81 |
+
style.id = 'ixxx-style';
|
| 82 |
+
style.textContent = `
|
| 83 |
+
.ixxx-selector-hover {
|
| 84 |
+
box-shadow: inset 0 0 0 4px #ec4899 !important, 0 0 10px rgba(236, 72, 153, 0.5) !important;
|
| 85 |
+
cursor: crosshair !important;
|
| 86 |
+
transition: all 0.2s;
|
| 87 |
+
position: relative !important;
|
| 88 |
+
z-index: 9999 !important;
|
| 89 |
+
}
|
| 90 |
+
.ixxx-selector-selected {
|
| 91 |
+
box-shadow: inset 0 0 0 4px #10b981 !important, 0 0 15px rgba(16, 185, 129, 0.6) !important;
|
| 92 |
+
position: relative !important;
|
| 93 |
+
z-index: 9998 !important;
|
| 94 |
+
}
|
| 95 |
+
.ixxx-selector-selected::after,
|
| 96 |
+
.ixxx-selector-selected:hover::after {
|
| 97 |
+
content: '✓' !important;
|
| 98 |
+
position: absolute !important;
|
| 99 |
+
top: 8px !important;
|
| 100 |
+
left: 8px !important;
|
| 101 |
+
background: #10b981 !important;
|
| 102 |
+
color: white !important;
|
| 103 |
+
border-radius: 50% !important;
|
| 104 |
+
width: 28px !important;
|
| 105 |
+
height: 28px !important;
|
| 106 |
+
display: flex !important;
|
| 107 |
+
align-items: center !important;
|
| 108 |
+
justify-content: center !important;
|
| 109 |
+
font-weight: bold !important;
|
| 110 |
+
font-size: 16px !important;
|
| 111 |
+
z-index: 2147483647 !important;
|
| 112 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5) !important;
|
| 113 |
+
pointer-events: none !important;
|
| 114 |
+
}
|
| 115 |
+
`;
|
| 116 |
+
document.head.appendChild(style);
|
| 117 |
+
|
| 118 |
+
// Helper to decode Base64 URL from ixxx outbound link
|
| 119 |
+
const decodeIxxxUrl = (urlStr) => {
|
| 120 |
+
try {
|
| 121 |
+
const urlObj = new URL(urlStr, window.location.origin);
|
| 122 |
+
const lParam = urlObj.searchParams.get('l');
|
| 123 |
+
if (!lParam) return urlStr;
|
| 124 |
+
|
| 125 |
+
let b64Index = lParam.indexOf('aHR0cHM6Ly'); // https://
|
| 126 |
+
if (b64Index === -1) {
|
| 127 |
+
b64Index = lParam.indexOf('aHR0cDov'); // http://
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
if (b64Index !== -1) {
|
| 131 |
+
let encodedPart = lParam.substring(b64Index).split('&')[0];
|
| 132 |
+
let cleanB64 = encodedPart.replace(/[^A-Za-z0-9+/]/g, '');
|
| 133 |
+
while (cleanB64.length % 4 !== 0) {
|
| 134 |
+
cleanB64 += '=';
|
| 135 |
+
}
|
| 136 |
+
const decoded = atob(cleanB64);
|
| 137 |
+
const match = decoded.match(/^(https?:\/\/[^\s"'<>\\\{\}\[\]\^\`\x00-\x1f\x7f-\xff]+)/);
|
| 138 |
+
if (match) {
|
| 139 |
+
return match[1];
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
} catch (e) {
|
| 143 |
+
console.error("Error decoding ixxx URL", e);
|
| 144 |
+
}
|
| 145 |
+
return urlStr;
|
| 146 |
+
};
|
| 147 |
+
|
| 148 |
+
// Helper to get normalized URLs for matching
|
| 149 |
+
const getCleanUrl = (href) => {
|
| 150 |
+
if (!href) return '';
|
| 151 |
+
let url = href.trim();
|
| 152 |
+
if (url.includes('/out/?l=')) {
|
| 153 |
+
url = decodeIxxxUrl(url);
|
| 154 |
+
}
|
| 155 |
+
let clean = url.split('?')[0].split('#')[0].trim();
|
| 156 |
+
if (clean.endsWith('/')) {
|
| 157 |
+
clean = clean.slice(0, -1);
|
| 158 |
+
}
|
| 159 |
+
return clean;
|
| 160 |
+
};
|
| 161 |
+
|
| 162 |
+
// Helper to check if an anchor is a thumbnail cover rather than text title
|
| 163 |
+
const isThumbnailAnchor = (a) => {
|
| 164 |
+
if (!a) return false;
|
| 165 |
+
if (a.classList.contains('item-title')) return false;
|
| 166 |
+
if (a.querySelector('img, picture, canvas, video, [class*="thumb"], [class*="img"], [class*="preview"], [class*="cover"]')) return true;
|
| 167 |
+
return false;
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
const getPostCard = (el) => {
|
| 171 |
+
const card = el.closest('a[href*="/out/?l="]');
|
| 172 |
+
if (!card) return null;
|
| 173 |
+
return card;
|
| 174 |
+
};
|
| 175 |
+
|
| 176 |
+
const getThumbnailAnchorForUrl = (url) => {
|
| 177 |
+
let thumb = null;
|
| 178 |
+
document.querySelectorAll('a[href*="/out/?l="]').forEach(a => {
|
| 179 |
+
if (getCleanUrl(a.href) === url) {
|
| 180 |
+
if (isThumbnailAnchor(a)) {
|
| 181 |
+
thumb = a;
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
});
|
| 185 |
+
return thumb;
|
| 186 |
+
};
|
| 187 |
+
|
| 188 |
+
const getVisualTarget = (card) => {
|
| 189 |
+
// Target closest card wrapper container to render outline cleanly around the whole block
|
| 190 |
+
return card.closest('.card') || card.parentElement || card;
|
| 191 |
+
};
|
| 192 |
+
|
| 193 |
+
const toggleCardSelection = (url, select) => {
|
| 194 |
+
document.querySelectorAll('a[href*="/out/?l="]').forEach(a => {
|
| 195 |
+
if (getCleanUrl(a.href) === url) {
|
| 196 |
+
if (isThumbnailAnchor(a)) {
|
| 197 |
+
const visualTarget = getVisualTarget(a);
|
| 198 |
+
if (select) {
|
| 199 |
+
visualTarget.classList.add('ixxx-selector-selected');
|
| 200 |
+
visualTarget.classList.remove('ixxx-selector-hover');
|
| 201 |
+
} else {
|
| 202 |
+
visualTarget.classList.remove('ixxx-selector-selected');
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
}
|
| 206 |
+
});
|
| 207 |
+
};
|
| 208 |
+
|
| 209 |
+
let isDragging = false;
|
| 210 |
+
let dragMode = null;
|
| 211 |
+
|
| 212 |
+
const mouseOver = (e) => {
|
| 213 |
+
const card = getPostCard(e.target);
|
| 214 |
+
if (card) {
|
| 215 |
+
const url = getCleanUrl(card.href);
|
| 216 |
+
const thumb = getThumbnailAnchorForUrl(url) || card;
|
| 217 |
+
const visualTarget = getVisualTarget(thumb);
|
| 218 |
+
|
| 219 |
+
if (isDragging) {
|
| 220 |
+
e.preventDefault();
|
| 221 |
+
e.stopPropagation();
|
| 222 |
+
|
| 223 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 224 |
+
selectedLinks.add(url);
|
| 225 |
+
toggleCardSelection(url, true);
|
| 226 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 227 |
+
selectedLinks.delete(url);
|
| 228 |
+
toggleCardSelection(url, false);
|
| 229 |
+
}
|
| 230 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 231 |
+
} else {
|
| 232 |
+
if (!visualTarget.classList.contains('ixxx-selector-selected')) {
|
| 233 |
+
visualTarget.classList.add('ixxx-selector-hover');
|
| 234 |
+
}
|
| 235 |
+
}
|
| 236 |
+
}
|
| 237 |
+
};
|
| 238 |
+
|
| 239 |
+
const mouseOut = (e) => {
|
| 240 |
+
const card = getPostCard(e.target);
|
| 241 |
+
if (card) {
|
| 242 |
+
const url = getCleanUrl(card.href);
|
| 243 |
+
const thumb = getThumbnailAnchorForUrl(url) || card;
|
| 244 |
+
const visualTarget = getVisualTarget(thumb);
|
| 245 |
+
visualTarget.classList.remove('ixxx-selector-hover');
|
| 246 |
+
}
|
| 247 |
+
};
|
| 248 |
+
|
| 249 |
+
const mouseDown = (e) => {
|
| 250 |
+
const card = getPostCard(e.target);
|
| 251 |
+
if (card) {
|
| 252 |
+
e.preventDefault();
|
| 253 |
+
e.stopPropagation();
|
| 254 |
+
isDragging = true;
|
| 255 |
+
|
| 256 |
+
const url = getCleanUrl(card.href);
|
| 257 |
+
|
| 258 |
+
if (selectedLinks.has(url)) {
|
| 259 |
+
dragMode = 'deselect';
|
| 260 |
+
selectedLinks.delete(url);
|
| 261 |
+
toggleCardSelection(url, false);
|
| 262 |
+
} else {
|
| 263 |
+
dragMode = 'select';
|
| 264 |
+
selectedLinks.add(url);
|
| 265 |
+
toggleCardSelection(url, true);
|
| 266 |
+
}
|
| 267 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 268 |
+
}
|
| 269 |
+
};
|
| 270 |
+
|
| 271 |
+
const mouseUp = (e) => {
|
| 272 |
+
isDragging = false;
|
| 273 |
+
dragMode = null;
|
| 274 |
+
};
|
| 275 |
+
|
| 276 |
+
const dragStart = (e) => {
|
| 277 |
+
const card = getPostCard(e.target);
|
| 278 |
+
if (card) {
|
| 279 |
+
e.preventDefault();
|
| 280 |
+
e.stopPropagation();
|
| 281 |
+
}
|
| 282 |
+
};
|
| 283 |
+
|
| 284 |
+
const click = (e) => {
|
| 285 |
+
const card = getPostCard(e.target);
|
| 286 |
+
if (card) {
|
| 287 |
+
e.preventDefault();
|
| 288 |
+
e.stopPropagation();
|
| 289 |
+
}
|
| 290 |
+
};
|
| 291 |
+
|
| 292 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 293 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 294 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 295 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 296 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 297 |
+
document.addEventListener('click', click, true);
|
| 298 |
+
|
| 299 |
+
selectAllBtn.onclick = () => {
|
| 300 |
+
const links = [];
|
| 301 |
+
document.querySelectorAll('a[href*="/out/?l="]').forEach(a => {
|
| 302 |
+
if (isThumbnailAnchor(a)) {
|
| 303 |
+
links.push(a);
|
| 304 |
+
}
|
| 305 |
+
});
|
| 306 |
+
|
| 307 |
+
let allSelected = true;
|
| 308 |
+
links.forEach(a => {
|
| 309 |
+
const url = getCleanUrl(a.href);
|
| 310 |
+
if (!selectedLinks.has(url)) {
|
| 311 |
+
allSelected = false;
|
| 312 |
+
}
|
| 313 |
+
});
|
| 314 |
+
|
| 315 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 316 |
+
links.forEach(a => {
|
| 317 |
+
const url = getCleanUrl(a.href);
|
| 318 |
+
selectedLinks.delete(url);
|
| 319 |
+
toggleCardSelection(url, false);
|
| 320 |
+
});
|
| 321 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 322 |
+
} else {
|
| 323 |
+
links.forEach(a => {
|
| 324 |
+
const url = getCleanUrl(a.href);
|
| 325 |
+
if (!selectedLinks.has(url)) {
|
| 326 |
+
selectedLinks.add(url);
|
| 327 |
+
toggleCardSelection(url, true);
|
| 328 |
+
}
|
| 329 |
+
});
|
| 330 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 331 |
+
}
|
| 332 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 333 |
+
};
|
| 334 |
+
|
| 335 |
+
copyBtn.onclick = () => {
|
| 336 |
+
if (selectedLinks.size === 0) return;
|
| 337 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 338 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 339 |
+
const ogText = copyBtn.textContent;
|
| 340 |
+
copyBtn.textContent = '¡Copiados!';
|
| 341 |
+
copyBtn.style.background = '#10b981';
|
| 342 |
+
setTimeout(() => {
|
| 343 |
+
copyBtn.textContent = ogText;
|
| 344 |
+
copyBtn.style.background = '#ec4899';
|
| 345 |
+
}, 2000);
|
| 346 |
+
});
|
| 347 |
+
};
|
| 348 |
+
|
| 349 |
+
closeBtn.onclick = () => {
|
| 350 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 351 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 352 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 353 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 354 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 355 |
+
document.removeEventListener('click', click, true);
|
| 356 |
+
container.remove();
|
| 357 |
+
style.remove();
|
| 358 |
+
document.querySelectorAll('.ixxx-selector-selected').forEach(el => el.classList.remove('ixxx-selector-selected'));
|
| 359 |
+
document.querySelectorAll('.ixxx-selector-hover').forEach(el => el.classList.remove('ixxx-selector-hover'));
|
| 360 |
+
window.__ixxxSelectorActive = false;
|
| 361 |
+
|
| 362 |
+
try {
|
| 363 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'ixxx' });
|
| 364 |
+
} catch (e) {
|
| 365 |
+
console.log("Could not notify popup, it is probably closed");
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
window.dispatchEvent(new Event('IXXX_OFF'));
|
| 369 |
+
};
|
| 370 |
+
})();
|
detector de enlaces - copia/src/jav/selector.js
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
| 1 |
+
(() => {
|
| 2 |
+
if (window.__javSelectorActive) return;
|
| 3 |
+
window.__javSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const isPlayPage = () => {
|
| 6 |
+
const url = window.location.href.toLowerCase();
|
| 7 |
+
if (url.includes('/v/')) {
|
| 8 |
+
return true;
|
| 9 |
+
}
|
| 10 |
+
const hasJavCode = /\/[a-z0-9]+-\d+/i.test(url);
|
| 11 |
+
const isListPage = url.includes('/genres/') || url.includes('/search/') || url.includes('/makers/') || url.includes('/actresses/') || url.includes('/tags/');
|
| 12 |
+
if ((url.includes('missav.com') || url.includes('missav.ws')) && hasJavCode && !isListPage) {
|
| 13 |
+
return true;
|
| 14 |
+
}
|
| 15 |
+
return false;
|
| 16 |
+
};
|
| 17 |
+
|
| 18 |
+
const getTitle = () => {
|
| 19 |
+
let title = document.title;
|
| 20 |
+
title = title.replace(/\s*-\s*MissAV\.ws/gi, '')
|
| 21 |
+
.replace(/\s*-\s*MissAV/gi, '')
|
| 22 |
+
.replace(/\s*—\s*123AV/gi, '')
|
| 23 |
+
.replace(/\s*-\s*123AV/gi, '')
|
| 24 |
+
.trim();
|
| 25 |
+
return title;
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
const makeDownloadCommand = (m3u8Url) => {
|
| 29 |
+
const title = getTitle().replace(/["'\\]/g, '');
|
| 30 |
+
const referer = window.location.origin + '/';
|
| 31 |
+
if (window.location.hostname.includes('123av.')) {
|
| 32 |
+
return `N_m3u8DL-RE "${m3u8Url}" -H "Referer: https://surrit.store/" --save-name "${title}"`;
|
| 33 |
+
} else {
|
| 34 |
+
return `N_m3u8DL-RE "${m3u8Url}" -H "Referer: ${referer}" --save-name "${title}"`;
|
| 35 |
+
}
|
| 36 |
+
};
|
| 37 |
+
|
| 38 |
+
// UI creation
|
| 39 |
+
const container = document.createElement('div');
|
| 40 |
+
container.id = 'jav-floating-ui';
|
| 41 |
+
container.style.cssText = `
|
| 42 |
+
position: fixed;
|
| 43 |
+
bottom: 20px;
|
| 44 |
+
right: 20px;
|
| 45 |
+
background: #18181b;
|
| 46 |
+
color: #fff;
|
| 47 |
+
padding: 15px;
|
| 48 |
+
border-radius: 10px;
|
| 49 |
+
border: 1px solid #27272a;
|
| 50 |
+
z-index: 999999;
|
| 51 |
+
font-family: sans-serif;
|
| 52 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 53 |
+
display: flex;
|
| 54 |
+
flex-direction: column;
|
| 55 |
+
gap: 10px;
|
| 56 |
+
min-width: 250px;
|
| 57 |
+
max-width: 380px;
|
| 58 |
+
`;
|
| 59 |
+
|
| 60 |
+
const titleDisplay = document.createElement('div');
|
| 61 |
+
titleDisplay.style.cssText = `
|
| 62 |
+
font-weight: bold;
|
| 63 |
+
font-size: 13px;
|
| 64 |
+
color: #f43f5e;
|
| 65 |
+
margin-bottom: 2px;
|
| 66 |
+
white-space: nowrap;
|
| 67 |
+
overflow: hidden;
|
| 68 |
+
text-overflow: ellipsis;
|
| 69 |
+
`;
|
| 70 |
+
titleDisplay.textContent = isPlayPage() ? getTitle() : 'Modo Selección JAV';
|
| 71 |
+
|
| 72 |
+
const statusDisplay = document.createElement('div');
|
| 73 |
+
statusDisplay.textContent = 'Inicializando...';
|
| 74 |
+
statusDisplay.style.cssText = `
|
| 75 |
+
font-size: 13px;
|
| 76 |
+
text-align: center;
|
| 77 |
+
color: #a1a1aa;
|
| 78 |
+
`;
|
| 79 |
+
|
| 80 |
+
container.appendChild(titleDisplay);
|
| 81 |
+
container.appendChild(statusDisplay);
|
| 82 |
+
document.body.appendChild(container);
|
| 83 |
+
|
| 84 |
+
const style = document.createElement('style');
|
| 85 |
+
style.id = 'jav-selector-style';
|
| 86 |
+
style.textContent = `
|
| 87 |
+
.jav-selector-selected {
|
| 88 |
+
position: relative !important;
|
| 89 |
+
outline: 4px solid #f43f5e !important;
|
| 90 |
+
outline-offset: -4px !important;
|
| 91 |
+
}
|
| 92 |
+
.jav-selector-selected::after {
|
| 93 |
+
content: '✓' !important;
|
| 94 |
+
position: absolute !important;
|
| 95 |
+
top: 10px !important;
|
| 96 |
+
left: 10px !important;
|
| 97 |
+
background: #f43f5e !important;
|
| 98 |
+
color: white !important;
|
| 99 |
+
border-radius: 50% !important;
|
| 100 |
+
width: 28px !important;
|
| 101 |
+
height: 28px !important;
|
| 102 |
+
display: flex !important;
|
| 103 |
+
align-items: center !important;
|
| 104 |
+
justify-content: center !important;
|
| 105 |
+
font-weight: bold !important;
|
| 106 |
+
font-size: 16px !important;
|
| 107 |
+
z-index: 2147483647 !important;
|
| 108 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5) !important;
|
| 109 |
+
pointer-events: none !important;
|
| 110 |
+
}
|
| 111 |
+
`;
|
| 112 |
+
document.head.appendChild(style);
|
| 113 |
+
|
| 114 |
+
const closeBtn = document.createElement('button');
|
| 115 |
+
closeBtn.id = 'jav-close-btn';
|
| 116 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 117 |
+
closeBtn.style.cssText = `
|
| 118 |
+
background: #27272a;
|
| 119 |
+
color: white;
|
| 120 |
+
border: 1px solid #3f3f46;
|
| 121 |
+
padding: 8px;
|
| 122 |
+
border-radius: 6px;
|
| 123 |
+
cursor: pointer;
|
| 124 |
+
font-size: 13px;
|
| 125 |
+
margin-top: 5px;
|
| 126 |
+
`;
|
| 127 |
+
|
| 128 |
+
const cleanUp = () => {
|
| 129 |
+
document.querySelectorAll('.jav-selector-selected').forEach(el => el.classList.remove('jav-selector-selected'));
|
| 130 |
+
container.remove();
|
| 131 |
+
style.remove();
|
| 132 |
+
window.__javSelectorActive = false;
|
| 133 |
+
try {
|
| 134 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'jav' });
|
| 135 |
+
} catch (e) {
|
| 136 |
+
console.log("Could not notify popup, it is probably closed");
|
| 137 |
+
}
|
| 138 |
+
};
|
| 139 |
+
|
| 140 |
+
closeBtn.onclick = cleanUp;
|
| 141 |
+
|
| 142 |
+
// PLAY PAGE MODE
|
| 143 |
+
if (isPlayPage()) {
|
| 144 |
+
const extract123AV = async () => {
|
| 145 |
+
const html = document.documentElement.outerHTML;
|
| 146 |
+
const match = html.match(/player\(JSON\.parse\('([^']+)'\)/);
|
| 147 |
+
if (!match) {
|
| 148 |
+
throw new Error("No se encontró el objeto de reproducción 123AV.");
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
let rawJson = match[1];
|
| 152 |
+
let jsonStr = rawJson.replace(/\\"/g, '"').replace(/\\\//g, '/');
|
| 153 |
+
jsonStr = jsonStr.replace(/\\u([0-9a-fA-F]{4})/g, (m, grp) => String.fromCharCode(parseInt(grp, 16)));
|
| 154 |
+
|
| 155 |
+
const playerData = JSON.parse(jsonStr);
|
| 156 |
+
let surritUrl = null;
|
| 157 |
+
for (const item of playerData) {
|
| 158 |
+
if (item.url && item.url.includes('surrit.')) {
|
| 159 |
+
surritUrl = item.url;
|
| 160 |
+
break;
|
| 161 |
+
}
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
if (!surritUrl) {
|
| 165 |
+
throw new Error("No se encontró el reproductor Surrit.");
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
const urlObj = new URL(surritUrl);
|
| 169 |
+
const videoId = urlObj.pathname.split('/').pop();
|
| 170 |
+
const poster = urlObj.searchParams.get('poster') || '';
|
| 171 |
+
const streamApiUrl = `https://surrit.store/stream?id=${videoId}&poster=${encodeURIComponent(poster)}`;
|
| 172 |
+
|
| 173 |
+
return new Promise((resolve, reject) => {
|
| 174 |
+
chrome.runtime.sendMessage({
|
| 175 |
+
type: 'FETCH_SURRIT',
|
| 176 |
+
url: streamApiUrl,
|
| 177 |
+
referer: surritUrl
|
| 178 |
+
}, (response) => {
|
| 179 |
+
if (chrome.runtime.lastError) {
|
| 180 |
+
reject(new Error(chrome.runtime.lastError.message));
|
| 181 |
+
return;
|
| 182 |
+
}
|
| 183 |
+
if (response && response.success && response.data) {
|
| 184 |
+
const streamUrl = response.data.media?.stream;
|
| 185 |
+
if (streamUrl) {
|
| 186 |
+
resolve(streamUrl);
|
| 187 |
+
} else {
|
| 188 |
+
reject(new Error("La API de Surrit no devolvió un stream válido."));
|
| 189 |
+
}
|
| 190 |
+
} else {
|
| 191 |
+
reject(new Error(response?.error || "Error al consultar la API de Surrit."));
|
| 192 |
+
}
|
| 193 |
+
});
|
| 194 |
+
});
|
| 195 |
+
};
|
| 196 |
+
|
| 197 |
+
const extractMissAV = async () => {
|
| 198 |
+
const html = document.documentElement.outerHTML;
|
| 199 |
+
|
| 200 |
+
const splitMatch = html.match(/'([^']+)'\.split\('\|'\)/);
|
| 201 |
+
if (splitMatch) {
|
| 202 |
+
const words = splitMatch[1].split('|');
|
| 203 |
+
const pMatch = html.match(/\}\('(.*?)', *\d+, *\d+,/);
|
| 204 |
+
if (pMatch) {
|
| 205 |
+
let p = pMatch[1];
|
| 206 |
+
function base36(i) {
|
| 207 |
+
return i.toString(36);
|
| 208 |
+
}
|
| 209 |
+
for (let i = words.length - 1; i >= 0; i--) {
|
| 210 |
+
const word = words[i];
|
| 211 |
+
if (word) {
|
| 212 |
+
const idx = base36(i);
|
| 213 |
+
const regex = new RegExp('\\b' + idx + '\\b', 'g');
|
| 214 |
+
p = p.replace(regex, word);
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
const m3u8Links = p.match(/https?:\/\/surrit\.com[^\s'"]+\.m3u8/);
|
| 218 |
+
if (m3u8Links) {
|
| 219 |
+
return m3u8Links[0];
|
| 220 |
+
}
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
const m3u8Matches = html.match(/https?:\/\/surrit\.com\/[a-zA-Z0-9-]+\/[^\s'"]+\.m3u8/);
|
| 225 |
+
if (m3u8Matches) {
|
| 226 |
+
return m3u8Matches[0];
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
const sources = Array.from(document.querySelectorAll('video, source, iframe'));
|
| 230 |
+
for (const srcEl of sources) {
|
| 231 |
+
const src = srcEl.src || srcEl.getAttribute('src');
|
| 232 |
+
if (src && (src.includes('surrit.com') || src.includes('surrit.store')) && src.includes('.m3u8')) {
|
| 233 |
+
return src;
|
| 234 |
+
}
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
throw new Error("No se pudo desencriptar ni localizar la URL HLS (.m3u8).");
|
| 238 |
+
};
|
| 239 |
+
|
| 240 |
+
const runExtraction = async () => {
|
| 241 |
+
statusDisplay.textContent = 'Extrayendo enlace de video...';
|
| 242 |
+
try {
|
| 243 |
+
let m3u8Url = null;
|
| 244 |
+
if (window.location.hostname.includes('123av.')) {
|
| 245 |
+
m3u8Url = await extract123AV();
|
| 246 |
+
} else {
|
| 247 |
+
m3u8Url = await extractMissAV();
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
statusDisplay.style.display = 'none';
|
| 251 |
+
|
| 252 |
+
const urlInput = document.createElement('input');
|
| 253 |
+
urlInput.type = 'text';
|
| 254 |
+
urlInput.readOnly = true;
|
| 255 |
+
urlInput.value = m3u8Url;
|
| 256 |
+
urlInput.style.cssText = `
|
| 257 |
+
background: #27272a;
|
| 258 |
+
border: 1px solid #3f3f46;
|
| 259 |
+
color: #fff;
|
| 260 |
+
padding: 8px;
|
| 261 |
+
border-radius: 6px;
|
| 262 |
+
font-size: 12px;
|
| 263 |
+
outline: none;
|
| 264 |
+
width: calc(100% - 18px);
|
| 265 |
+
`;
|
| 266 |
+
urlInput.onclick = () => {
|
| 267 |
+
urlInput.select();
|
| 268 |
+
};
|
| 269 |
+
|
| 270 |
+
const copyM3u8Btn = document.createElement('button');
|
| 271 |
+
copyM3u8Btn.textContent = 'Copiar Enlace .m3u8';
|
| 272 |
+
copyM3u8Btn.style.cssText = `
|
| 273 |
+
background: #f43f5e;
|
| 274 |
+
color: white;
|
| 275 |
+
border: none;
|
| 276 |
+
padding: 10px;
|
| 277 |
+
border-radius: 6px;
|
| 278 |
+
cursor: pointer;
|
| 279 |
+
font-weight: bold;
|
| 280 |
+
font-size: 13px;
|
| 281 |
+
`;
|
| 282 |
+
copyM3u8Btn.onclick = () => {
|
| 283 |
+
navigator.clipboard.writeText(m3u8Url).then(() => {
|
| 284 |
+
const originalText = copyM3u8Btn.textContent;
|
| 285 |
+
copyM3u8Btn.textContent = '¡Copiado!';
|
| 286 |
+
copyM3u8Btn.style.background = '#10b981';
|
| 287 |
+
setTimeout(() => {
|
| 288 |
+
copyM3u8Btn.textContent = originalText;
|
| 289 |
+
copyM3u8Btn.style.background = '#f43f5e';
|
| 290 |
+
}, 2000);
|
| 291 |
+
});
|
| 292 |
+
};
|
| 293 |
+
|
| 294 |
+
const copyCmdBtn = document.createElement('button');
|
| 295 |
+
copyCmdBtn.textContent = 'Copiar Comando de Descarga';
|
| 296 |
+
copyCmdBtn.style.cssText = `
|
| 297 |
+
background: #3f3f46;
|
| 298 |
+
color: white;
|
| 299 |
+
border: none;
|
| 300 |
+
padding: 8px;
|
| 301 |
+
border-radius: 6px;
|
| 302 |
+
cursor: pointer;
|
| 303 |
+
font-weight: 600;
|
| 304 |
+
font-size: 12px;
|
| 305 |
+
`;
|
| 306 |
+
copyCmdBtn.onclick = () => {
|
| 307 |
+
const cmd = makeDownloadCommand(m3u8Url);
|
| 308 |
+
navigator.clipboard.writeText(cmd).then(() => {
|
| 309 |
+
const originalText = copyCmdBtn.textContent;
|
| 310 |
+
copyCmdBtn.textContent = '¡Comando Copiado!';
|
| 311 |
+
copyCmdBtn.style.background = '#10b981';
|
| 312 |
+
setTimeout(() => {
|
| 313 |
+
copyCmdBtn.textContent = originalText;
|
| 314 |
+
copyCmdBtn.style.background = '#3f3f46';
|
| 315 |
+
}, 2000);
|
| 316 |
+
});
|
| 317 |
+
};
|
| 318 |
+
|
| 319 |
+
container.appendChild(urlInput);
|
| 320 |
+
container.appendChild(copyM3u8Btn);
|
| 321 |
+
container.appendChild(copyCmdBtn);
|
| 322 |
+
container.appendChild(closeBtn);
|
| 323 |
+
|
| 324 |
+
} catch (err) {
|
| 325 |
+
statusDisplay.textContent = 'Error: ' + err.message;
|
| 326 |
+
statusDisplay.style.color = '#ef4444';
|
| 327 |
+
container.appendChild(closeBtn);
|
| 328 |
+
}
|
| 329 |
+
};
|
| 330 |
+
|
| 331 |
+
runExtraction();
|
| 332 |
+
|
| 333 |
+
} else {
|
| 334 |
+
// LISTINGS INTERACTIVE MODE
|
| 335 |
+
statusDisplay.textContent = '0 enlaces seleccionados';
|
| 336 |
+
|
| 337 |
+
const selectedLinks = new Set();
|
| 338 |
+
|
| 339 |
+
const getCleanUrl = (href) => {
|
| 340 |
+
if (!href) return '';
|
| 341 |
+
let url = href.split('?')[0].split('#')[0].trim();
|
| 342 |
+
if (url.endsWith('/')) {
|
| 343 |
+
url = url.slice(0, -1);
|
| 344 |
+
}
|
| 345 |
+
return url;
|
| 346 |
+
};
|
| 347 |
+
|
| 348 |
+
const isVideoLink = (a) => {
|
| 349 |
+
if (!a || !a.href) return false;
|
| 350 |
+
const href = a.href.toLowerCase();
|
| 351 |
+
if (href.includes('javascript') || href === '#' || href.includes('void(0)')) return false;
|
| 352 |
+
|
| 353 |
+
if (href.includes('123av.com') || href.includes('123av.org') || href.includes('123av.me')) {
|
| 354 |
+
return href.includes('/v/');
|
| 355 |
+
}
|
| 356 |
+
if (href.includes('missav.com') || href.includes('missav.ws')) {
|
| 357 |
+
return /\/[a-z0-9]+-\d+/i.test(href);
|
| 358 |
+
}
|
| 359 |
+
// Fallback for relative paths
|
| 360 |
+
const pathname = a.pathname;
|
| 361 |
+
return pathname.includes('/v/') || /\/[a-z0-9]+-\d+/i.test(pathname);
|
| 362 |
+
};
|
| 363 |
+
|
| 364 |
+
const isThumbnailAnchor = (a) => {
|
| 365 |
+
if (!a) return false;
|
| 366 |
+
if (a.querySelector('img, picture, canvas, video, [class*="thumb"], [class*="img"], [class*="preview"], [class*="cover"]')) return true;
|
| 367 |
+
|
| 368 |
+
let className = '';
|
| 369 |
+
if (typeof a.className === 'string') {
|
| 370 |
+
className = a.className.toLowerCase();
|
| 371 |
+
} else if (a.className && typeof a.className.baseVal === 'string') {
|
| 372 |
+
className = a.className.baseVal.toLowerCase();
|
| 373 |
+
}
|
| 374 |
+
if (className.includes('thumb') || className.includes('img') || className.includes('preview') || className.includes('cover')) return true;
|
| 375 |
+
|
| 376 |
+
const textLen = a.textContent.trim().length;
|
| 377 |
+
if (textLen < 20 && a.querySelector('*')) return true;
|
| 378 |
+
|
| 379 |
+
return false;
|
| 380 |
+
};
|
| 381 |
+
|
| 382 |
+
const initAnchors = () => {
|
| 383 |
+
document.querySelectorAll('a').forEach(a => {
|
| 384 |
+
if (isVideoLink(a) && isThumbnailAnchor(a)) {
|
| 385 |
+
a.__isThumbnail = true;
|
| 386 |
+
if (!a.__originalVideoUrl) {
|
| 387 |
+
a.__originalVideoUrl = getCleanUrl(a.href);
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
});
|
| 391 |
+
};
|
| 392 |
+
|
| 393 |
+
initAnchors();
|
| 394 |
+
const initInterval = setInterval(initAnchors, 800);
|
| 395 |
+
|
| 396 |
+
const toggleCardSelection = (url, select) => {
|
| 397 |
+
initAnchors();
|
| 398 |
+
document.querySelectorAll('a').forEach(a => {
|
| 399 |
+
if (a.__originalVideoUrl === url && a.__isThumbnail) {
|
| 400 |
+
if (select) {
|
| 401 |
+
a.classList.add('jav-selector-selected');
|
| 402 |
+
} else {
|
| 403 |
+
a.classList.remove('jav-selector-selected');
|
| 404 |
+
}
|
| 405 |
+
}
|
| 406 |
+
});
|
| 407 |
+
};
|
| 408 |
+
|
| 409 |
+
const clickHandler = (e) => {
|
| 410 |
+
const card = e.target.closest('a');
|
| 411 |
+
if (card && isVideoLink(card) && isThumbnailAnchor(card)) {
|
| 412 |
+
initAnchors();
|
| 413 |
+
let url = card.__originalVideoUrl;
|
| 414 |
+
if (!url) {
|
| 415 |
+
url = getCleanUrl(card.href);
|
| 416 |
+
card.__originalVideoUrl = url;
|
| 417 |
+
}
|
| 418 |
+
if (!url) return;
|
| 419 |
+
|
| 420 |
+
e.preventDefault();
|
| 421 |
+
e.stopPropagation();
|
| 422 |
+
|
| 423 |
+
if (selectedLinks.has(url)) {
|
| 424 |
+
selectedLinks.delete(url);
|
| 425 |
+
toggleCardSelection(url, false);
|
| 426 |
+
} else {
|
| 427 |
+
selectedLinks.add(url);
|
| 428 |
+
toggleCardSelection(url, true);
|
| 429 |
+
}
|
| 430 |
+
statusDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 431 |
+
}
|
| 432 |
+
};
|
| 433 |
+
|
| 434 |
+
document.addEventListener('click', clickHandler, true);
|
| 435 |
+
|
| 436 |
+
const selectAllBtn = document.createElement('button');
|
| 437 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 438 |
+
selectAllBtn.style.cssText = `
|
| 439 |
+
background: #3f3f46;
|
| 440 |
+
color: white;
|
| 441 |
+
border: none;
|
| 442 |
+
padding: 8px;
|
| 443 |
+
border-radius: 6px;
|
| 444 |
+
cursor: pointer;
|
| 445 |
+
font-weight: 600;
|
| 446 |
+
font-size: 13px;
|
| 447 |
+
transition: background 0.2s;
|
| 448 |
+
`;
|
| 449 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 450 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 451 |
+
|
| 452 |
+
selectAllBtn.onclick = () => {
|
| 453 |
+
initAnchors();
|
| 454 |
+
const links = [];
|
| 455 |
+
document.querySelectorAll('a').forEach(a => {
|
| 456 |
+
if (a.__isThumbnail && a.__originalVideoUrl) {
|
| 457 |
+
links.push(a);
|
| 458 |
+
}
|
| 459 |
+
});
|
| 460 |
+
|
| 461 |
+
let allSelected = true;
|
| 462 |
+
links.forEach(a => {
|
| 463 |
+
const url = a.__originalVideoUrl;
|
| 464 |
+
if (!selectedLinks.has(url)) {
|
| 465 |
+
allSelected = false;
|
| 466 |
+
}
|
| 467 |
+
});
|
| 468 |
+
|
| 469 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 470 |
+
links.forEach(a => {
|
| 471 |
+
const url = a.__originalVideoUrl;
|
| 472 |
+
selectedLinks.delete(url);
|
| 473 |
+
toggleCardSelection(url, false);
|
| 474 |
+
});
|
| 475 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 476 |
+
} else {
|
| 477 |
+
links.forEach(a => {
|
| 478 |
+
const url = a.__originalVideoUrl;
|
| 479 |
+
if (!selectedLinks.has(url)) {
|
| 480 |
+
selectedLinks.add(url);
|
| 481 |
+
toggleCardSelection(url, true);
|
| 482 |
+
}
|
| 483 |
+
});
|
| 484 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 485 |
+
}
|
| 486 |
+
statusDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 487 |
+
};
|
| 488 |
+
|
| 489 |
+
const copyBtn = document.createElement('button');
|
| 490 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 491 |
+
copyBtn.style.cssText = `
|
| 492 |
+
background: #f43f5e;
|
| 493 |
+
color: white;
|
| 494 |
+
border: none;
|
| 495 |
+
padding: 10px;
|
| 496 |
+
border-radius: 6px;
|
| 497 |
+
cursor: pointer;
|
| 498 |
+
font-weight: bold;
|
| 499 |
+
`;
|
| 500 |
+
copyBtn.onclick = () => {
|
| 501 |
+
if (selectedLinks.size === 0) return;
|
| 502 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 503 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 504 |
+
const ogText = copyBtn.textContent;
|
| 505 |
+
copyBtn.textContent = '¡Copiados!';
|
| 506 |
+
copyBtn.style.background = '#10b981';
|
| 507 |
+
setTimeout(() => {
|
| 508 |
+
copyBtn.textContent = ogText;
|
| 509 |
+
copyBtn.style.background = '#f43f5e';
|
| 510 |
+
}, 2000);
|
| 511 |
+
});
|
| 512 |
+
};
|
| 513 |
+
|
| 514 |
+
container.appendChild(selectAllBtn);
|
| 515 |
+
container.appendChild(copyBtn);
|
| 516 |
+
container.appendChild(closeBtn);
|
| 517 |
+
|
| 518 |
+
// Override cleanup to clear interval and listener
|
| 519 |
+
const originalCleanUp = closeBtn.onclick;
|
| 520 |
+
closeBtn.onclick = () => {
|
| 521 |
+
clearInterval(initInterval);
|
| 522 |
+
document.removeEventListener('click', clickHandler, true);
|
| 523 |
+
originalCleanUp();
|
| 524 |
+
};
|
| 525 |
+
}
|
| 526 |
+
})();
|
detector de enlaces - copia/src/kemono/downloads.js
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (window.__kemonoDownloadsActive) return;
|
| 3 |
+
window.__kemonoDownloadsActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'kemono-dl-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const selectAllBtn = document.createElement('button');
|
| 34 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 35 |
+
selectAllBtn.style.cssText = `
|
| 36 |
+
background: #3f3f46;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 8px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: 600;
|
| 43 |
+
font-size: 13px;
|
| 44 |
+
transition: background 0.2s;
|
| 45 |
+
`;
|
| 46 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 47 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 48 |
+
|
| 49 |
+
const copyBtn = document.createElement('button');
|
| 50 |
+
copyBtn.textContent = 'Procesar Enlaces';
|
| 51 |
+
copyBtn.style.cssText = `
|
| 52 |
+
background: #fbbf24;
|
| 53 |
+
color: #000;
|
| 54 |
+
border: none;
|
| 55 |
+
padding: 10px;
|
| 56 |
+
border-radius: 6px;
|
| 57 |
+
cursor: pointer;
|
| 58 |
+
font-weight: bold;
|
| 59 |
+
`;
|
| 60 |
+
|
| 61 |
+
const finalCopyBtn = document.createElement('button');
|
| 62 |
+
finalCopyBtn.textContent = 'Copiar Enlaces Procesados';
|
| 63 |
+
finalCopyBtn.style.cssText = `
|
| 64 |
+
background: #10b981;
|
| 65 |
+
color: #fff;
|
| 66 |
+
border: none;
|
| 67 |
+
padding: 10px;
|
| 68 |
+
border-radius: 6px;
|
| 69 |
+
cursor: pointer;
|
| 70 |
+
font-weight: bold;
|
| 71 |
+
display: none;
|
| 72 |
+
`;
|
| 73 |
+
|
| 74 |
+
const closeBtn = document.createElement('button');
|
| 75 |
+
closeBtn.id = 'kemono-dl-close-btn';
|
| 76 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 77 |
+
closeBtn.style.cssText = `
|
| 78 |
+
background: #27272a;
|
| 79 |
+
color: white;
|
| 80 |
+
border: 1px solid #3f3f46;
|
| 81 |
+
padding: 8px;
|
| 82 |
+
border-radius: 6px;
|
| 83 |
+
cursor: pointer;
|
| 84 |
+
font-size: 13px;
|
| 85 |
+
`;
|
| 86 |
+
|
| 87 |
+
const uploadTxtBtn = document.createElement('button');
|
| 88 |
+
uploadTxtBtn.textContent = 'Cargar TXT';
|
| 89 |
+
uploadTxtBtn.style.cssText = `
|
| 90 |
+
background: #6366f1;
|
| 91 |
+
color: white;
|
| 92 |
+
border: none;
|
| 93 |
+
padding: 8px;
|
| 94 |
+
border-radius: 6px;
|
| 95 |
+
cursor: pointer;
|
| 96 |
+
font-weight: 600;
|
| 97 |
+
font-size: 13px;
|
| 98 |
+
transition: background 0.2s;
|
| 99 |
+
`;
|
| 100 |
+
uploadTxtBtn.onmouseover = () => uploadTxtBtn.style.background = '#4f46e5';
|
| 101 |
+
uploadTxtBtn.onmouseout = () => uploadTxtBtn.style.background = '#6366f1';
|
| 102 |
+
|
| 103 |
+
const fileInput = document.createElement('input');
|
| 104 |
+
fileInput.type = 'file';
|
| 105 |
+
fileInput.accept = '.txt';
|
| 106 |
+
fileInput.multiple = true;
|
| 107 |
+
fileInput.style.display = 'none';
|
| 108 |
+
|
| 109 |
+
uploadTxtBtn.onclick = () => fileInput.click();
|
| 110 |
+
|
| 111 |
+
fileInput.onchange = async (e) => {
|
| 112 |
+
const files = e.target.files;
|
| 113 |
+
if (!files || files.length === 0) return;
|
| 114 |
+
|
| 115 |
+
let totalAddedCount = 0;
|
| 116 |
+
|
| 117 |
+
for (let i = 0; i < files.length; i++) {
|
| 118 |
+
const text = await files[i].text();
|
| 119 |
+
const regex = /(https?:\/\/(kemono\.cr|kemono\.su|kemono\.party|pawchive\.st)\/[a-zA-Z0-9_-]+\/user\/[a-zA-Z0-9_-]+\/post\/[0-9]+)/gi;
|
| 120 |
+
let matches;
|
| 121 |
+
while ((matches = regex.exec(text)) !== null) {
|
| 122 |
+
const url = matches[0].split('?')[0];
|
| 123 |
+
if (!selectedLinks.has(url)) {
|
| 124 |
+
selectedLinks.add(url);
|
| 125 |
+
totalAddedCount++;
|
| 126 |
+
}
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 131 |
+
uploadTxtBtn.textContent = `+${totalAddedCount} Enlaces Agregados!`;
|
| 132 |
+
setTimeout(() => uploadTxtBtn.textContent = 'Cargar TXT', 3000);
|
| 133 |
+
};
|
| 134 |
+
|
| 135 |
+
container.appendChild(countDisplay);
|
| 136 |
+
container.appendChild(uploadTxtBtn);
|
| 137 |
+
container.appendChild(fileInput);
|
| 138 |
+
container.appendChild(selectAllBtn);
|
| 139 |
+
container.appendChild(copyBtn);
|
| 140 |
+
container.appendChild(finalCopyBtn);
|
| 141 |
+
container.appendChild(closeBtn);
|
| 142 |
+
document.body.appendChild(container);
|
| 143 |
+
|
| 144 |
+
const style = document.createElement('style');
|
| 145 |
+
style.id = 'kemono-dl-style';
|
| 146 |
+
style.textContent = `
|
| 147 |
+
.kemono-dl-selector-hover {
|
| 148 |
+
outline: 3px solid #fbbf24 !important;
|
| 149 |
+
cursor: crosshair !important;
|
| 150 |
+
transition: all 0.2s;
|
| 151 |
+
}
|
| 152 |
+
.kemono-dl-selector-selected {
|
| 153 |
+
outline: 4px solid #f59e0b !important;
|
| 154 |
+
opacity: 0.8;
|
| 155 |
+
position: relative;
|
| 156 |
+
}
|
| 157 |
+
.kemono-dl-selector-selected::after {
|
| 158 |
+
content: '✓';
|
| 159 |
+
position: absolute;
|
| 160 |
+
top: 10px;
|
| 161 |
+
right: 10px;
|
| 162 |
+
background: #f59e0b;
|
| 163 |
+
color: white;
|
| 164 |
+
border-radius: 50%;
|
| 165 |
+
width: 30px;
|
| 166 |
+
height: 30px;
|
| 167 |
+
display: flex;
|
| 168 |
+
align-items: center;
|
| 169 |
+
justify-content: center;
|
| 170 |
+
font-weight: bold;
|
| 171 |
+
font-size: 16px;
|
| 172 |
+
z-index: 10;
|
| 173 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
|
| 174 |
+
}
|
| 175 |
+
.kemono-dl-success::after {
|
| 176 |
+
background: #10b981 !important;
|
| 177 |
+
transform: scale(1.15);
|
| 178 |
+
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
|
| 179 |
+
}
|
| 180 |
+
`;
|
| 181 |
+
document.head.appendChild(style);
|
| 182 |
+
|
| 183 |
+
const getPostCard = (el) => el.closest('.post-card');
|
| 184 |
+
|
| 185 |
+
let isDragging = false;
|
| 186 |
+
let dragMode = null;
|
| 187 |
+
|
| 188 |
+
const mouseOver = (e) => {
|
| 189 |
+
const card = getPostCard(e.target);
|
| 190 |
+
if (card) {
|
| 191 |
+
if (isDragging) {
|
| 192 |
+
e.preventDefault();
|
| 193 |
+
e.stopPropagation();
|
| 194 |
+
|
| 195 |
+
const link = card.querySelector('a');
|
| 196 |
+
if (!link) return;
|
| 197 |
+
const url = link.href;
|
| 198 |
+
|
| 199 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 200 |
+
selectedLinks.add(url);
|
| 201 |
+
card.classList.add('kemono-dl-selector-selected');
|
| 202 |
+
card.classList.remove('kemono-dl-selector-hover');
|
| 203 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 204 |
+
selectedLinks.delete(url);
|
| 205 |
+
card.classList.remove('kemono-dl-selector-selected');
|
| 206 |
+
}
|
| 207 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 208 |
+
} else {
|
| 209 |
+
if (!card.classList.contains('kemono-dl-selector-selected')) {
|
| 210 |
+
card.classList.add('kemono-dl-selector-hover');
|
| 211 |
+
}
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
};
|
| 215 |
+
|
| 216 |
+
const mouseOut = (e) => {
|
| 217 |
+
const card = getPostCard(e.target);
|
| 218 |
+
if (card) {
|
| 219 |
+
card.classList.remove('kemono-dl-selector-hover');
|
| 220 |
+
}
|
| 221 |
+
};
|
| 222 |
+
|
| 223 |
+
const mouseDown = (e) => {
|
| 224 |
+
const card = getPostCard(e.target);
|
| 225 |
+
if (card) {
|
| 226 |
+
e.preventDefault();
|
| 227 |
+
isDragging = true;
|
| 228 |
+
|
| 229 |
+
const link = card.querySelector('a');
|
| 230 |
+
if (!link) return;
|
| 231 |
+
const url = link.href;
|
| 232 |
+
|
| 233 |
+
if (selectedLinks.has(url)) {
|
| 234 |
+
dragMode = 'deselect';
|
| 235 |
+
selectedLinks.delete(url);
|
| 236 |
+
card.classList.remove('kemono-dl-selector-selected');
|
| 237 |
+
} else {
|
| 238 |
+
dragMode = 'select';
|
| 239 |
+
selectedLinks.add(url);
|
| 240 |
+
card.classList.add('kemono-dl-selector-selected');
|
| 241 |
+
card.classList.remove('kemono-dl-selector-hover');
|
| 242 |
+
}
|
| 243 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 244 |
+
}
|
| 245 |
+
};
|
| 246 |
+
|
| 247 |
+
const mouseUp = (e) => {
|
| 248 |
+
isDragging = false;
|
| 249 |
+
dragMode = null;
|
| 250 |
+
};
|
| 251 |
+
|
| 252 |
+
const dragStart = (e) => {
|
| 253 |
+
const card = getPostCard(e.target);
|
| 254 |
+
if (card) e.preventDefault();
|
| 255 |
+
};
|
| 256 |
+
|
| 257 |
+
const click = (e) => {
|
| 258 |
+
const card = getPostCard(e.target);
|
| 259 |
+
if (card) {
|
| 260 |
+
e.preventDefault();
|
| 261 |
+
e.stopPropagation();
|
| 262 |
+
}
|
| 263 |
+
};
|
| 264 |
+
|
| 265 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 266 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 267 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 268 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 269 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 270 |
+
document.addEventListener('click', click, true);
|
| 271 |
+
|
| 272 |
+
selectAllBtn.onclick = () => {
|
| 273 |
+
const cards = document.querySelectorAll('.post-card');
|
| 274 |
+
let allSelected = true;
|
| 275 |
+
|
| 276 |
+
cards.forEach(card => {
|
| 277 |
+
const link = card.querySelector('a');
|
| 278 |
+
if (link && !selectedLinks.has(link.href)) {
|
| 279 |
+
allSelected = false;
|
| 280 |
+
}
|
| 281 |
+
});
|
| 282 |
+
|
| 283 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 284 |
+
cards.forEach(card => {
|
| 285 |
+
card.classList.remove('kemono-dl-selector-selected');
|
| 286 |
+
const link = card.querySelector('a');
|
| 287 |
+
if (link) selectedLinks.delete(link.href);
|
| 288 |
+
});
|
| 289 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 290 |
+
} else {
|
| 291 |
+
cards.forEach(card => {
|
| 292 |
+
const link = card.querySelector('a');
|
| 293 |
+
if (link && !selectedLinks.has(link.href)) {
|
| 294 |
+
selectedLinks.add(link.href);
|
| 295 |
+
card.classList.add('kemono-dl-selector-selected');
|
| 296 |
+
card.classList.remove('kemono-dl-selector-hover');
|
| 297 |
+
}
|
| 298 |
+
});
|
| 299 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 300 |
+
}
|
| 301 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 302 |
+
};
|
| 303 |
+
|
| 304 |
+
copyBtn.onclick = async () => {
|
| 305 |
+
if (selectedLinks.size === 0) return;
|
| 306 |
+
const ogText = copyBtn.textContent;
|
| 307 |
+
|
| 308 |
+
try {
|
| 309 |
+
copyBtn.textContent = 'Analizando en Navegador... 0%';
|
| 310 |
+
copyBtn.style.background = '#f59e0b';
|
| 311 |
+
copyBtn.style.color = '#fff';
|
| 312 |
+
copyBtn.disabled = true;
|
| 313 |
+
finalCopyBtn.style.display = 'none';
|
| 314 |
+
|
| 315 |
+
const uniqueUrls = [...new Set([...selectedLinks].map(u => u.replace(/\/$/, '')))];
|
| 316 |
+
const total = uniqueUrls.length;
|
| 317 |
+
|
| 318 |
+
let outputWithLinks = `\n=========================================\nNUEVA EXTRACCION - ${new Date().toLocaleString()}\nPOSTS CON ENLACES\n=========================================\n\n`;
|
| 319 |
+
let outputNoLinks = `\n=========================================\nNUEVA EXTRACCION - ${new Date().toLocaleString()}\nPOSTS SIN ENLACES (O ERRORES)\n=========================================\n\n`;
|
| 320 |
+
let hasLinksElements = false;
|
| 321 |
+
let hasNoLinksElements = false;
|
| 322 |
+
|
| 323 |
+
let count = 0;
|
| 324 |
+
const CONCURRENCY_LIMIT = 4;
|
| 325 |
+
let queue = [...uniqueUrls];
|
| 326 |
+
|
| 327 |
+
const extractWorker = async (workerId) => {
|
| 328 |
+
let iframe = document.createElement('iframe');
|
| 329 |
+
iframe.id = `kemono-extractor-frame-${workerId}`;
|
| 330 |
+
iframe.style.width = '1px';
|
| 331 |
+
iframe.style.height = '1px';
|
| 332 |
+
iframe.style.opacity = '0';
|
| 333 |
+
iframe.style.pointerEvents = 'none';
|
| 334 |
+
iframe.style.position = 'fixed';
|
| 335 |
+
iframe.style.bottom = '0';
|
| 336 |
+
document.body.appendChild(iframe);
|
| 337 |
+
|
| 338 |
+
while (queue.length > 0) {
|
| 339 |
+
const url = queue.shift();
|
| 340 |
+
count++;
|
| 341 |
+
copyBtn.textContent = `Analizando páginas... ${Math.round((count/total)*100)}%`;
|
| 342 |
+
|
| 343 |
+
let postText = "";
|
| 344 |
+
try {
|
| 345 |
+
let loaded = false;
|
| 346 |
+
iframe.onload = () => { loaded = true; };
|
| 347 |
+
iframe.src = url;
|
| 348 |
+
|
| 349 |
+
let waitTimer = 0;
|
| 350 |
+
while (!loaded && waitTimer < 15000) {
|
| 351 |
+
await new Promise(r => setTimeout(r, 200));
|
| 352 |
+
waitTimer += 200;
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
await new Promise(r => setTimeout(r, 2500 + Math.random() * 500));
|
| 356 |
+
|
| 357 |
+
const doc = iframe.contentDocument;
|
| 358 |
+
if (!doc) throw new Error("Página bloqueada o inaccesible");
|
| 359 |
+
|
| 360 |
+
let titleEl = doc.querySelector('.post__title span') || doc.querySelector('.post__title') || doc.querySelector('h1');
|
| 361 |
+
let title = titleEl ? titleEl.innerText.trim() : 'Desconocido';
|
| 362 |
+
|
| 363 |
+
let authorEl = doc.querySelector('.post__user-name') || doc.querySelector('.post__author');
|
| 364 |
+
let author = authorEl ? authorEl.innerText.trim() : 'Desconocido';
|
| 365 |
+
|
| 366 |
+
let downloadLinks = [];
|
| 367 |
+
const isImage = (str) => /\.(jpg|jpeg|png|webp|gif|avif|bmp)(\?|$|\w)/i.test(str || '');
|
| 368 |
+
const isValid = (h, fallbackName = '') => {
|
| 369 |
+
if (!h) return false;
|
| 370 |
+
if (isImage(h) || isImage(fallbackName)) return false;
|
| 371 |
+
if (h.includes('/posts/archives/')) return false;
|
| 372 |
+
|
| 373 |
+
const isExternal = !h.includes('kemono.cr') && !h.includes('kemono.su') && !h.includes('pawchive.st') && h.startsWith('http');
|
| 374 |
+
const isLocalValid = h.includes('/downloads') || h.includes('/data/');
|
| 375 |
+
return isExternal || isLocalValid;
|
| 376 |
+
};
|
| 377 |
+
|
| 378 |
+
doc.querySelectorAll('a.post__attachment-link, .post__attachment a').forEach(a => {
|
| 379 |
+
let href = a.getAttribute('href');
|
| 380 |
+
let name = a.getAttribute('download') || a.innerText.trim();
|
| 381 |
+
if (isValid(href, name)) {
|
| 382 |
+
if (!href.startsWith('http')) href = new URL(href, url).href;
|
| 383 |
+
downloadLinks.push(href);
|
| 384 |
+
}
|
| 385 |
+
});
|
| 386 |
+
|
| 387 |
+
doc.querySelectorAll('.post__content a, .post__body a').forEach(a => {
|
| 388 |
+
let href = a.getAttribute('href');
|
| 389 |
+
if (isValid(href)) {
|
| 390 |
+
downloadLinks.push(href);
|
| 391 |
+
}
|
| 392 |
+
});
|
| 393 |
+
|
| 394 |
+
let contentEl = doc.querySelector('.post__content') || doc.querySelector('.post__body');
|
| 395 |
+
let contentText = contentEl ? contentEl.innerHTML : '';
|
| 396 |
+
let textUrls = contentText.match(/(https?:\/\/[^\s<"']+)/g) || [];
|
| 397 |
+
textUrls.forEach(href => {
|
| 398 |
+
if (isValid(href)) {
|
| 399 |
+
downloadLinks.push(href);
|
| 400 |
+
}
|
| 401 |
+
});
|
| 402 |
+
|
| 403 |
+
downloadLinks = [...new Set(downloadLinks)];
|
| 404 |
+
|
| 405 |
+
if (downloadLinks.length === 0) {
|
| 406 |
+
let scripts = Array.from(doc.querySelectorAll('script'));
|
| 407 |
+
for(let s of scripts) {
|
| 408 |
+
if (s.innerText.includes('postData') || s.innerText.includes('__NUXT__')) {
|
| 409 |
+
let jsonMatch = s.innerText.match(/(https?:\/\/[^\s<"'\\]+)/g) || [];
|
| 410 |
+
jsonMatch.forEach(href => {
|
| 411 |
+
try {
|
| 412 |
+
let cleanHref = href.replace(/\\u0026/g, '&');
|
| 413 |
+
if (isValid(cleanHref)) {
|
| 414 |
+
downloadLinks.push(cleanHref);
|
| 415 |
+
}
|
| 416 |
+
} catch(e) {}
|
| 417 |
+
});
|
| 418 |
+
}
|
| 419 |
+
}
|
| 420 |
+
downloadLinks = downloadLinks.map(h => h.startsWith('http') ? h : new URL(h, url).href);
|
| 421 |
+
downloadLinks = [...new Set(downloadLinks)];
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
postText = `Titulo: ${title}\nEnlace original: ${url}\nAutor: ${author}\nEnlaces de descarga:\n`;
|
| 425 |
+
if (downloadLinks.length > 0) {
|
| 426 |
+
postText += downloadLinks.map((link, idx) => `(${idx + 1}) ${link}`).join('\n') + '\n\n';
|
| 427 |
+
outputWithLinks += postText;
|
| 428 |
+
hasLinksElements = true;
|
| 429 |
+
|
| 430 |
+
try {
|
| 431 |
+
const urlPath = new URL(url).pathname;
|
| 432 |
+
const cardAnchor = document.querySelector(`.post-card a[href="${urlPath}"]`) || document.querySelector(`.post-card a[href$="${urlPath}"]`);
|
| 433 |
+
if (cardAnchor) {
|
| 434 |
+
const card = cardAnchor.closest('.post-card');
|
| 435 |
+
if (card) {
|
| 436 |
+
card.classList.add('kemono-dl-success');
|
| 437 |
+
setTimeout(() => card.classList.remove('kemono-dl-success'), 150);
|
| 438 |
+
setTimeout(() => card.classList.add('kemono-dl-success'), 300);
|
| 439 |
+
}
|
| 440 |
+
}
|
| 441 |
+
} catch(e) {}
|
| 442 |
+
} else {
|
| 443 |
+
postText += "No hay enlaces detectados\n\n";
|
| 444 |
+
outputNoLinks += postText;
|
| 445 |
+
hasNoLinksElements = true;
|
| 446 |
+
}
|
| 447 |
+
} catch (err) {
|
| 448 |
+
let errorText = `ERROR AL CARGAR: ${url} -> ${err.message}\n\n`;
|
| 449 |
+
outputNoLinks += errorText;
|
| 450 |
+
hasNoLinksElements = true;
|
| 451 |
+
}
|
| 452 |
+
}
|
| 453 |
+
document.body.removeChild(iframe);
|
| 454 |
+
};
|
| 455 |
+
|
| 456 |
+
const workers = [];
|
| 457 |
+
for (let i = 0; i < CONCURRENCY_LIMIT; i++) {
|
| 458 |
+
workers.push((async () => {
|
| 459 |
+
await new Promise(r => setTimeout(r, i * 700));
|
| 460 |
+
await extractWorker(i);
|
| 461 |
+
})());
|
| 462 |
+
}
|
| 463 |
+
await Promise.all(workers);
|
| 464 |
+
|
| 465 |
+
copyBtn.textContent = 'Enviando a Descargas...';
|
| 466 |
+
|
| 467 |
+
chrome.runtime.sendMessage({
|
| 468 |
+
type: "START_NATIVE_TASK",
|
| 469 |
+
payload: {
|
| 470 |
+
type: "SAVE_KEMONO",
|
| 471 |
+
textLinks: hasLinksElements ? outputWithLinks : "",
|
| 472 |
+
textNoLinks: hasNoLinksElements ? outputNoLinks : ""
|
| 473 |
+
}
|
| 474 |
+
});
|
| 475 |
+
|
| 476 |
+
const onTaskUpdate = (msg) => {
|
| 477 |
+
const payload = msg.payload || msg;
|
| 478 |
+
if (payload && payload.type === "SAVE_KEMONO") {
|
| 479 |
+
if (payload.status === "done") {
|
| 480 |
+
copyBtn.textContent = '¡Guardado en Descargas!';
|
| 481 |
+
copyBtn.style.background = '#10b981';
|
| 482 |
+
|
| 483 |
+
selectedLinks.clear();
|
| 484 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 485 |
+
document.querySelectorAll('.kemono-dl-selector-selected').forEach(el => el.classList.remove('kemono-dl-selector-selected'));
|
| 486 |
+
|
| 487 |
+
setTimeout(() => {
|
| 488 |
+
copyBtn.textContent = ogText;
|
| 489 |
+
copyBtn.style.background = '#fbbf24';
|
| 490 |
+
copyBtn.style.color = '#000';
|
| 491 |
+
copyBtn.disabled = false;
|
| 492 |
+
}, 4000);
|
| 493 |
+
} else if (payload.status === "progress") {
|
| 494 |
+
if (payload.info) copyBtn.textContent = payload.info;
|
| 495 |
+
} else if (payload.status === "error") {
|
| 496 |
+
console.error("Native Error:", payload.error || payload.info);
|
| 497 |
+
copyBtn.textContent = payload.info || 'Error en Python';
|
| 498 |
+
copyBtn.style.background = '#ef4444';
|
| 499 |
+
setTimeout(() => {
|
| 500 |
+
copyBtn.textContent = ogText;
|
| 501 |
+
copyBtn.style.background = '#fbbf24';
|
| 502 |
+
copyBtn.style.color = '#000';
|
| 503 |
+
copyBtn.disabled = false;
|
| 504 |
+
}, 4000);
|
| 505 |
+
}
|
| 506 |
+
}
|
| 507 |
+
};
|
| 508 |
+
|
| 509 |
+
chrome.runtime.onMessage.addListener((msg) => {
|
| 510 |
+
if (msg.type === "TASK_UPDATE") {
|
| 511 |
+
onTaskUpdate(msg.payload);
|
| 512 |
+
}
|
| 513 |
+
});
|
| 514 |
+
|
| 515 |
+
} catch (err) {
|
| 516 |
+
copyBtn.textContent = 'Error inesperado';
|
| 517 |
+
copyBtn.style.background = '#ef4444';
|
| 518 |
+
copyBtn.style.color = '#fff';
|
| 519 |
+
console.error(err);
|
| 520 |
+
setTimeout(() => {
|
| 521 |
+
copyBtn.textContent = ogText;
|
| 522 |
+
copyBtn.style.background = '#fbbf24';
|
| 523 |
+
copyBtn.style.color = '#000';
|
| 524 |
+
copyBtn.disabled = false;
|
| 525 |
+
}, 3000);
|
| 526 |
+
}
|
| 527 |
+
};
|
| 528 |
+
|
| 529 |
+
finalCopyBtn.onclick = () => {};
|
| 530 |
+
|
| 531 |
+
closeBtn.onclick = () => {
|
| 532 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 533 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 534 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 535 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 536 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 537 |
+
document.removeEventListener('click', click, true);
|
| 538 |
+
container.remove();
|
| 539 |
+
style.remove();
|
| 540 |
+
document.querySelectorAll('.kemono-dl-selector-selected').forEach(el => el.classList.remove('kemono-dl-selector-selected'));
|
| 541 |
+
document.querySelectorAll('.kemono-dl-selector-hover').forEach(el => el.classList.remove('kemono-dl-selector-hover'));
|
| 542 |
+
window.__kemonoDownloadsActive = false;
|
| 543 |
+
};
|
| 544 |
+
})();
|
detector de enlaces - copia/src/kemono/images.js
ADDED
|
@@ -0,0 +1,546 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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atedLinks = [];
|
| 7 |
+
|
| 8 |
+
const container = document.createElement('div');
|
| 9 |
+
container.id = 'kemono-img-floating-ui';
|
| 10 |
+
container.style.cssText = `
|
| 11 |
+
position: fixed;
|
| 12 |
+
bottom: 20px;
|
| 13 |
+
right: 20px;
|
| 14 |
+
background: #18181b;
|
| 15 |
+
color: #fff;
|
| 16 |
+
padding: 15px;
|
| 17 |
+
border-radius: 10px;
|
| 18 |
+
border: 1px solid #27272a;
|
| 19 |
+
z-index: 999999;
|
| 20 |
+
font-family: sans-serif;
|
| 21 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 22 |
+
display: flex;
|
| 23 |
+
flex-direction: column;
|
| 24 |
+
gap: 10px;
|
| 25 |
+
min-width: 200px;
|
| 26 |
+
`;
|
| 27 |
+
|
| 28 |
+
const countDisplay = document.createElement('div');
|
| 29 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 30 |
+
countDisplay.style.fontWeight = 'bold';
|
| 31 |
+
countDisplay.style.textAlign = 'center';
|
| 32 |
+
countDisplay.style.fontSize = '14px';
|
| 33 |
+
|
| 34 |
+
const selectAllBtn = document.createElement('button');
|
| 35 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 36 |
+
selectAllBtn.style.cssText = `
|
| 37 |
+
background: #3f3f46;
|
| 38 |
+
color: white;
|
| 39 |
+
border: none;
|
| 40 |
+
padding: 8px;
|
| 41 |
+
border-radius: 6px;
|
| 42 |
+
cursor: pointer;
|
| 43 |
+
font-weight: 600;
|
| 44 |
+
font-size: 13px;
|
| 45 |
+
transition: background 0.2s;
|
| 46 |
+
`;
|
| 47 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 48 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 49 |
+
|
| 50 |
+
const copyBtn = document.createElement('button');
|
| 51 |
+
copyBtn.textContent = 'Procesar Imágenes';
|
| 52 |
+
copyBtn.style.cssText = `
|
| 53 |
+
background: #14b8a6;
|
| 54 |
+
color: #000;
|
| 55 |
+
border: none;
|
| 56 |
+
padding: 10px;
|
| 57 |
+
border-radius: 6px;
|
| 58 |
+
cursor: pointer;
|
| 59 |
+
font-weight: bold;
|
| 60 |
+
`;
|
| 61 |
+
|
| 62 |
+
const finalCopyBtn = document.createElement('button');
|
| 63 |
+
finalCopyBtn.textContent = 'Copiar Enlaces Procesados';
|
| 64 |
+
finalCopyBtn.style.cssText = `
|
| 65 |
+
background: #10b981;
|
| 66 |
+
color: #fff;
|
| 67 |
+
border: none;
|
| 68 |
+
padding: 10px;
|
| 69 |
+
border-radius: 6px;
|
| 70 |
+
cursor: pointer;
|
| 71 |
+
font-weight: bold;
|
| 72 |
+
display: none;
|
| 73 |
+
`;
|
| 74 |
+
|
| 75 |
+
const closeBtn = document.createElement('button');
|
| 76 |
+
closeBtn.id = 'kemono-img-close-btn';
|
| 77 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 78 |
+
closeBtn.style.cssText = `
|
| 79 |
+
background: #27272a;
|
| 80 |
+
color: white;
|
| 81 |
+
border: 1px solid #3f3f46;
|
| 82 |
+
padding: 8px;
|
| 83 |
+
border-radius: 6px;
|
| 84 |
+
cursor: pointer;
|
| 85 |
+
font-size: 13px;
|
| 86 |
+
`;
|
| 87 |
+
|
| 88 |
+
const uploadTxtBtn = document.createElement('button');
|
| 89 |
+
uploadTxtBtn.textContent = 'Cargar TXT';
|
| 90 |
+
uploadTxtBtn.style.cssText = `
|
| 91 |
+
background: #6366f1;
|
| 92 |
+
color: white;
|
| 93 |
+
border: none;
|
| 94 |
+
padding: 8px;
|
| 95 |
+
border-radius: 6px;
|
| 96 |
+
cursor: pointer;
|
| 97 |
+
font-weight: 600;
|
| 98 |
+
font-size: 13px;
|
| 99 |
+
transition: background 0.2s;
|
| 100 |
+
`;
|
| 101 |
+
uploadTxtBtn.onmouseover = () => uploadTxtBtn.style.background = '#4f46e5';
|
| 102 |
+
uploadTxtBtn.onmouseout = () => uploadTxtBtn.style.background = '#6366f1';
|
| 103 |
+
|
| 104 |
+
const fileInput = document.createElement('input');
|
| 105 |
+
fileInput.type = 'file';
|
| 106 |
+
fileInput.accept = '.txt';
|
| 107 |
+
fileInput.multiple = true;
|
| 108 |
+
fileInput.style.display = 'none';
|
| 109 |
+
|
| 110 |
+
uploadTxtBtn.onclick = () => fileInput.click();
|
| 111 |
+
|
| 112 |
+
fileInput.onchange = async (e) => {
|
| 113 |
+
const files = e.target.files;
|
| 114 |
+
if (!files || files.length === 0) return;
|
| 115 |
+
|
| 116 |
+
let totalAddedCount = 0;
|
| 117 |
+
|
| 118 |
+
for (let i = 0; i < files.length; i++) {
|
| 119 |
+
const text = await files[i].text();
|
| 120 |
+
const regex = /(https?:\/\/(kemono\.cr|kemono\.su|kemono\.party|pawchive\.st)\/[a-zA-Z0-9_-]+\/user\/[a-zA-Z0-9_-]+\/post\/[0-9]+)/gi;
|
| 121 |
+
let matches;
|
| 122 |
+
while ((matches = regex.exec(text)) !== null) {
|
| 123 |
+
const url = matches[0].split('?')[0];
|
| 124 |
+
if (!selectedLinks.has(url)) {
|
| 125 |
+
selectedLinks.add(url);
|
| 126 |
+
totalAddedCount++;
|
| 127 |
+
} else {
|
| 128 |
+
duplicatedLinks.push(url);
|
| 129 |
+
}
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 134 |
+
uploadTxtBtn.textContent = `+${totalAddedCount} Enlaces Agregados!`;
|
| 135 |
+
setTimeout(() => uploadTxtBtn.textContent = 'Cargar TXT', 3000);
|
| 136 |
+
};
|
| 137 |
+
|
| 138 |
+
container.appendChild(countDisplay);
|
| 139 |
+
container.appendChild(uploadTxtBtn);
|
| 140 |
+
container.appendChild(fileInput);
|
| 141 |
+
container.appendChild(selectAllBtn);
|
| 142 |
+
container.appendChild(copyBtn);
|
| 143 |
+
container.appendChild(finalCopyBtn);
|
| 144 |
+
container.appendChild(closeBtn);
|
| 145 |
+
document.body.appendChild(container);
|
| 146 |
+
|
| 147 |
+
const style = document.createElement('style');
|
| 148 |
+
style.id = 'kemono-img-style';
|
| 149 |
+
style.textContent = `
|
| 150 |
+
.kemono-img-selector-hover {
|
| 151 |
+
outline: 3px solid #14b8a6 !important;
|
| 152 |
+
cursor: crosshair !important;
|
| 153 |
+
transition: all 0.2s;
|
| 154 |
+
}
|
| 155 |
+
.kemono-img-selector-selected {
|
| 156 |
+
outline: 4px solid #0d9488 !important;
|
| 157 |
+
opacity: 0.8;
|
| 158 |
+
position: relative;
|
| 159 |
+
}
|
| 160 |
+
.kemono-img-selector-selected::after {
|
| 161 |
+
content: '✓';
|
| 162 |
+
position: absolute;
|
| 163 |
+
top: 10px;
|
| 164 |
+
right: 10px;
|
| 165 |
+
background: #0d9488;
|
| 166 |
+
color: white;
|
| 167 |
+
border-radius: 50%;
|
| 168 |
+
width: 30px;
|
| 169 |
+
height: 30px;
|
| 170 |
+
display: flex;
|
| 171 |
+
align-items: center;
|
| 172 |
+
justify-content: center;
|
| 173 |
+
font-weight: bold;
|
| 174 |
+
font-size: 16px;
|
| 175 |
+
z-index: 10;
|
| 176 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
|
| 177 |
+
}
|
| 178 |
+
.kemono-img-success::after {
|
| 179 |
+
background: #10b981 !important;
|
| 180 |
+
transform: scale(1.15);
|
| 181 |
+
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
|
| 182 |
+
}
|
| 183 |
+
`;
|
| 184 |
+
document.head.appendChild(style);
|
| 185 |
+
|
| 186 |
+
const getPostCard = (el) => el.closest('.post-card');
|
| 187 |
+
|
| 188 |
+
let isDragging = false;
|
| 189 |
+
let dragMode = null;
|
| 190 |
+
|
| 191 |
+
const mouseOver = (e) => {
|
| 192 |
+
const card = getPostCard(e.target);
|
| 193 |
+
if (card) {
|
| 194 |
+
if (isDragging) {
|
| 195 |
+
e.preventDefault();
|
| 196 |
+
e.stopPropagation();
|
| 197 |
+
|
| 198 |
+
const link = card.querySelector('a');
|
| 199 |
+
if (!link) return;
|
| 200 |
+
const url = link.href;
|
| 201 |
+
|
| 202 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 203 |
+
selectedLinks.add(url);
|
| 204 |
+
card.classList.add('kemono-img-selector-selected');
|
| 205 |
+
card.classList.remove('kemono-img-selector-hover');
|
| 206 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 207 |
+
selectedLinks.delete(url);
|
| 208 |
+
card.classList.remove('kemono-img-selector-selected');
|
| 209 |
+
}
|
| 210 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 211 |
+
} else {
|
| 212 |
+
if (!card.classList.contains('kemono-img-selector-selected')) {
|
| 213 |
+
card.classList.add('kemono-img-selector-hover');
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
};
|
| 218 |
+
|
| 219 |
+
const mouseOut = (e) => {
|
| 220 |
+
const card = getPostCard(e.target);
|
| 221 |
+
if (card) {
|
| 222 |
+
card.classList.remove('kemono-img-selector-hover');
|
| 223 |
+
}
|
| 224 |
+
};
|
| 225 |
+
|
| 226 |
+
const mouseDown = (e) => {
|
| 227 |
+
const card = getPostCard(e.target);
|
| 228 |
+
if (card) {
|
| 229 |
+
e.preventDefault();
|
| 230 |
+
isDragging = true;
|
| 231 |
+
|
| 232 |
+
const link = card.querySelector('a');
|
| 233 |
+
if (!link) return;
|
| 234 |
+
const url = link.href;
|
| 235 |
+
|
| 236 |
+
if (selectedLinks.has(url)) {
|
| 237 |
+
dragMode = 'deselect';
|
| 238 |
+
selectedLinks.delete(url);
|
| 239 |
+
card.classList.remove('kemono-img-selector-selected');
|
| 240 |
+
} else {
|
| 241 |
+
dragMode = 'select';
|
| 242 |
+
selectedLinks.add(url);
|
| 243 |
+
card.classList.add('kemono-img-selector-selected');
|
| 244 |
+
card.classList.remove('kemono-img-selector-hover');
|
| 245 |
+
}
|
| 246 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 247 |
+
}
|
| 248 |
+
};
|
| 249 |
+
|
| 250 |
+
const mouseUp = (e) => {
|
| 251 |
+
isDragging = false;
|
| 252 |
+
dragMode = null;
|
| 253 |
+
};
|
| 254 |
+
|
| 255 |
+
const dragStart = (e) => {
|
| 256 |
+
const card = getPostCard(e.target);
|
| 257 |
+
if (card) e.preventDefault();
|
| 258 |
+
};
|
| 259 |
+
|
| 260 |
+
const click = (e) => {
|
| 261 |
+
const card = getPostCard(e.target);
|
| 262 |
+
if (card) {
|
| 263 |
+
e.preventDefault();
|
| 264 |
+
e.stopPropagation();
|
| 265 |
+
}
|
| 266 |
+
};
|
| 267 |
+
|
| 268 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 269 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 270 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 271 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 272 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 273 |
+
document.addEventListener('click', click, true);
|
| 274 |
+
|
| 275 |
+
selectAllBtn.onclick = () => {
|
| 276 |
+
const cards = document.querySelectorAll('.post-card');
|
| 277 |
+
let allSelected = true;
|
| 278 |
+
|
| 279 |
+
cards.forEach(card => {
|
| 280 |
+
const link = card.querySelector('a');
|
| 281 |
+
if (link && !selectedLinks.has(link.href)) {
|
| 282 |
+
allSelected = false;
|
| 283 |
+
}
|
| 284 |
+
});
|
| 285 |
+
|
| 286 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 287 |
+
cards.forEach(card => {
|
| 288 |
+
card.classList.remove('kemono-img-selector-selected');
|
| 289 |
+
const link = card.querySelector('a');
|
| 290 |
+
if (link) selectedLinks.delete(link.href);
|
| 291 |
+
});
|
| 292 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 293 |
+
} else {
|
| 294 |
+
cards.forEach(card => {
|
| 295 |
+
const link = card.querySelector('a');
|
| 296 |
+
if (link && !selectedLinks.has(link.href)) {
|
| 297 |
+
selectedLinks.add(link.href);
|
| 298 |
+
card.classList.add('kemono-img-selector-selected');
|
| 299 |
+
card.classList.remove('kemono-img-selector-hover');
|
| 300 |
+
}
|
| 301 |
+
});
|
| 302 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 303 |
+
}
|
| 304 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 305 |
+
};
|
| 306 |
+
|
| 307 |
+
let wakeLockAudio = null;
|
| 308 |
+
|
| 309 |
+
copyBtn.onclick = async () => {
|
| 310 |
+
if (selectedLinks.size === 0) return;
|
| 311 |
+
const ogText = copyBtn.textContent;
|
| 312 |
+
|
| 313 |
+
try {
|
| 314 |
+
if (!wakeLockAudio) {
|
| 315 |
+
wakeLockAudio = document.createElement('audio');
|
| 316 |
+
wakeLockAudio.loop = true;
|
| 317 |
+
wakeLockAudio.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA';
|
| 318 |
+
wakeLockAudio.volume = 0.01;
|
| 319 |
+
wakeLockAudio.play().catch(()=>{});
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
copyBtn.textContent = 'Analizando en Navegador... 0%';
|
| 323 |
+
copyBtn.style.background = '#0d9488';
|
| 324 |
+
copyBtn.style.color = '#fff';
|
| 325 |
+
copyBtn.disabled = true;
|
| 326 |
+
finalCopyBtn.style.display = 'none';
|
| 327 |
+
|
| 328 |
+
const uniqueUrls = [...new Set([...selectedLinks].map(u => u.replace(/\/$/, '')))];
|
| 329 |
+
const total = uniqueUrls.length;
|
| 330 |
+
|
| 331 |
+
let extractionPayload = [];
|
| 332 |
+
|
| 333 |
+
let count = 0;
|
| 334 |
+
const CONCURRENCY_LIMIT = 16;
|
| 335 |
+
let queue = [...uniqueUrls];
|
| 336 |
+
|
| 337 |
+
const extractWorker = async (workerId) => {
|
| 338 |
+
let iframe = document.createElement('iframe');
|
| 339 |
+
iframe.id = `kemono-extractor-frame-${workerId}`;
|
| 340 |
+
iframe.style.width = '1px';
|
| 341 |
+
iframe.style.height = '1px';
|
| 342 |
+
iframe.style.opacity = '0';
|
| 343 |
+
iframe.style.pointerEvents = 'none';
|
| 344 |
+
iframe.style.position = 'fixed';
|
| 345 |
+
iframe.style.bottom = '0';
|
| 346 |
+
document.body.appendChild(iframe);
|
| 347 |
+
|
| 348 |
+
while (queue.length > 0) {
|
| 349 |
+
const url = queue.shift();
|
| 350 |
+
count++;
|
| 351 |
+
copyBtn.textContent = `Analizando páginas... ${Math.round((count/total)*100)}%`;
|
| 352 |
+
|
| 353 |
+
try {
|
| 354 |
+
let loaded = false;
|
| 355 |
+
iframe.onload = () => { loaded = true; };
|
| 356 |
+
iframe.src = url;
|
| 357 |
+
|
| 358 |
+
let waitTimer = 0;
|
| 359 |
+
while (!loaded && waitTimer < 15000) {
|
| 360 |
+
await new Promise(r => setTimeout(r, 200));
|
| 361 |
+
waitTimer += 200;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
await new Promise(r => setTimeout(r, 1200 + Math.random() * 500));
|
| 365 |
+
|
| 366 |
+
const doc = iframe.contentDocument;
|
| 367 |
+
if (!doc) throw new Error("Página inaccesible");
|
| 368 |
+
|
| 369 |
+
let titleEl = doc.querySelector('.post__title span') || doc.querySelector('.post__title') || doc.querySelector('h1');
|
| 370 |
+
let title = titleEl ? titleEl.innerText.trim() : 'Desconocido';
|
| 371 |
+
|
| 372 |
+
let authorEl = doc.querySelector('.post__user-name') || doc.querySelector('.post__author');
|
| 373 |
+
let author = authorEl ? authorEl.innerText.trim() : 'Desconocido';
|
| 374 |
+
|
| 375 |
+
let imageLinks = [];
|
| 376 |
+
const isImage = (str) => /\.(jpg|jpeg|png|webp|gif|avif)(\?|$|\w)/i.test(str || '');
|
| 377 |
+
|
| 378 |
+
doc.querySelectorAll('a.post__attachment-link, .post__attachment a, a.fileThumb, .post__thumbnail a, a[download]').forEach(a => {
|
| 379 |
+
let href = a.getAttribute('href');
|
| 380 |
+
let name = a.getAttribute('download') || a.innerText.trim();
|
| 381 |
+
if (isImage(href) || isImage(name)) {
|
| 382 |
+
if (!href.startsWith('http')) href = new URL(href, url).href;
|
| 383 |
+
href = href.replace(/\/thumbnail\//g, '/');
|
| 384 |
+
imageLinks.push(href);
|
| 385 |
+
}
|
| 386 |
+
});
|
| 387 |
+
|
| 388 |
+
doc.querySelectorAll('.post__content img, .post__body img, .post__content a, .post__body a').forEach(el => {
|
| 389 |
+
let src = el.getAttribute('src') || el.getAttribute('href');
|
| 390 |
+
if (isImage(src)) {
|
| 391 |
+
if (!src.startsWith('http')) src = new URL(src, url).href;
|
| 392 |
+
src = src.replace(/\/thumbnail\//g, '/');
|
| 393 |
+
imageLinks.push(src);
|
| 394 |
+
}
|
| 395 |
+
});
|
| 396 |
+
|
| 397 |
+
imageLinks = [...new Set(imageLinks)];
|
| 398 |
+
|
| 399 |
+
if (imageLinks.length === 0) {
|
| 400 |
+
let scripts = Array.from(doc.querySelectorAll('script'));
|
| 401 |
+
for(let s of scripts) {
|
| 402 |
+
if (s.innerText.includes('postData') || s.innerText.includes('__NUXT__')) {
|
| 403 |
+
let jsonMatch = s.innerText.match(/(https?:\/\/[^\s<"'\\]+)/g) || [];
|
| 404 |
+
let localMatch = s.innerText.match(/(\/data\/[^\s<"'\\]+)/g) || [];
|
| 405 |
+
|
| 406 |
+
let allMatches = [...jsonMatch, ...localMatch];
|
| 407 |
+
allMatches.forEach(href => {
|
| 408 |
+
try {
|
| 409 |
+
let cleanHref = href.replace(/\\u0026/g, '&');
|
| 410 |
+
if (isImage(cleanHref)) {
|
| 411 |
+
if (!cleanHref.startsWith('http')) cleanHref = new URL(cleanHref, url).href;
|
| 412 |
+
cleanHref = cleanHref.replace(/\/thumbnail\//g, '/');
|
| 413 |
+
imageLinks.push(cleanHref);
|
| 414 |
+
}
|
| 415 |
+
} catch(e) {}
|
| 416 |
+
});
|
| 417 |
+
}
|
| 418 |
+
}
|
| 419 |
+
imageLinks = [...new Set(imageLinks)];
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
if (imageLinks.length > 0) {
|
| 423 |
+
extractionPayload.push({
|
| 424 |
+
url: url,
|
| 425 |
+
title: title,
|
| 426 |
+
author: author,
|
| 427 |
+
images: imageLinks,
|
| 428 |
+
isDuplicate: false
|
| 429 |
+
});
|
| 430 |
+
|
| 431 |
+
try {
|
| 432 |
+
const urlPath = new URL(url).pathname;
|
| 433 |
+
const cardAnchor = document.querySelector(`.post-card a[href="${urlPath}"]`) || document.querySelector(`.post-card a[href$="${urlPath}"]`);
|
| 434 |
+
if (cardAnchor) {
|
| 435 |
+
const card = cardAnchor.closest('.post-card');
|
| 436 |
+
if (card) {
|
| 437 |
+
card.classList.add('kemono-img-success');
|
| 438 |
+
setTimeout(() => card.classList.remove('kemono-img-success'), 150);
|
| 439 |
+
setTimeout(() => card.classList.add('kemono-img-success'), 300);
|
| 440 |
+
}
|
| 441 |
+
}
|
| 442 |
+
} catch(e) {}
|
| 443 |
+
}
|
| 444 |
+
} catch (err) {
|
| 445 |
+
console.error("Error cargando " + url, err);
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
document.body.removeChild(iframe);
|
| 449 |
+
};
|
| 450 |
+
|
| 451 |
+
const workers = [];
|
| 452 |
+
for (let i = 0; i < CONCURRENCY_LIMIT; i++) {
|
| 453 |
+
workers.push((async () => {
|
| 454 |
+
await new Promise(r => setTimeout(r, i * 700));
|
| 455 |
+
await extractWorker(i);
|
| 456 |
+
})());
|
| 457 |
+
}
|
| 458 |
+
await Promise.all(workers);
|
| 459 |
+
|
| 460 |
+
copyBtn.textContent = 'Enviando a Descargas...';
|
| 461 |
+
|
| 462 |
+
chrome.runtime.sendMessage({
|
| 463 |
+
type: "START_NATIVE_TASK",
|
| 464 |
+
payload: {
|
| 465 |
+
type: "DOWNLOAD_IMAGES_KEMONO",
|
| 466 |
+
data: extractionPayload
|
| 467 |
+
}
|
| 468 |
+
});
|
| 469 |
+
|
| 470 |
+
const onTaskUpdate = (msg) => {
|
| 471 |
+
const payload = msg.payload || msg;
|
| 472 |
+
if (payload && payload.type === "DOWNLOAD_IMAGES_KEMONO") {
|
| 473 |
+
if (payload.status === "done") {
|
| 474 |
+
copyBtn.textContent = '¡Enviado a Descargar Imágenes!';
|
| 475 |
+
copyBtn.style.background = '#10b981';
|
| 476 |
+
|
| 477 |
+
selectedLinks.clear();
|
| 478 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 479 |
+
document.querySelectorAll('.kemono-img-selector-selected').forEach(el => el.classList.remove('kemono-img-selector-selected'));
|
| 480 |
+
|
| 481 |
+
setTimeout(() => {
|
| 482 |
+
copyBtn.textContent = ogText;
|
| 483 |
+
copyBtn.style.background = '#14b8a6';
|
| 484 |
+
copyBtn.style.color = '#000';
|
| 485 |
+
copyBtn.disabled = false;
|
| 486 |
+
}, 4000);
|
| 487 |
+
if (wakeLockAudio) { wakeLockAudio.pause(); wakeLockAudio.remove(); wakeLockAudio = null; }
|
| 488 |
+
} else if (payload.status === "progress") {
|
| 489 |
+
if (payload.info) {
|
| 490 |
+
copyBtn.textContent = payload.info;
|
| 491 |
+
} else if (payload.current) {
|
| 492 |
+
copyBtn.textContent = `Procesando ${payload.current}/${payload.total}...`;
|
| 493 |
+
}
|
| 494 |
+
} else if (payload.status === "error") {
|
| 495 |
+
console.error("Native Error:", payload.error || payload.info);
|
| 496 |
+
copyBtn.textContent = payload.info || 'Error en Python';
|
| 497 |
+
copyBtn.style.background = '#ef4444';
|
| 498 |
+
setTimeout(() => {
|
| 499 |
+
copyBtn.textContent = ogText;
|
| 500 |
+
copyBtn.style.background = '#14b8a6';
|
| 501 |
+
copyBtn.style.color = '#000';
|
| 502 |
+
copyBtn.disabled = false;
|
| 503 |
+
}, 4000);
|
| 504 |
+
if (wakeLockAudio) { wakeLockAudio.pause(); wakeLockAudio.remove(); wakeLockAudio = null; }
|
| 505 |
+
}
|
| 506 |
+
}
|
| 507 |
+
};
|
| 508 |
+
|
| 509 |
+
chrome.runtime.onMessage.addListener((msg) => {
|
| 510 |
+
if (msg.type === "TASK_UPDATE") {
|
| 511 |
+
onTaskUpdate(msg.payload);
|
| 512 |
+
}
|
| 513 |
+
});
|
| 514 |
+
|
| 515 |
+
} catch (err) {
|
| 516 |
+
copyBtn.textContent = 'Error inesperado';
|
| 517 |
+
copyBtn.style.background = '#ef4444';
|
| 518 |
+
copyBtn.style.color = '#fff';
|
| 519 |
+
console.error(err);
|
| 520 |
+
setTimeout(() => {
|
| 521 |
+
copyBtn.textContent = ogText;
|
| 522 |
+
copyBtn.style.background = '#14b8a6';
|
| 523 |
+
copyBtn.style.color = '#000';
|
| 524 |
+
copyBtn.disabled = false;
|
| 525 |
+
}, 3000);
|
| 526 |
+
if (wakeLockAudio) { wakeLockAudio.pause(); wakeLockAudio.remove(); wakeLockAudio = null; }
|
| 527 |
+
}
|
| 528 |
+
};
|
| 529 |
+
|
| 530 |
+
finalCopyBtn.onclick = () => {};
|
| 531 |
+
|
| 532 |
+
closeBtn.onclick = () => {
|
| 533 |
+
if (wakeLockAudio) { wakeLockAudio.pause(); wakeLockAudio.remove(); wakeLockAudio = null; }
|
| 534 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 535 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 536 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 537 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 538 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 539 |
+
document.removeEventListener('click', click, true);
|
| 540 |
+
container.remove();
|
| 541 |
+
style.remove();
|
| 542 |
+
document.querySelectorAll('.kemono-img-selector-selected').forEach(el => el.classList.remove('kemono-img-selector-selected'));
|
| 543 |
+
document.querySelectorAll('.kemono-img-selector-hover').forEach(el => el.classList.remove('kemono-img-selector-hover'));
|
| 544 |
+
window.__kem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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (document.getElementById('kemono-floating-ui')) return;
|
| 3 |
+
window.__kemonoSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'kemono-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const copyBtn = document.createElement('button');
|
| 34 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 35 |
+
copyBtn.style.cssText = `
|
| 36 |
+
background: #8b5cf6;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 10px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: bold;
|
| 43 |
+
`;
|
| 44 |
+
|
| 45 |
+
const selectAllBtn = document.createElement('button');
|
| 46 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 47 |
+
selectAllBtn.style.cssText = `
|
| 48 |
+
background: #3f3f46;
|
| 49 |
+
color: white;
|
| 50 |
+
border: none;
|
| 51 |
+
padding: 8px;
|
| 52 |
+
border-radius: 6px;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
font-weight: 600;
|
| 55 |
+
font-size: 13px;
|
| 56 |
+
transition: background 0.2s;
|
| 57 |
+
`;
|
| 58 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 59 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 60 |
+
|
| 61 |
+
const closeBtn = document.createElement('button');
|
| 62 |
+
closeBtn.id = 'kemono-close-btn';
|
| 63 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 64 |
+
closeBtn.style.cssText = `
|
| 65 |
+
background: #27272a;
|
| 66 |
+
color: white;
|
| 67 |
+
border: 1px solid #3f3f46;
|
| 68 |
+
padding: 8px;
|
| 69 |
+
border-radius: 6px;
|
| 70 |
+
cursor: pointer;
|
| 71 |
+
font-size: 13px;
|
| 72 |
+
`;
|
| 73 |
+
|
| 74 |
+
container.appendChild(countDisplay);
|
| 75 |
+
container.appendChild(selectAllBtn);
|
| 76 |
+
container.appendChild(copyBtn);
|
| 77 |
+
container.appendChild(closeBtn);
|
| 78 |
+
document.body.appendChild(container);
|
| 79 |
+
|
| 80 |
+
const style = document.createElement('style');
|
| 81 |
+
style.id = 'kemono-style';
|
| 82 |
+
style.textContent = `
|
| 83 |
+
.kemono-selector-hover {
|
| 84 |
+
outline: 3px solid #8b5cf6 !important;
|
| 85 |
+
cursor: crosshair !important;
|
| 86 |
+
transition: all 0.2s;
|
| 87 |
+
}
|
| 88 |
+
.kemono-selector-selected {
|
| 89 |
+
outline: 4px solid #10b981 !important;
|
| 90 |
+
opacity: 0.8;
|
| 91 |
+
position: relative;
|
| 92 |
+
}
|
| 93 |
+
.kemono-selector-selected::after {
|
| 94 |
+
content: '✓';
|
| 95 |
+
position: absolute;
|
| 96 |
+
top: 10px;
|
| 97 |
+
right: 10px;
|
| 98 |
+
background: #10b981;
|
| 99 |
+
color: white;
|
| 100 |
+
border-radius: 50%;
|
| 101 |
+
width: 30px;
|
| 102 |
+
height: 30px;
|
| 103 |
+
display: flex;
|
| 104 |
+
align-items: center;
|
| 105 |
+
justify-content: center;
|
| 106 |
+
font-weight: bold;
|
| 107 |
+
font-size: 16px;
|
| 108 |
+
z-index: 10;
|
| 109 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
|
| 110 |
+
}
|
| 111 |
+
.kemono-selector-selected a {
|
| 112 |
+
pointer-events: none;
|
| 113 |
+
}
|
| 114 |
+
`;
|
| 115 |
+
document.head.appendChild(style);
|
| 116 |
+
|
| 117 |
+
const getPostCard = (el) => el.closest('.post-card');
|
| 118 |
+
|
| 119 |
+
let isDragging = false;
|
| 120 |
+
let dragMode = null; // 'select' o 'deselect'
|
| 121 |
+
|
| 122 |
+
const mouseOver = (e) => {
|
| 123 |
+
const card = getPostCard(e.target);
|
| 124 |
+
if (card) {
|
| 125 |
+
if (isDragging) {
|
| 126 |
+
e.preventDefault();
|
| 127 |
+
e.stopPropagation();
|
| 128 |
+
|
| 129 |
+
const link = card.querySelector('a');
|
| 130 |
+
if (!link) return;
|
| 131 |
+
const url = link.href;
|
| 132 |
+
|
| 133 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 134 |
+
selectedLinks.add(url);
|
| 135 |
+
card.classList.add('kemono-selector-selected');
|
| 136 |
+
card.classList.remove('kemono-selector-hover');
|
| 137 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 138 |
+
selectedLinks.delete(url);
|
| 139 |
+
card.classList.remove('kemono-selector-selected');
|
| 140 |
+
}
|
| 141 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 142 |
+
} else {
|
| 143 |
+
if (!card.classList.contains('kemono-selector-selected')) {
|
| 144 |
+
card.classList.add('kemono-selector-hover');
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
};
|
| 149 |
+
|
| 150 |
+
const mouseOut = (e) => {
|
| 151 |
+
const card = getPostCard(e.target);
|
| 152 |
+
if (card) {
|
| 153 |
+
card.classList.remove('kemono-selector-hover');
|
| 154 |
+
}
|
| 155 |
+
};
|
| 156 |
+
|
| 157 |
+
const mouseDown = (e) => {
|
| 158 |
+
const card = getPostCard(e.target);
|
| 159 |
+
if (card) {
|
| 160 |
+
e.preventDefault(); // Evita arrastrar la imagen por defecto del navegador
|
| 161 |
+
isDragging = true;
|
| 162 |
+
|
| 163 |
+
const link = card.querySelector('a');
|
| 164 |
+
if (!link) return;
|
| 165 |
+
const url = link.href;
|
| 166 |
+
|
| 167 |
+
if (selectedLinks.has(url)) {
|
| 168 |
+
dragMode = 'deselect';
|
| 169 |
+
selectedLinks.delete(url);
|
| 170 |
+
card.classList.remove('kemono-selector-selected');
|
| 171 |
+
} else {
|
| 172 |
+
dragMode = 'select';
|
| 173 |
+
selectedLinks.add(url);
|
| 174 |
+
card.classList.add('kemono-selector-selected');
|
| 175 |
+
card.classList.remove('kemono-selector-hover');
|
| 176 |
+
}
|
| 177 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 178 |
+
}
|
| 179 |
+
};
|
| 180 |
+
|
| 181 |
+
const mouseUp = (e) => {
|
| 182 |
+
isDragging = false;
|
| 183 |
+
dragMode = null;
|
| 184 |
+
};
|
| 185 |
+
|
| 186 |
+
const dragStart = (e) => {
|
| 187 |
+
const card = getPostCard(e.target);
|
| 188 |
+
if (card) e.preventDefault();
|
| 189 |
+
};
|
| 190 |
+
|
| 191 |
+
const click = (e) => {
|
| 192 |
+
const card = getPostCard(e.target);
|
| 193 |
+
if (card) {
|
| 194 |
+
e.preventDefault(); // Evita saltar al enlace de kemono
|
| 195 |
+
e.stopPropagation();
|
| 196 |
+
}
|
| 197 |
+
};
|
| 198 |
+
|
| 199 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 200 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 201 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 202 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 203 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 204 |
+
document.addEventListener('click', click, true);
|
| 205 |
+
|
| 206 |
+
selectAllBtn.onclick = () => {
|
| 207 |
+
const cards = document.querySelectorAll('.post-card');
|
| 208 |
+
let allSelected = true;
|
| 209 |
+
|
| 210 |
+
cards.forEach(card => {
|
| 211 |
+
const link = card.querySelector('a');
|
| 212 |
+
if (link && !selectedLinks.has(link.href)) {
|
| 213 |
+
allSelected = false;
|
| 214 |
+
}
|
| 215 |
+
});
|
| 216 |
+
|
| 217 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 218 |
+
cards.forEach(card => {
|
| 219 |
+
card.classList.remove('kemono-selector-selected');
|
| 220 |
+
const link = card.querySelector('a');
|
| 221 |
+
if (link) selectedLinks.delete(link.href);
|
| 222 |
+
});
|
| 223 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 224 |
+
} else {
|
| 225 |
+
cards.forEach(card => {
|
| 226 |
+
const link = card.querySelector('a');
|
| 227 |
+
if (link && !selectedLinks.has(link.href)) {
|
| 228 |
+
selectedLinks.add(link.href);
|
| 229 |
+
card.classList.add('kemono-selector-selected');
|
| 230 |
+
card.classList.remove('kemono-selector-hover');
|
| 231 |
+
}
|
| 232 |
+
});
|
| 233 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 234 |
+
}
|
| 235 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 236 |
+
};
|
| 237 |
+
|
| 238 |
+
copyBtn.onclick = () => {
|
| 239 |
+
if (selectedLinks.size === 0) return;
|
| 240 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 241 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 242 |
+
const ogText = copyBtn.textContent;
|
| 243 |
+
copyBtn.textContent = '¡Copiados!';
|
| 244 |
+
copyBtn.style.background = '#10b981';
|
| 245 |
+
setTimeout(() => {
|
| 246 |
+
copyBtn.textContent = ogText;
|
| 247 |
+
copyBtn.style.background = '#8b5cf6';
|
| 248 |
+
}, 2000);
|
| 249 |
+
});
|
| 250 |
+
};
|
| 251 |
+
|
| 252 |
+
closeBtn.onclick = () => {
|
| 253 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 254 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 255 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 256 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 257 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 258 |
+
document.removeEventListener('click', click, true);
|
| 259 |
+
container.remove();
|
| 260 |
+
style.remove();
|
| 261 |
+
document.querySelectorAll('.kemono-selector-selected').forEach(el => el.classList.remove('kemono-selector-selected'));
|
| 262 |
+
document.querySelectorAll('.kemono-selector-hover').forEach(el => el.classList.remove('kemono-selector-hover'));
|
| 263 |
+
window.__kemonoSelectorActive = false;
|
| 264 |
+
|
| 265 |
+
window.dispatchEvent(new Event('KEMONO_OFF'));
|
| 266 |
+
};
|
| 267 |
+
})();
|
detector de enlaces - copia/src/ladys/quick_scan.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
try {
|
| 3 |
+
const videoCards = document.querySelectorAll('#profile-public-tabs-tabpane-videos .c-b_cq, .c-b_cq');
|
| 4 |
+
const results = [];
|
| 5 |
+
const seenUrls = new Set();
|
| 6 |
+
|
| 7 |
+
videoCards.forEach(card => {
|
| 8 |
+
const titleLink = card.querySelector('a.c-b_ct');
|
| 9 |
+
const video = card.querySelector('video');
|
| 10 |
+
|
| 11 |
+
let videoUrl = '';
|
| 12 |
+
let thumbnailUrl = '';
|
| 13 |
+
let videoTitle = titleLink ? titleLink.innerText.trim() : '';
|
| 14 |
+
|
| 15 |
+
if (video) {
|
| 16 |
+
const contentMeta = video.querySelector('meta[itemprop="contentUrl"]');
|
| 17 |
+
const thumbMeta = video.querySelector('meta[itemprop="thumbnailUrl"]');
|
| 18 |
+
const nameMeta = video.querySelector('meta[itemprop="name"]');
|
| 19 |
+
|
| 20 |
+
if (contentMeta) videoUrl = contentMeta.getAttribute('content');
|
| 21 |
+
if (thumbMeta) thumbnailUrl = thumbMeta.getAttribute('content');
|
| 22 |
+
if (nameMeta && !videoTitle) videoTitle = nameMeta.getAttribute('content');
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
// If no video tag with microdata, look for any video source or direct mp4 links in card
|
| 26 |
+
if (!videoUrl && video) {
|
| 27 |
+
if (video.src && !video.src.startsWith('blob:')) videoUrl = video.src;
|
| 28 |
+
video.querySelectorAll('source').forEach(s => {
|
| 29 |
+
if (s.src && !s.src.startsWith('blob:')) videoUrl = s.src;
|
| 30 |
+
});
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
// Fallback for title if still empty
|
| 34 |
+
if (!videoTitle && card.innerText) {
|
| 35 |
+
videoTitle = card.innerText.split('\n')[0].trim();
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
if (videoUrl && !seenUrls.has(videoUrl)) {
|
| 39 |
+
seenUrls.add(videoUrl);
|
| 40 |
+
results.push({
|
| 41 |
+
title: videoTitle || "Video de Ladys.one",
|
| 42 |
+
videoUrl: videoUrl,
|
| 43 |
+
thumbnailUrl: thumbnailUrl,
|
| 44 |
+
postUrl: titleLink ? titleLink.href : window.location.href
|
| 45 |
+
});
|
| 46 |
+
}
|
| 47 |
+
});
|
| 48 |
+
|
| 49 |
+
// General fallback search for page if no cards found
|
| 50 |
+
if (results.length === 0) {
|
| 51 |
+
document.querySelectorAll('meta[itemprop="contentUrl"]').forEach(meta => {
|
| 52 |
+
const videoUrl = meta.getAttribute('content');
|
| 53 |
+
if (videoUrl && videoUrl.includes('.mp4') && !seenUrls.has(videoUrl)) {
|
| 54 |
+
seenUrls.add(videoUrl);
|
| 55 |
+
|
| 56 |
+
// Try to find parent/nearby title
|
| 57 |
+
let videoTitle = "Video de Ladys.one";
|
| 58 |
+
const parentCard = meta.closest('.c-b_cq') || meta.parentElement;
|
| 59 |
+
if (parentCard) {
|
| 60 |
+
const titleLink = parentCard.querySelector('a.c-b_ct');
|
| 61 |
+
if (titleLink) videoTitle = titleLink.innerText.trim();
|
| 62 |
+
else {
|
| 63 |
+
const nameMeta = parentCard.querySelector('meta[itemprop="name"]');
|
| 64 |
+
if (nameMeta) videoTitle = nameMeta.getAttribute('content');
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
results.push({
|
| 69 |
+
title: videoTitle,
|
| 70 |
+
videoUrl: videoUrl,
|
| 71 |
+
thumbnailUrl: '',
|
| 72 |
+
postUrl: window.location.href
|
| 73 |
+
});
|
| 74 |
+
}
|
| 75 |
+
});
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
return { videos: results };
|
| 79 |
+
} catch(e) {
|
| 80 |
+
return { error: e.message };
|
| 81 |
+
}
|
| 82 |
+
})();
|
detector de enlaces - copia/src/leakgallery/quick_scan.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
try {
|
| 3 |
+
const mediaElements = document.querySelectorAll('#scroller .media-content, .media-content');
|
| 4 |
+
const results = [];
|
| 5 |
+
mediaElements.forEach(el => {
|
| 6 |
+
// Only include videos: must have play icon
|
| 7 |
+
const hasPlayIcon = !!el.querySelector('#play') || el.innerHTML.includes('icon-play.svg') || el.innerHTML.includes('logo/icon-play');
|
| 8 |
+
if (!hasPlayIcon) return;
|
| 9 |
+
|
| 10 |
+
const detailPath = el.getAttribute('href');
|
| 11 |
+
if (!detailPath) return;
|
| 12 |
+
|
| 13 |
+
const postUrl = detailPath.startsWith('http') ? detailPath : (window.location.origin + detailPath);
|
| 14 |
+
const thumbImg = el.querySelector('.thumbnail-container img') || el.querySelector('img');
|
| 15 |
+
|
| 16 |
+
// Generate a placeholder title since cards may not have text titles on profile view
|
| 17 |
+
const postId = detailPath.split('/').pop() || '';
|
| 18 |
+
const title = "Video #" + postId;
|
| 19 |
+
|
| 20 |
+
results.push({
|
| 21 |
+
title: title,
|
| 22 |
+
postUrl: postUrl,
|
| 23 |
+
thumbnailUrl: thumbImg ? thumbImg.src : ''
|
| 24 |
+
});
|
| 25 |
+
});
|
| 26 |
+
return { videos: results };
|
| 27 |
+
} catch(e) {
|
| 28 |
+
return { error: e.message };
|
| 29 |
+
}
|
| 30 |
+
})();
|
detector de enlaces - copia/src/pornhub/selector.js
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (document.getElementById('pornhub-floating-ui')) return;
|
| 3 |
+
window.__pornhubSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'pornhub-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 16px;
|
| 16 |
+
border-radius: 12px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 2147483647;
|
| 19 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
| 20 |
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 220px;
|
| 25 |
+
user-select: none;
|
| 26 |
+
`;
|
| 27 |
+
|
| 28 |
+
const countDisplay = document.createElement('div');
|
| 29 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 30 |
+
countDisplay.style.cssText = `
|
| 31 |
+
font-weight: 700;
|
| 32 |
+
text-align: center;
|
| 33 |
+
font-size: 15px;
|
| 34 |
+
color: #ffffff;
|
| 35 |
+
margin-bottom: 2px;
|
| 36 |
+
`;
|
| 37 |
+
|
| 38 |
+
const selectAllBtn = document.createElement('button');
|
| 39 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 40 |
+
selectAllBtn.style.cssText = `
|
| 41 |
+
background: #3f3f46;
|
| 42 |
+
color: #ffffff;
|
| 43 |
+
border: none;
|
| 44 |
+
padding: 9px 12px;
|
| 45 |
+
border-radius: 8px;
|
| 46 |
+
cursor: pointer;
|
| 47 |
+
font-weight: 600;
|
| 48 |
+
font-size: 13.5px;
|
| 49 |
+
transition: background 0.2s ease;
|
| 50 |
+
`;
|
| 51 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 52 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 53 |
+
|
| 54 |
+
const copyBtn = document.createElement('button');
|
| 55 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 56 |
+
copyBtn.style.cssText = `
|
| 57 |
+
background: #ff9000;
|
| 58 |
+
color: #ffffff;
|
| 59 |
+
border: none;
|
| 60 |
+
padding: 11px 16px;
|
| 61 |
+
border-radius: 8px;
|
| 62 |
+
cursor: pointer;
|
| 63 |
+
font-weight: 700;
|
| 64 |
+
font-size: 15px;
|
| 65 |
+
transition: background 0.2s ease, transform 0.1s ease;
|
| 66 |
+
`;
|
| 67 |
+
copyBtn.onmouseover = () => copyBtn.style.background = '#e68200';
|
| 68 |
+
copyBtn.onmouseout = () => copyBtn.style.background = '#ff9000';
|
| 69 |
+
|
| 70 |
+
const closeBtn = document.createElement('button');
|
| 71 |
+
closeBtn.id = 'pornhub-close-btn';
|
| 72 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 73 |
+
closeBtn.style.cssText = `
|
| 74 |
+
background: #27272a;
|
| 75 |
+
color: #e4e4e7;
|
| 76 |
+
border: 1px solid #3f3f46;
|
| 77 |
+
padding: 8px 12px;
|
| 78 |
+
border-radius: 8px;
|
| 79 |
+
cursor: pointer;
|
| 80 |
+
font-weight: 500;
|
| 81 |
+
font-size: 13px;
|
| 82 |
+
transition: background 0.2s ease;
|
| 83 |
+
`;
|
| 84 |
+
closeBtn.onmouseover = () => closeBtn.style.background = '#3f3f46';
|
| 85 |
+
closeBtn.onmouseout = () => closeBtn.style.background = '#27272a';
|
| 86 |
+
|
| 87 |
+
container.appendChild(countDisplay);
|
| 88 |
+
container.appendChild(selectAllBtn);
|
| 89 |
+
container.appendChild(copyBtn);
|
| 90 |
+
container.appendChild(closeBtn);
|
| 91 |
+
(document.body || document.documentElement).appendChild(container);
|
| 92 |
+
|
| 93 |
+
const style = document.createElement('style');
|
| 94 |
+
style.id = 'pornhub-selector-style';
|
| 95 |
+
style.textContent = `
|
| 96 |
+
.pornhub-selector-hover {
|
| 97 |
+
box-shadow: inset 0 0 0 4px #ff9000 !important, 0 0 12px rgba(255, 144, 0, 0.6) !important;
|
| 98 |
+
cursor: crosshair !important;
|
| 99 |
+
transition: all 0.15s ease;
|
| 100 |
+
position: relative !important;
|
| 101 |
+
z-index: 9999 !important;
|
| 102 |
+
}
|
| 103 |
+
.pornhub-selector-selected {
|
| 104 |
+
box-shadow: inset 0 0 0 4px #10b981 !important, 0 0 15px rgba(16, 185, 129, 0.7) !important;
|
| 105 |
+
outline: 4px solid #10b981 !important;
|
| 106 |
+
outline-offset: -4px !important;
|
| 107 |
+
position: relative !important;
|
| 108 |
+
z-index: 9998 !important;
|
| 109 |
+
}
|
| 110 |
+
.pornhub-selector-selected::after,
|
| 111 |
+
.pornhub-selector-selected:hover::after {
|
| 112 |
+
content: '✓' !important;
|
| 113 |
+
position: absolute !important;
|
| 114 |
+
top: 8px !important;
|
| 115 |
+
left: 8px !important;
|
| 116 |
+
background: #10b981 !important;
|
| 117 |
+
color: white !important;
|
| 118 |
+
border-radius: 50% !important;
|
| 119 |
+
width: 28px !important;
|
| 120 |
+
height: 28px !important;
|
| 121 |
+
display: flex !important;
|
| 122 |
+
align-items: center !important;
|
| 123 |
+
justify-content: center !important;
|
| 124 |
+
font-weight: bold !important;
|
| 125 |
+
font-size: 16px !important;
|
| 126 |
+
z-index: 2147483647 !important;
|
| 127 |
+
box-shadow: 0 2px 6px rgba(0,0,0,0.6) !important;
|
| 128 |
+
pointer-events: none !important;
|
| 129 |
+
}
|
| 130 |
+
`;
|
| 131 |
+
(document.head || document.documentElement).appendChild(style);
|
| 132 |
+
|
| 133 |
+
// Helper to extract clean video URL from Pornhub anchor or string
|
| 134 |
+
const getCleanUrl = (hrefOrAnchor) => {
|
| 135 |
+
if (!hrefOrAnchor) return '';
|
| 136 |
+
let raw = typeof hrefOrAnchor === 'string' ? hrefOrAnchor : (hrefOrAnchor.href || hrefOrAnchor.getAttribute('href') || '');
|
| 137 |
+
if (!raw) return '';
|
| 138 |
+
try {
|
| 139 |
+
const match = raw.match(/view_video\.php\?viewkey=([a-zA-Z0-9]+)/i);
|
| 140 |
+
if (match && match[1]) {
|
| 141 |
+
const origin = window.location.origin && window.location.origin.includes('pornhub.com')
|
| 142 |
+
? window.location.origin
|
| 143 |
+
: 'https://es.pornhub.com';
|
| 144 |
+
return `${origin}/view_video.php?viewkey=${match[1]}`;
|
| 145 |
+
}
|
| 146 |
+
return '';
|
| 147 |
+
} catch(e) {
|
| 148 |
+
return '';
|
| 149 |
+
}
|
| 150 |
+
};
|
| 151 |
+
|
| 152 |
+
const isVideoUrl = (url) => {
|
| 153 |
+
return !!url && url.includes('view_video.php?viewkey=');
|
| 154 |
+
};
|
| 155 |
+
|
| 156 |
+
// Find the enclosing video card container or anchor on Pornhub
|
| 157 |
+
const getPostCard = (el) => {
|
| 158 |
+
if (!el || el.closest('#pornhub-floating-ui')) return null;
|
| 159 |
+
|
| 160 |
+
// Check if el or ancestor is inside a video card element
|
| 161 |
+
const card = el.closest('li.videoblock, .pcVideoListItem, .videoBox, .phimage, li[data-video-vkey], div[data-video-vkey], .b-model-videos__item, .video-card, [data-vkey], .wrapper');
|
| 162 |
+
|
| 163 |
+
let anchor = el.closest('a');
|
| 164 |
+
if (!anchor && card) {
|
| 165 |
+
anchor = card.querySelector('a[href*="view_video.php"]');
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
if (!anchor) return null;
|
| 169 |
+
|
| 170 |
+
const url = getCleanUrl(anchor);
|
| 171 |
+
if (!isVideoUrl(url)) return null;
|
| 172 |
+
|
| 173 |
+
const finalCard = card || anchor.closest('li, .phimage, .videoBox') || anchor;
|
| 174 |
+
|
| 175 |
+
return { card: finalCard, anchor, url };
|
| 176 |
+
};
|
| 177 |
+
|
| 178 |
+
// Get visual element to highlight
|
| 179 |
+
const getVisualTarget = (cardObj) => {
|
| 180 |
+
if (!cardObj) return null;
|
| 181 |
+
const { card, anchor } = cardObj;
|
| 182 |
+
let target = card.querySelector('.phimage, .thumbnail-info-wrapper, .videoBox, .img, p.title') || anchor || card;
|
| 183 |
+
if (target && target.tagName === 'IMG') {
|
| 184 |
+
target = target.parentElement || target;
|
| 185 |
+
}
|
| 186 |
+
return target;
|
| 187 |
+
};
|
| 188 |
+
|
| 189 |
+
const toggleCardSelection = (url, select) => {
|
| 190 |
+
document.querySelectorAll('li.videoblock, .pcVideoListItem, .videoBox, .phimage, li[data-video-vkey], div[data-video-vkey], .b-model-videos__item, .video-card, a[href*="view_video.php"]').forEach(el => {
|
| 191 |
+
const cardObj = getPostCard(el);
|
| 192 |
+
if (cardObj && cardObj.url === url) {
|
| 193 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 194 |
+
if (visualTarget) {
|
| 195 |
+
if (select) {
|
| 196 |
+
visualTarget.classList.add('pornhub-selector-selected');
|
| 197 |
+
visualTarget.classList.remove('pornhub-selector-hover');
|
| 198 |
+
} else {
|
| 199 |
+
visualTarget.classList.remove('pornhub-selector-selected');
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
});
|
| 204 |
+
};
|
| 205 |
+
|
| 206 |
+
let isDragging = false;
|
| 207 |
+
let dragMode = null;
|
| 208 |
+
|
| 209 |
+
const mouseOver = (e) => {
|
| 210 |
+
if (e.target.closest('#pornhub-floating-ui')) return;
|
| 211 |
+
const cardObj = getPostCard(e.target);
|
| 212 |
+
if (cardObj) {
|
| 213 |
+
const { url } = cardObj;
|
| 214 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 215 |
+
if (!visualTarget) return;
|
| 216 |
+
|
| 217 |
+
if (isDragging) {
|
| 218 |
+
e.preventDefault();
|
| 219 |
+
e.stopPropagation();
|
| 220 |
+
|
| 221 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 222 |
+
selectedLinks.add(url);
|
| 223 |
+
toggleCardSelection(url, true);
|
| 224 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 225 |
+
selectedLinks.delete(url);
|
| 226 |
+
toggleCardSelection(url, false);
|
| 227 |
+
}
|
| 228 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 229 |
+
} else {
|
| 230 |
+
if (!visualTarget.classList.contains('pornhub-selector-selected')) {
|
| 231 |
+
visualTarget.classList.add('pornhub-selector-hover');
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
}
|
| 235 |
+
};
|
| 236 |
+
|
| 237 |
+
const mouseOut = (e) => {
|
| 238 |
+
if (e.target.closest('#pornhub-floating-ui')) return;
|
| 239 |
+
const cardObj = getPostCard(e.target);
|
| 240 |
+
if (cardObj) {
|
| 241 |
+
const visualTarget = getVisualTarget(cardObj);
|
| 242 |
+
if (visualTarget) {
|
| 243 |
+
visualTarget.classList.remove('pornhub-selector-hover');
|
| 244 |
+
}
|
| 245 |
+
}
|
| 246 |
+
};
|
| 247 |
+
|
| 248 |
+
const mouseDown = (e) => {
|
| 249 |
+
if (e.target.closest('#pornhub-floating-ui')) return;
|
| 250 |
+
|
| 251 |
+
const cardObj = getPostCard(e.target);
|
| 252 |
+
if (cardObj) {
|
| 253 |
+
e.preventDefault();
|
| 254 |
+
e.stopPropagation();
|
| 255 |
+
if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
|
| 256 |
+
isDragging = true;
|
| 257 |
+
|
| 258 |
+
const { url } = cardObj;
|
| 259 |
+
|
| 260 |
+
if (selectedLinks.has(url)) {
|
| 261 |
+
dragMode = 'deselect';
|
| 262 |
+
selectedLinks.delete(url);
|
| 263 |
+
toggleCardSelection(url, false);
|
| 264 |
+
} else {
|
| 265 |
+
dragMode = 'select';
|
| 266 |
+
selectedLinks.add(url);
|
| 267 |
+
toggleCardSelection(url, true);
|
| 268 |
+
}
|
| 269 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 270 |
+
}
|
| 271 |
+
};
|
| 272 |
+
|
| 273 |
+
const mouseUp = () => {
|
| 274 |
+
isDragging = false;
|
| 275 |
+
dragMode = null;
|
| 276 |
+
};
|
| 277 |
+
|
| 278 |
+
const dragStart = (e) => {
|
| 279 |
+
if (e.target.closest('#pornhub-floating-ui')) return;
|
| 280 |
+
const cardObj = getPostCard(e.target);
|
| 281 |
+
if (cardObj) {
|
| 282 |
+
e.preventDefault();
|
| 283 |
+
e.stopPropagation();
|
| 284 |
+
}
|
| 285 |
+
};
|
| 286 |
+
|
| 287 |
+
const click = (e) => {
|
| 288 |
+
if (e.target.closest('#pornhub-floating-ui')) return;
|
| 289 |
+
const cardObj = getPostCard(e.target);
|
| 290 |
+
if (cardObj) {
|
| 291 |
+
e.preventDefault();
|
| 292 |
+
e.stopPropagation();
|
| 293 |
+
if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
|
| 294 |
+
}
|
| 295 |
+
};
|
| 296 |
+
|
| 297 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 298 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 299 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 300 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 301 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 302 |
+
document.addEventListener('click', click, true);
|
| 303 |
+
|
| 304 |
+
selectAllBtn.onclick = () => {
|
| 305 |
+
const videoUrls = new Set();
|
| 306 |
+
document.querySelectorAll('a[href*="view_video.php"]').forEach(a => {
|
| 307 |
+
const url = getCleanUrl(a);
|
| 308 |
+
if (isVideoUrl(url)) {
|
| 309 |
+
videoUrls.add(url);
|
| 310 |
+
}
|
| 311 |
+
});
|
| 312 |
+
|
| 313 |
+
let allSelected = true;
|
| 314 |
+
videoUrls.forEach(url => {
|
| 315 |
+
if (!selectedLinks.has(url)) {
|
| 316 |
+
allSelected = false;
|
| 317 |
+
}
|
| 318 |
+
});
|
| 319 |
+
|
| 320 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 321 |
+
videoUrls.forEach(url => {
|
| 322 |
+
selectedLinks.delete(url);
|
| 323 |
+
toggleCardSelection(url, false);
|
| 324 |
+
});
|
| 325 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 326 |
+
} else {
|
| 327 |
+
videoUrls.forEach(url => {
|
| 328 |
+
selectedLinks.add(url);
|
| 329 |
+
toggleCardSelection(url, true);
|
| 330 |
+
});
|
| 331 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 332 |
+
}
|
| 333 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 334 |
+
};
|
| 335 |
+
|
| 336 |
+
copyBtn.onclick = () => {
|
| 337 |
+
if (selectedLinks.size === 0) return;
|
| 338 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 339 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 340 |
+
const ogText = copyBtn.textContent;
|
| 341 |
+
const ogBg = copyBtn.style.background;
|
| 342 |
+
copyBtn.textContent = '¡Copiados!';
|
| 343 |
+
copyBtn.style.background = '#10b981';
|
| 344 |
+
setTimeout(() => {
|
| 345 |
+
copyBtn.textContent = ogText;
|
| 346 |
+
copyBtn.style.background = ogBg || '#ff9000';
|
| 347 |
+
}, 2000);
|
| 348 |
+
});
|
| 349 |
+
};
|
| 350 |
+
|
| 351 |
+
closeBtn.onclick = () => {
|
| 352 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 353 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 354 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 355 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 356 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 357 |
+
document.removeEventListener('click', click, true);
|
| 358 |
+
container.remove();
|
| 359 |
+
style.remove();
|
| 360 |
+
document.querySelectorAll('.pornhub-selector-selected').forEach(el => el.classList.remove('pornhub-selector-selected'));
|
| 361 |
+
document.querySelectorAll('.pornhub-selector-hover').forEach(el => el.classList.remove('pornhub-selector-hover'));
|
| 362 |
+
window.__pornhubSelectorActive = false;
|
| 363 |
+
|
| 364 |
+
try {
|
| 365 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'pornhub' });
|
| 366 |
+
} catch (e) {
|
| 367 |
+
console.log("Could not notify popup, it is probably closed");
|
| 368 |
+
}
|
| 369 |
+
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (document.getElementById('tiktok-floating-ui')) return;
|
| 3 |
+
window.__ttSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'tt-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const autoScanBtn = document.createElement('button');
|
| 34 |
+
autoScanBtn.textContent = 'Buscar videos y fotos';
|
| 35 |
+
autoScanBtn.style.cssText = `
|
| 36 |
+
background: #ff0050;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 10px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: bold;
|
| 43 |
+
`;
|
| 44 |
+
|
| 45 |
+
const copyBtn = document.createElement('button');
|
| 46 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 47 |
+
copyBtn.style.cssText = `
|
| 48 |
+
background: #8b5cf6;
|
| 49 |
+
color: white;
|
| 50 |
+
border: none;
|
| 51 |
+
padding: 10px;
|
| 52 |
+
border-radius: 6px;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
font-weight: bold;
|
| 55 |
+
`;
|
| 56 |
+
|
| 57 |
+
const selectAllBtn = document.createElement('button');
|
| 58 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 59 |
+
selectAllBtn.style.cssText = `
|
| 60 |
+
background: #3f3f46;
|
| 61 |
+
color: white;
|
| 62 |
+
border: none;
|
| 63 |
+
padding: 8px;
|
| 64 |
+
border-radius: 6px;
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
font-weight: 600;
|
| 67 |
+
font-size: 13px;
|
| 68 |
+
transition: background 0.2s;
|
| 69 |
+
`;
|
| 70 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 71 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 72 |
+
|
| 73 |
+
const closeBtn = document.createElement('button');
|
| 74 |
+
closeBtn.id = 'tt-close-btn';
|
| 75 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 76 |
+
closeBtn.style.cssText = `
|
| 77 |
+
background: #27272a;
|
| 78 |
+
color: white;
|
| 79 |
+
border: 1px solid #3f3f46;
|
| 80 |
+
padding: 8px;
|
| 81 |
+
border-radius: 6px;
|
| 82 |
+
cursor: pointer;
|
| 83 |
+
font-size: 13px;
|
| 84 |
+
`;
|
| 85 |
+
|
| 86 |
+
container.appendChild(countDisplay);
|
| 87 |
+
container.appendChild(autoScanBtn);
|
| 88 |
+
container.appendChild(selectAllBtn);
|
| 89 |
+
container.appendChild(copyBtn);
|
| 90 |
+
container.appendChild(closeBtn);
|
| 91 |
+
document.body.appendChild(container);
|
| 92 |
+
|
| 93 |
+
const style = document.createElement('style');
|
| 94 |
+
style.id = 'tt-style';
|
| 95 |
+
style.textContent = `
|
| 96 |
+
.tt-selector-hover {
|
| 97 |
+
outline: 3px solid #ff0050 !important;
|
| 98 |
+
cursor: crosshair !important;
|
| 99 |
+
transition: all 0.2s;
|
| 100 |
+
z-index: 10;
|
| 101 |
+
}
|
| 102 |
+
.tt-selector-selected {
|
| 103 |
+
outline: 4px solid #10b981 !important;
|
| 104 |
+
opacity: 0.8;
|
| 105 |
+
position: relative;
|
| 106 |
+
z-index: 5;
|
| 107 |
+
}
|
| 108 |
+
.tt-selector-selected::after {
|
| 109 |
+
content: '✓';
|
| 110 |
+
position: absolute;
|
| 111 |
+
top: 10px;
|
| 112 |
+
right: 10px;
|
| 113 |
+
background: #10b981;
|
| 114 |
+
color: white;
|
| 115 |
+
border-radius: 50%;
|
| 116 |
+
width: 30px;
|
| 117 |
+
height: 30px;
|
| 118 |
+
display: flex;
|
| 119 |
+
align-items: center;
|
| 120 |
+
justify-content: center;
|
| 121 |
+
font-weight: bold;
|
| 122 |
+
font-size: 16px;
|
| 123 |
+
z-index: 20;
|
| 124 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
|
| 125 |
+
}
|
| 126 |
+
`;
|
| 127 |
+
document.head.appendChild(style);
|
| 128 |
+
|
| 129 |
+
const getPostCard = (el) => {
|
| 130 |
+
return el.closest('a[href*="/video/"]') || el.closest('a[href*="/photo/"]') || el.closest('[data-e2e="user-post-item"]');
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
let isDragging = false;
|
| 134 |
+
let dragMode = null;
|
| 135 |
+
|
| 136 |
+
const mouseOver = (e) => {
|
| 137 |
+
const card = getPostCard(e.target);
|
| 138 |
+
if (card) {
|
| 139 |
+
if (isDragging) {
|
| 140 |
+
e.preventDefault();
|
| 141 |
+
e.stopPropagation();
|
| 142 |
+
|
| 143 |
+
const link = card.tagName === 'A' ? card : (card.querySelector('a[href*="/video/"]') || card.querySelector('a[href*="/photo/"]'));
|
| 144 |
+
if (!link) return;
|
| 145 |
+
const url = link.href.split('?')[0];
|
| 146 |
+
|
| 147 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 148 |
+
selectedLinks.add(url);
|
| 149 |
+
card.classList.add('tt-selector-selected');
|
| 150 |
+
card.classList.remove('tt-selector-hover');
|
| 151 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 152 |
+
selectedLinks.delete(url);
|
| 153 |
+
card.classList.remove('tt-selector-selected');
|
| 154 |
+
}
|
| 155 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 156 |
+
} else {
|
| 157 |
+
if (!card.classList.contains('tt-selector-selected')) {
|
| 158 |
+
card.classList.add('tt-selector-hover');
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
};
|
| 163 |
+
|
| 164 |
+
const mouseOut = (e) => {
|
| 165 |
+
const card = getPostCard(e.target);
|
| 166 |
+
if (card) {
|
| 167 |
+
card.classList.remove('tt-selector-hover');
|
| 168 |
+
}
|
| 169 |
+
};
|
| 170 |
+
|
| 171 |
+
const mouseDown = (e) => {
|
| 172 |
+
const card = getPostCard(e.target);
|
| 173 |
+
if (card) {
|
| 174 |
+
e.preventDefault();
|
| 175 |
+
isDragging = true;
|
| 176 |
+
|
| 177 |
+
const link = card.tagName === 'A' ? card : (card.querySelector('a[href*="/video/"]') || card.querySelector('a[href*="/photo/"]'));
|
| 178 |
+
if (!link) return;
|
| 179 |
+
const url = link.href.split('?')[0];
|
| 180 |
+
|
| 181 |
+
if (selectedLinks.has(url)) {
|
| 182 |
+
dragMode = 'deselect';
|
| 183 |
+
selectedLinks.delete(url);
|
| 184 |
+
card.classList.remove('tt-selector-selected');
|
| 185 |
+
} else {
|
| 186 |
+
dragMode = 'select';
|
| 187 |
+
selectedLinks.add(url);
|
| 188 |
+
card.classList.add('tt-selector-selected');
|
| 189 |
+
card.classList.remove('tt-selector-hover');
|
| 190 |
+
}
|
| 191 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 192 |
+
}
|
| 193 |
+
};
|
| 194 |
+
|
| 195 |
+
const mouseUp = (e) => {
|
| 196 |
+
isDragging = false;
|
| 197 |
+
dragMode = null;
|
| 198 |
+
};
|
| 199 |
+
|
| 200 |
+
const dragStart = (e) => {
|
| 201 |
+
const card = getPostCard(e.target);
|
| 202 |
+
if (card) e.preventDefault();
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
const click = (e) => {
|
| 206 |
+
const card = getPostCard(e.target);
|
| 207 |
+
if (card) {
|
| 208 |
+
e.preventDefault();
|
| 209 |
+
e.stopPropagation();
|
| 210 |
+
}
|
| 211 |
+
};
|
| 212 |
+
|
| 213 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 214 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 215 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 216 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 217 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 218 |
+
document.addEventListener('click', click, true);
|
| 219 |
+
|
| 220 |
+
let scanInterval = null;
|
| 221 |
+
|
| 222 |
+
autoScanBtn.onclick = () => {
|
| 223 |
+
if (window.__ttIsScanning) {
|
| 224 |
+
clearInterval(scanInterval);
|
| 225 |
+
window.__ttIsScanning = false;
|
| 226 |
+
autoScanBtn.textContent = 'Buscar videos y fotos';
|
| 227 |
+
autoScanBtn.style.background = '#ff0050';
|
| 228 |
+
return;
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
window.__ttIsScanning = true;
|
| 232 |
+
autoScanBtn.textContent = 'Buscando... (0)';
|
| 233 |
+
autoScanBtn.style.background = '#27272a';
|
| 234 |
+
|
| 235 |
+
let lastHeight = 0;
|
| 236 |
+
let retries = 0;
|
| 237 |
+
const maxRetries = 10;
|
| 238 |
+
|
| 239 |
+
scanInterval = setInterval(() => {
|
| 240 |
+
window.scrollTo(0, document.body.scrollHeight);
|
| 241 |
+
|
| 242 |
+
const links = document.querySelectorAll('a[href*="/video/"], a[href*="/photo/"]');
|
| 243 |
+
let addedNew = false;
|
| 244 |
+
links.forEach(a => {
|
| 245 |
+
let cleanUrl = a.href.split('?')[0];
|
| 246 |
+
if (!selectedLinks.has(cleanUrl)) {
|
| 247 |
+
selectedLinks.add(cleanUrl);
|
| 248 |
+
const card = getPostCard(a) || a;
|
| 249 |
+
card.classList.add('tt-selector-selected');
|
| 250 |
+
card.classList.remove('tt-selector-hover');
|
| 251 |
+
addedNew = true;
|
| 252 |
+
}
|
| 253 |
+
});
|
| 254 |
+
|
| 255 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 256 |
+
autoScanBtn.textContent = 'Detener búsqueda (' + selectedLinks.size + ')';
|
| 257 |
+
|
| 258 |
+
if (document.body.scrollHeight === lastHeight && !addedNew) {
|
| 259 |
+
retries++;
|
| 260 |
+
if (retries >= maxRetries) {
|
| 261 |
+
clearInterval(scanInterval);
|
| 262 |
+
window.__ttIsScanning = false;
|
| 263 |
+
autoScanBtn.textContent = 'Buscar videos y fotos';
|
| 264 |
+
autoScanBtn.style.background = '#ff0050';
|
| 265 |
+
}
|
| 266 |
+
} else {
|
| 267 |
+
retries = 0;
|
| 268 |
+
}
|
| 269 |
+
lastHeight = document.body.scrollHeight;
|
| 270 |
+
}, 2000);
|
| 271 |
+
};
|
| 272 |
+
|
| 273 |
+
selectAllBtn.onclick = () => {
|
| 274 |
+
const links = document.querySelectorAll('a[href*="/video/"], a[href*="/photo/"]');
|
| 275 |
+
let allSelected = true;
|
| 276 |
+
|
| 277 |
+
links.forEach(a => {
|
| 278 |
+
const url = a.href.split('?')[0];
|
| 279 |
+
if (!selectedLinks.has(url)) {
|
| 280 |
+
allSelected = false;
|
| 281 |
+
}
|
| 282 |
+
});
|
| 283 |
+
|
| 284 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 285 |
+
links.forEach(a => {
|
| 286 |
+
const url = a.href.split('?')[0];
|
| 287 |
+
selectedLinks.delete(url);
|
| 288 |
+
const card = getPostCard(a) || a;
|
| 289 |
+
card.classList.remove('tt-selector-selected');
|
| 290 |
+
});
|
| 291 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 292 |
+
} else {
|
| 293 |
+
links.forEach(a => {
|
| 294 |
+
const url = a.href.split('?')[0];
|
| 295 |
+
if (!selectedLinks.has(url)) {
|
| 296 |
+
selectedLinks.add(url);
|
| 297 |
+
const card = getPostCard(a) || a;
|
| 298 |
+
card.classList.add('tt-selector-selected');
|
| 299 |
+
card.classList.remove('tt-selector-hover');
|
| 300 |
+
}
|
| 301 |
+
});
|
| 302 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 303 |
+
}
|
| 304 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 305 |
+
};
|
| 306 |
+
|
| 307 |
+
copyBtn.onclick = () => {
|
| 308 |
+
if (selectedLinks.size === 0) return;
|
| 309 |
+
|
| 310 |
+
const videos = [];
|
| 311 |
+
const photos = [];
|
| 312 |
+
|
| 313 |
+
selectedLinks.forEach(url => {
|
| 314 |
+
if (url.includes('/photo/')) {
|
| 315 |
+
photos.push(url);
|
| 316 |
+
} else {
|
| 317 |
+
videos.push(url);
|
| 318 |
+
}
|
| 319 |
+
});
|
| 320 |
+
|
| 321 |
+
let text = '';
|
| 322 |
+
if (videos.length > 0 && photos.length > 0) {
|
| 323 |
+
text = `=== VIDEOS ===\n${videos.join('\n')}\n\n=== IMAGENES ===\n${photos.join('\n')}`;
|
| 324 |
+
} else if (photos.length > 0) {
|
| 325 |
+
text = photos.join('\n');
|
| 326 |
+
} else {
|
| 327 |
+
text = videos.join('\n');
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 331 |
+
const ogText = copyBtn.textContent;
|
| 332 |
+
copyBtn.textContent = '¡Copiados!';
|
| 333 |
+
copyBtn.style.background = '#10b981';
|
| 334 |
+
setTimeout(() => {
|
| 335 |
+
copyBtn.textContent = ogText;
|
| 336 |
+
copyBtn.style.background = '#8b5cf6';
|
| 337 |
+
}, 2000);
|
| 338 |
+
});
|
| 339 |
+
};
|
| 340 |
+
|
| 341 |
+
closeBtn.onclick = () => {
|
| 342 |
+
if (scanInterval) clearInterval(scanInterval);
|
| 343 |
+
window.__ttIsScanning = false;
|
| 344 |
+
|
| 345 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 346 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 347 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 348 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 349 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 350 |
+
document.removeEventListener('click', click, true);
|
| 351 |
+
container.remove();
|
| 352 |
+
style.remove();
|
| 353 |
+
document.querySelectorAll('.tt-selector-selected').forEach(el => el.classList.remove('tt-selector-selected'));
|
| 354 |
+
document.querySelectorAll('.tt-selector-hover').forEach(el => el.classList.remove('tt-selector-hover'));
|
| 355 |
+
window.__ttSelectorActive = false;
|
| 356 |
+
window.dispatchEvent(new Event('TT_OFF'));
|
| 357 |
+
};
|
| 358 |
+
})();
|
detector de enlaces - copia/src/twpornstars/quick_scan.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
try {
|
| 3 |
+
const thumbs = document.querySelectorAll('.thumb[data-isvideo="1"], .thumb');
|
| 4 |
+
const results = [];
|
| 5 |
+
thumbs.forEach(thumb => {
|
| 6 |
+
// Check if it's a video: either data-isvideo="1" or contains thumb__video_icon
|
| 7 |
+
const isVideo = thumb.getAttribute('data-isvideo') === '1' || !!thumb.querySelector('.thumb__video_icon');
|
| 8 |
+
if (!isVideo) return;
|
| 9 |
+
|
| 10 |
+
const linkEl = thumb.querySelector('.thumb__link');
|
| 11 |
+
const imgEl = thumb.querySelector('.thumb__img');
|
| 12 |
+
const infoTextEl = thumb.querySelector('.thumb__info_text') || thumb.querySelector('.thumb__title');
|
| 13 |
+
|
| 14 |
+
if (linkEl && linkEl.href) {
|
| 15 |
+
let title = infoTextEl ? infoTextEl.textContent.trim() : '';
|
| 16 |
+
if (!title && imgEl && imgEl.alt) {
|
| 17 |
+
title = imgEl.alt.trim();
|
| 18 |
+
}
|
| 19 |
+
if (!title) {
|
| 20 |
+
title = "Video " + linkEl.href.split('/').pop();
|
| 21 |
+
}
|
| 22 |
+
results.push({
|
| 23 |
+
title: title,
|
| 24 |
+
postUrl: linkEl.href,
|
| 25 |
+
thumbnailUrl: imgEl ? imgEl.src : ''
|
| 26 |
+
});
|
| 27 |
+
}
|
| 28 |
+
});
|
| 29 |
+
const pagination = document.querySelector('.pagination');
|
| 30 |
+
let maxPage = 1;
|
| 31 |
+
if (pagination) {
|
| 32 |
+
pagination.querySelectorAll('li').forEach(li => {
|
| 33 |
+
const num = parseInt(li.textContent.trim(), 10);
|
| 34 |
+
if (!isNaN(num) && num > maxPage) {
|
| 35 |
+
maxPage = num;
|
| 36 |
+
}
|
| 37 |
+
});
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
const baseUrl = window.location.origin + window.location.pathname;
|
| 41 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (window.__xExtractorActive) return;
|
| 3 |
+
window.__xExtractorActive = true;
|
| 4 |
+
|
| 5 |
+
const collectedVideos = new Map(); // url -> { url, title, thumb }
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'x-extractor-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #000;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #333;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(255,255,255,0.2);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 250px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const titleDisplay = document.createElement('div');
|
| 28 |
+
titleDisplay.innerHTML = '<b>Extractor de Videos X</b>';
|
| 29 |
+
titleDisplay.style.textAlign = 'center';
|
| 30 |
+
titleDisplay.style.fontSize = '15px';
|
| 31 |
+
|
| 32 |
+
const countDisplay = document.createElement('div');
|
| 33 |
+
countDisplay.textContent = '0 videos encontrados';
|
| 34 |
+
countDisplay.style.fontWeight = 'bold';
|
| 35 |
+
countDisplay.style.textAlign = 'center';
|
| 36 |
+
countDisplay.style.fontSize = '18px';
|
| 37 |
+
countDisplay.style.color = '#1da1f2';
|
| 38 |
+
|
| 39 |
+
const statusDisplay = document.createElement('div');
|
| 40 |
+
statusDisplay.textContent = 'Listo para escanear.';
|
| 41 |
+
statusDisplay.style.textAlign = 'center';
|
| 42 |
+
statusDisplay.style.fontSize = '12px';
|
| 43 |
+
statusDisplay.style.color = '#888';
|
| 44 |
+
|
| 45 |
+
const autoScanBtn = document.createElement('button');
|
| 46 |
+
autoScanBtn.textContent = 'Iniciar Búsqueda Automática (Scroll)';
|
| 47 |
+
autoScanBtn.style.cssText = `
|
| 48 |
+
background: #1da1f2;
|
| 49 |
+
color: white;
|
| 50 |
+
border: none;
|
| 51 |
+
padding: 10px;
|
| 52 |
+
border-radius: 6px;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
font-weight: bold;
|
| 55 |
+
`;
|
| 56 |
+
|
| 57 |
+
const copyBtn = document.createElement('button');
|
| 58 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 59 |
+
copyBtn.style.cssText = `
|
| 60 |
+
background: #8b5cf6;
|
| 61 |
+
color: white;
|
| 62 |
+
border: none;
|
| 63 |
+
padding: 10px;
|
| 64 |
+
border-radius: 6px;
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
font-weight: bold;
|
| 67 |
+
`;
|
| 68 |
+
|
| 69 |
+
const closeBtn = document.createElement('button');
|
| 70 |
+
closeBtn.id = 'x-close-btn';
|
| 71 |
+
closeBtn.textContent = 'Cerrar Extractor';
|
| 72 |
+
closeBtn.style.cssText = `
|
| 73 |
+
background: #27272a;
|
| 74 |
+
color: white;
|
| 75 |
+
border: 1px solid #3f3f46;
|
| 76 |
+
padding: 8px;
|
| 77 |
+
border-radius: 6px;
|
| 78 |
+
cursor: pointer;
|
| 79 |
+
font-size: 13px;
|
| 80 |
+
`;
|
| 81 |
+
|
| 82 |
+
container.appendChild(titleDisplay);
|
| 83 |
+
container.appendChild(countDisplay);
|
| 84 |
+
container.appendChild(statusDisplay);
|
| 85 |
+
container.appendChild(autoScanBtn);
|
| 86 |
+
container.appendChild(copyBtn);
|
| 87 |
+
container.appendChild(closeBtn);
|
| 88 |
+
document.body.appendChild(container);
|
| 89 |
+
|
| 90 |
+
let scanInterval = null;
|
| 91 |
+
let isScanning = false;
|
| 92 |
+
let maxRetries = 10; // Aumentar reintentos antes de rendirse
|
| 93 |
+
|
| 94 |
+
autoScanBtn.onclick = () => {
|
| 95 |
+
if (isScanning) {
|
| 96 |
+
clearInterval(scanInterval);
|
| 97 |
+
isScanning = false;
|
| 98 |
+
autoScanBtn.textContent = 'Continuar Búsqueda';
|
| 99 |
+
autoScanBtn.style.background = '#1da1f2';
|
| 100 |
+
statusDisplay.textContent = 'Búsqueda pausada.';
|
| 101 |
+
return;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
isScanning = true;
|
| 105 |
+
autoScanBtn.textContent = 'Detener Búsqueda';
|
| 106 |
+
autoScanBtn.style.background = '#e0245e';
|
| 107 |
+
statusDisplay.textContent = 'Haciendo scroll y buscando videos...';
|
| 108 |
+
|
| 109 |
+
let lastHeight = 0;
|
| 110 |
+
let retries = 0;
|
| 111 |
+
|
| 112 |
+
scanInterval = setInterval(() => {
|
| 113 |
+
// Scroll progresivo en lugar de ir directo al fondo para no atascar React
|
| 114 |
+
window.scrollBy(0, 1000);
|
| 115 |
+
|
| 116 |
+
// Buscar enlaces a videos o tweets que parezcan videos
|
| 117 |
+
const links = document.querySelectorAll('a[href*="/status/"]');
|
| 118 |
+
|
| 119 |
+
links.forEach(a => {
|
| 120 |
+
let cleanUrl = a.href.split('?')[0];
|
| 121 |
+
|
| 122 |
+
// Es un video si tiene /video/ en la URL, o si tiene un div indicando duración (ej. "4:13")
|
| 123 |
+
let isVideo = cleanUrl.includes('/video/');
|
| 124 |
+
if (!isVideo && a.innerText && /^\d+:\d+$/.test(a.innerText.trim())) {
|
| 125 |
+
isVideo = true;
|
| 126 |
+
}
|
| 127 |
+
// Si el link de la cuadricula no termina en /video/1, se lo agregamos si estamos seguros que es video
|
| 128 |
+
if (isVideo && !cleanUrl.includes('/video/')) {
|
| 129 |
+
if (!cleanUrl.endsWith('/')) cleanUrl += '/';
|
| 130 |
+
cleanUrl += 'video/1';
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
if (isVideo && !collectedVideos.has(cleanUrl)) {
|
| 134 |
+
collectedVideos.set(cleanUrl, true);
|
| 135 |
+
|
| 136 |
+
// Feedback visual (borde verde y opacidad)
|
| 137 |
+
a.style.outline = '4px solid #10b981';
|
| 138 |
+
a.style.opacity = '0.8';
|
| 139 |
+
a.style.position = 'relative';
|
| 140 |
+
|
| 141 |
+
// Agregar marca de verificación visual si no la tiene
|
| 142 |
+
if (!a.querySelector('.x-check-mark')) {
|
| 143 |
+
const check = document.createElement('div');
|
| 144 |
+
check.className = 'x-check-mark';
|
| 145 |
+
check.innerHTML = '✓';
|
| 146 |
+
check.style.cssText = 'position:absolute; top:10px; right:10px; background:#10b981; color:white; border-radius:50%; width:30px; height:30px; display:flex; align-items:center; justify-content:center; font-weight:bold; font-size:16px; z-index:20; box-shadow:0 2px 5px rgba(0,0,0,0.5);';
|
| 147 |
+
a.appendChild(check);
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
});
|
| 151 |
+
|
| 152 |
+
countDisplay.textContent = collectedVideos.size + ' videos encontrados';
|
| 153 |
+
|
| 154 |
+
let currentScroll = window.scrollY || document.documentElement.scrollTop;
|
| 155 |
+
if (currentScroll === lastHeight) {
|
| 156 |
+
retries++;
|
| 157 |
+
// Darle un pequeño empujón hacia arriba y abajo por si se atascó
|
| 158 |
+
if (retries === 3) window.scrollBy(0, -500);
|
| 159 |
+
if (retries === 4) window.scrollBy(0, 800);
|
| 160 |
+
|
| 161 |
+
if (retries >= maxRetries) {
|
| 162 |
+
clearInterval(scanInterval);
|
| 163 |
+
isScanning = false;
|
| 164 |
+
autoScanBtn.textContent = 'Búsqueda finalizada';
|
| 165 |
+
autoScanBtn.style.background = '#1da1f2';
|
| 166 |
+
autoScanBtn.disabled = true;
|
| 167 |
+
statusDisplay.textContent = 'Llegaste al final de la página.';
|
| 168 |
+
}
|
| 169 |
+
} else {
|
| 170 |
+
retries = 0;
|
| 171 |
+
}
|
| 172 |
+
lastHeight = currentScroll;
|
| 173 |
+
}, 1000);
|
| 174 |
+
};
|
| 175 |
+
|
| 176 |
+
copyBtn.onclick = () => {
|
| 177 |
+
if (collectedVideos.size === 0) return;
|
| 178 |
+
const urls = Array.from(collectedVideos.keys());
|
| 179 |
+
const text = urls.join('\n');
|
| 180 |
+
|
| 181 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 182 |
+
const ogText = copyBtn.textContent;
|
| 183 |
+
copyBtn.textContent = '¡Copiados!';
|
| 184 |
+
copyBtn.style.background = '#10b981';
|
| 185 |
+
setTimeout(() => {
|
| 186 |
+
copyBtn.textContent = ogText;
|
| 187 |
+
copyBtn.style.background = '#8b5cf6';
|
| 188 |
+
}, 2000);
|
| 189 |
+
});
|
| 190 |
+
};
|
| 191 |
+
|
| 192 |
+
closeBtn.onclick = () => {
|
| 193 |
+
if (scanInterval) clearInterval(scanInterval);
|
| 194 |
+
isScanning = false;
|
| 195 |
+
container.remove();
|
| 196 |
+
window.__xExtractorActive = false;
|
| 197 |
+
};
|
| 198 |
+
})();
|
detector de enlaces - copia/src/x/quick_scan.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
try {
|
| 3 |
+
const results = [];
|
| 4 |
+
const seenUrls = new Set();
|
| 5 |
+
|
| 6 |
+
// Buscar imágenes
|
| 7 |
+
const images = document.querySelectorAll('img[src*="twimg.com/media"]');
|
| 8 |
+
images.forEach(img => {
|
| 9 |
+
let url = img.src;
|
| 10 |
+
// Convertir a calidad original (orig)
|
| 11 |
+
if (url.includes('name=')) {
|
| 12 |
+
url = url.replace(/name=[^&]+/, 'name=orig');
|
| 13 |
+
} else {
|
| 14 |
+
url = url + '&name=orig';
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
if (!seenUrls.has(url)) {
|
| 18 |
+
seenUrls.add(url);
|
| 19 |
+
results.push({
|
| 20 |
+
title: 'X Media Image',
|
| 21 |
+
mediaUrl: url,
|
| 22 |
+
thumbnailUrl: img.src,
|
| 23 |
+
type: 'image'
|
| 24 |
+
});
|
| 25 |
+
}
|
| 26 |
+
});
|
| 27 |
+
|
| 28 |
+
// Intentar buscar videos (usualmente son blobs o m3u8, X usa m3u8 en el DOM a veces si no es blob)
|
| 29 |
+
const videos = document.querySelectorAll('video');
|
| 30 |
+
videos.forEach(video => {
|
| 31 |
+
let url = video.src;
|
| 32 |
+
if (!url || url.startsWith('blob:')) {
|
| 33 |
+
// Intentar buscar source
|
| 34 |
+
const source = video.querySelector('source');
|
| 35 |
+
if (source && source.src && !source.src.startsWith('blob:')) {
|
| 36 |
+
url = source.src;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
if (url && !url.startsWith('blob:') && !seenUrls.has(url)) {
|
| 41 |
+
seenUrls.add(url);
|
| 42 |
+
results.push({
|
| 43 |
+
title: 'X Media Video',
|
| 44 |
+
mediaUrl: url,
|
| 45 |
+
thumbnailUrl: video.getAttribute('poster') || '',
|
| 46 |
+
type: 'video'
|
| 47 |
+
});
|
| 48 |
+
}
|
| 49 |
+
});
|
| 50 |
+
|
| 51 |
+
return { media: results };
|
| 52 |
+
} catch(e) {
|
| 53 |
+
return { error: e.message };
|
| 54 |
+
}
|
| 55 |
+
})();
|
detector de enlaces - copia/src/x/selector.js
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (window.__xSelectorActive) return;
|
| 3 |
+
window.__xSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'x-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #000;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #333;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(255,255,255,0.1);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const autoScanBtn = document.createElement('button');
|
| 34 |
+
autoScanBtn.textContent = 'Buscar enlaces en pantalla';
|
| 35 |
+
autoScanBtn.style.cssText = `
|
| 36 |
+
background: #1da1f2;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 10px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: bold;
|
| 43 |
+
`;
|
| 44 |
+
|
| 45 |
+
const copyBtn = document.createElement('button');
|
| 46 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 47 |
+
copyBtn.style.cssText = `
|
| 48 |
+
background: #8b5cf6;
|
| 49 |
+
color: white;
|
| 50 |
+
border: none;
|
| 51 |
+
padding: 10px;
|
| 52 |
+
border-radius: 6px;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
font-weight: bold;
|
| 55 |
+
`;
|
| 56 |
+
|
| 57 |
+
const selectAllBtn = document.createElement('button');
|
| 58 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 59 |
+
selectAllBtn.style.cssText = `
|
| 60 |
+
background: #333;
|
| 61 |
+
color: white;
|
| 62 |
+
border: none;
|
| 63 |
+
padding: 8px;
|
| 64 |
+
border-radius: 6px;
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
font-weight: 600;
|
| 67 |
+
font-size: 13px;
|
| 68 |
+
transition: background 0.2s;
|
| 69 |
+
`;
|
| 70 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#444';
|
| 71 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#333';
|
| 72 |
+
|
| 73 |
+
const closeBtn = document.createElement('button');
|
| 74 |
+
closeBtn.id = 'x-close-btn';
|
| 75 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 76 |
+
closeBtn.style.cssText = `
|
| 77 |
+
background: #27272a;
|
| 78 |
+
color: white;
|
| 79 |
+
border: 1px solid #3f3f46;
|
| 80 |
+
padding: 8px;
|
| 81 |
+
border-radius: 6px;
|
| 82 |
+
cursor: pointer;
|
| 83 |
+
font-size: 13px;
|
| 84 |
+
`;
|
| 85 |
+
|
| 86 |
+
container.appendChild(countDisplay);
|
| 87 |
+
container.appendChild(autoScanBtn);
|
| 88 |
+
container.appendChild(selectAllBtn);
|
| 89 |
+
container.appendChild(copyBtn);
|
| 90 |
+
container.appendChild(closeBtn);
|
| 91 |
+
document.body.appendChild(container);
|
| 92 |
+
|
| 93 |
+
const style = document.createElement('style');
|
| 94 |
+
style.id = 'x-style';
|
| 95 |
+
style.textContent = `
|
| 96 |
+
.x-selector-hover {
|
| 97 |
+
outline: 3px solid #1da1f2 !important;
|
| 98 |
+
cursor: crosshair !important;
|
| 99 |
+
transition: all 0.2s;
|
| 100 |
+
z-index: 10;
|
| 101 |
+
}
|
| 102 |
+
.x-selector-selected {
|
| 103 |
+
outline: 4px solid #10b981 !important;
|
| 104 |
+
opacity: 0.8;
|
| 105 |
+
position: relative;
|
| 106 |
+
z-index: 5;
|
| 107 |
+
}
|
| 108 |
+
.x-selector-selected::after {
|
| 109 |
+
content: '✓';
|
| 110 |
+
position: absolute;
|
| 111 |
+
top: 10px;
|
| 112 |
+
right: 10px;
|
| 113 |
+
background: #10b981;
|
| 114 |
+
color: white;
|
| 115 |
+
border-radius: 50%;
|
| 116 |
+
width: 30px;
|
| 117 |
+
height: 30px;
|
| 118 |
+
display: flex;
|
| 119 |
+
align-items: center;
|
| 120 |
+
justify-content: center;
|
| 121 |
+
font-weight: bold;
|
| 122 |
+
font-size: 16px;
|
| 123 |
+
z-index: 20;
|
| 124 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
|
| 125 |
+
}
|
| 126 |
+
`;
|
| 127 |
+
document.head.appendChild(style);
|
| 128 |
+
|
| 129 |
+
const getPostCard = (el) => {
|
| 130 |
+
return el.closest('a[href*="/status/"]');
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
let isDragging = false;
|
| 134 |
+
let dragMode = null;
|
| 135 |
+
|
| 136 |
+
const mouseOver = (e) => {
|
| 137 |
+
const card = getPostCard(e.target);
|
| 138 |
+
if (card) {
|
| 139 |
+
if (isDragging) {
|
| 140 |
+
e.preventDefault();
|
| 141 |
+
e.stopPropagation();
|
| 142 |
+
|
| 143 |
+
const url = card.href.split('?')[0];
|
| 144 |
+
|
| 145 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 146 |
+
selectedLinks.add(url);
|
| 147 |
+
card.classList.add('x-selector-selected');
|
| 148 |
+
card.classList.remove('x-selector-hover');
|
| 149 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 150 |
+
selectedLinks.delete(url);
|
| 151 |
+
card.classList.remove('x-selector-selected');
|
| 152 |
+
}
|
| 153 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 154 |
+
} else {
|
| 155 |
+
if (!card.classList.contains('x-selector-selected')) {
|
| 156 |
+
card.classList.add('x-selector-hover');
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
};
|
| 161 |
+
|
| 162 |
+
const mouseOut = (e) => {
|
| 163 |
+
const card = getPostCard(e.target);
|
| 164 |
+
if (card) {
|
| 165 |
+
card.classList.remove('x-selector-hover');
|
| 166 |
+
}
|
| 167 |
+
};
|
| 168 |
+
|
| 169 |
+
const mouseDown = (e) => {
|
| 170 |
+
const card = getPostCard(e.target);
|
| 171 |
+
if (card) {
|
| 172 |
+
e.preventDefault();
|
| 173 |
+
isDragging = true;
|
| 174 |
+
|
| 175 |
+
const url = card.href.split('?')[0];
|
| 176 |
+
|
| 177 |
+
if (selectedLinks.has(url)) {
|
| 178 |
+
dragMode = 'deselect';
|
| 179 |
+
selectedLinks.delete(url);
|
| 180 |
+
card.classList.remove('x-selector-selected');
|
| 181 |
+
} else {
|
| 182 |
+
dragMode = 'select';
|
| 183 |
+
selectedLinks.add(url);
|
| 184 |
+
card.classList.add('x-selector-selected');
|
| 185 |
+
card.classList.remove('x-selector-hover');
|
| 186 |
+
}
|
| 187 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 188 |
+
}
|
| 189 |
+
};
|
| 190 |
+
|
| 191 |
+
const mouseUp = (e) => {
|
| 192 |
+
isDragging = false;
|
| 193 |
+
dragMode = null;
|
| 194 |
+
};
|
| 195 |
+
|
| 196 |
+
const dragStart = (e) => {
|
| 197 |
+
const card = getPostCard(e.target);
|
| 198 |
+
if (card) e.preventDefault();
|
| 199 |
+
};
|
| 200 |
+
|
| 201 |
+
const click = (e) => {
|
| 202 |
+
const card = getPostCard(e.target);
|
| 203 |
+
if (card) {
|
| 204 |
+
e.preventDefault();
|
| 205 |
+
e.stopPropagation();
|
| 206 |
+
}
|
| 207 |
+
};
|
| 208 |
+
|
| 209 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 210 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 211 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 212 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 213 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 214 |
+
document.addEventListener('click', click, true);
|
| 215 |
+
|
| 216 |
+
let scanInterval = null;
|
| 217 |
+
|
| 218 |
+
autoScanBtn.onclick = () => {
|
| 219 |
+
if (window.__xIsScanning) {
|
| 220 |
+
clearInterval(scanInterval);
|
| 221 |
+
window.__xIsScanning = false;
|
| 222 |
+
autoScanBtn.textContent = 'Buscar enlaces en pantalla';
|
| 223 |
+
autoScanBtn.style.background = '#1da1f2';
|
| 224 |
+
return;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
window.__xIsScanning = true;
|
| 228 |
+
autoScanBtn.textContent = 'Buscando... (0)';
|
| 229 |
+
autoScanBtn.style.background = '#333';
|
| 230 |
+
|
| 231 |
+
let lastHeight = 0;
|
| 232 |
+
let retries = 0;
|
| 233 |
+
const maxRetries = 10;
|
| 234 |
+
|
| 235 |
+
scanInterval = setInterval(() => {
|
| 236 |
+
window.scrollTo(0, document.body.scrollHeight);
|
| 237 |
+
|
| 238 |
+
const links = document.querySelectorAll('a[href*="/status/"]');
|
| 239 |
+
let addedNew = false;
|
| 240 |
+
links.forEach(a => {
|
| 241 |
+
let cleanUrl = a.href.split('?')[0];
|
| 242 |
+
if (!selectedLinks.has(cleanUrl)) {
|
| 243 |
+
selectedLinks.add(cleanUrl);
|
| 244 |
+
a.classList.add('x-selector-selected');
|
| 245 |
+
a.classList.remove('x-selector-hover');
|
| 246 |
+
addedNew = true;
|
| 247 |
+
}
|
| 248 |
+
});
|
| 249 |
+
|
| 250 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 251 |
+
autoScanBtn.textContent = 'Detener búsqueda (' + selectedLinks.size + ')';
|
| 252 |
+
|
| 253 |
+
if (document.body.scrollHeight === lastHeight && !addedNew) {
|
| 254 |
+
retries++;
|
| 255 |
+
if (retries >= maxRetries) {
|
| 256 |
+
clearInterval(scanInterval);
|
| 257 |
+
window.__xIsScanning = false;
|
| 258 |
+
autoScanBtn.textContent = 'Buscar enlaces en pantalla';
|
| 259 |
+
autoScanBtn.style.background = '#1da1f2';
|
| 260 |
+
}
|
| 261 |
+
} else {
|
| 262 |
+
retries = 0;
|
| 263 |
+
}
|
| 264 |
+
lastHeight = document.body.scrollHeight;
|
| 265 |
+
}, 2000);
|
| 266 |
+
};
|
| 267 |
+
|
| 268 |
+
selectAllBtn.onclick = () => {
|
| 269 |
+
const links = document.querySelectorAll('a[href*="/status/"]');
|
| 270 |
+
let allSelected = true;
|
| 271 |
+
|
| 272 |
+
links.forEach(a => {
|
| 273 |
+
const url = a.href.split('?')[0];
|
| 274 |
+
if (!selectedLinks.has(url)) {
|
| 275 |
+
allSelected = false;
|
| 276 |
+
}
|
| 277 |
+
});
|
| 278 |
+
|
| 279 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 280 |
+
links.forEach(a => {
|
| 281 |
+
const url = a.href.split('?')[0];
|
| 282 |
+
selectedLinks.delete(url);
|
| 283 |
+
a.classList.remove('x-selector-selected');
|
| 284 |
+
});
|
| 285 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 286 |
+
} else {
|
| 287 |
+
links.forEach(a => {
|
| 288 |
+
const url = a.href.split('?')[0];
|
| 289 |
+
if (!selectedLinks.has(url)) {
|
| 290 |
+
selectedLinks.add(url);
|
| 291 |
+
a.classList.add('x-selector-selected');
|
| 292 |
+
a.classList.remove('x-selector-hover');
|
| 293 |
+
}
|
| 294 |
+
});
|
| 295 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 296 |
+
}
|
| 297 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 298 |
+
};
|
| 299 |
+
|
| 300 |
+
copyBtn.onclick = () => {
|
| 301 |
+
if (selectedLinks.size === 0) return;
|
| 302 |
+
const text = Array.from(selectedLinks).join('\\n');
|
| 303 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 304 |
+
const ogText = copyBtn.textContent;
|
| 305 |
+
copyBtn.textContent = '¡Copiados!';
|
| 306 |
+
copyBtn.style.background = '#10b981';
|
| 307 |
+
setTimeout(() => {
|
| 308 |
+
copyBtn.textContent = ogText;
|
| 309 |
+
copyBtn.style.background = '#8b5cf6';
|
| 310 |
+
}, 2000);
|
| 311 |
+
});
|
| 312 |
+
};
|
| 313 |
+
|
| 314 |
+
closeBtn.onclick = () => {
|
| 315 |
+
if (scanInterval) clearInterval(scanInterval);
|
| 316 |
+
window.__xIsScanning = false;
|
| 317 |
+
|
| 318 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 319 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 320 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 321 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 322 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 323 |
+
document.removeEventListener('click', click, true);
|
| 324 |
+
container.remove();
|
| 325 |
+
style.remove();
|
| 326 |
+
document.querySelectorAll('.x-selector-selected').forEach(el => el.classList.remove('x-selector-selected'));
|
| 327 |
+
document.querySelectorAll('.x-selector-hover').forEach(el => el.classList.remove('x-selector-hover'));
|
| 328 |
+
window.__xSelectorActive = false;
|
| 329 |
+
};
|
| 330 |
+
})();
|
detector de enlaces - copia/src/xhamster/selector.js
ADDED
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (window.__xhamsterSelectorActive) return;
|
| 3 |
+
window.__xhamsterSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'xh-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const selectAllBtn = document.createElement('button');
|
| 34 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 35 |
+
selectAllBtn.style.cssText = `
|
| 36 |
+
background: #3f3f46;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 8px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: 600;
|
| 43 |
+
font-size: 13px;
|
| 44 |
+
transition: background 0.2s;
|
| 45 |
+
`;
|
| 46 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 47 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 48 |
+
|
| 49 |
+
const copyBtn = document.createElement('button');
|
| 50 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 51 |
+
copyBtn.style.cssText = `
|
| 52 |
+
background: #ef4444;
|
| 53 |
+
color: white;
|
| 54 |
+
border: none;
|
| 55 |
+
padding: 10px;
|
| 56 |
+
border-radius: 6px;
|
| 57 |
+
cursor: pointer;
|
| 58 |
+
font-weight: bold;
|
| 59 |
+
`;
|
| 60 |
+
|
| 61 |
+
const closeBtn = document.createElement('button');
|
| 62 |
+
closeBtn.id = 'xh-close-btn';
|
| 63 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 64 |
+
closeBtn.style.cssText = `
|
| 65 |
+
background: #27272a;
|
| 66 |
+
color: white;
|
| 67 |
+
border: 1px solid #3f3f46;
|
| 68 |
+
padding: 8px;
|
| 69 |
+
border-radius: 6px;
|
| 70 |
+
cursor: pointer;
|
| 71 |
+
font-size: 13px;
|
| 72 |
+
`;
|
| 73 |
+
|
| 74 |
+
container.appendChild(countDisplay);
|
| 75 |
+
container.appendChild(selectAllBtn);
|
| 76 |
+
container.appendChild(copyBtn);
|
| 77 |
+
container.appendChild(closeBtn);
|
| 78 |
+
document.body.appendChild(container);
|
| 79 |
+
|
| 80 |
+
const style = document.createElement('style');
|
| 81 |
+
style.id = 'xh-style';
|
| 82 |
+
style.textContent = `
|
| 83 |
+
.xh-selector-hover {
|
| 84 |
+
box-shadow: inset 0 0 0 4px #ef4444 !important, 0 0 10px rgba(239, 68, 68, 0.5) !important;
|
| 85 |
+
cursor: crosshair !important;
|
| 86 |
+
transition: all 0.2s;
|
| 87 |
+
position: relative !important;
|
| 88 |
+
z-index: 9999 !important;
|
| 89 |
+
}
|
| 90 |
+
.xh-selector-selected {
|
| 91 |
+
box-shadow: inset 0 0 0 4px #10b981 !important, 0 0 15px rgba(16, 185, 129, 0.6) !important;
|
| 92 |
+
position: relative !important;
|
| 93 |
+
z-index: 9998 !important;
|
| 94 |
+
}
|
| 95 |
+
.xh-selector-selected::after,
|
| 96 |
+
.xh-selector-selected:hover::after {
|
| 97 |
+
content: '✓' !important;
|
| 98 |
+
position: absolute !important;
|
| 99 |
+
top: 8px !important;
|
| 100 |
+
left: 8px !important;
|
| 101 |
+
background: #10b981 !important;
|
| 102 |
+
color: white !important;
|
| 103 |
+
border-radius: 50% !important;
|
| 104 |
+
width: 28px !important;
|
| 105 |
+
height: 28px !important;
|
| 106 |
+
display: flex !important;
|
| 107 |
+
align-items: center !important;
|
| 108 |
+
justify-content: center !important;
|
| 109 |
+
font-weight: bold !important;
|
| 110 |
+
font-size: 16px !important;
|
| 111 |
+
z-index: 2147483647 !important;
|
| 112 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5) !important;
|
| 113 |
+
pointer-events: none !important;
|
| 114 |
+
}
|
| 115 |
+
`;
|
| 116 |
+
document.head.appendChild(style);
|
| 117 |
+
|
| 118 |
+
// Helper to get normalized URLs for matching
|
| 119 |
+
const getCleanUrl = (href) => {
|
| 120 |
+
if (!href) return '';
|
| 121 |
+
let url = href.split('?')[0].split('#')[0].trim();
|
| 122 |
+
if (url.endsWith('/')) {
|
| 123 |
+
url = url.slice(0, -1);
|
| 124 |
+
}
|
| 125 |
+
return url;
|
| 126 |
+
};
|
| 127 |
+
|
| 128 |
+
// Helper to check if an anchor is a thumbnail cover rather than text title (robust and crash-proof)
|
| 129 |
+
const isThumbnailAnchor = (a) => {
|
| 130 |
+
if (!a) return false;
|
| 131 |
+
|
| 132 |
+
// 1. If it contains an image, video, canvas, or thumbnail class-like elements
|
| 133 |
+
if (a.querySelector('img, picture, canvas, video, [class*="thumb"], [class*="img"], [class*="preview"], [class*="cover"]')) return true;
|
| 134 |
+
|
| 135 |
+
// 2. Safe class name parsing (prevent crashes on animated SVG string wrappers)
|
| 136 |
+
let className = '';
|
| 137 |
+
if (typeof a.className === 'string') {
|
| 138 |
+
className = a.className.toLowerCase();
|
| 139 |
+
} else if (a.className && typeof a.className.baseVal === 'string') {
|
| 140 |
+
className = a.className.baseVal.toLowerCase();
|
| 141 |
+
}
|
| 142 |
+
if (className.includes('thumb') || className.includes('img') || className.includes('preview') || className.includes('cover') || className.includes('vimg')) return true;
|
| 143 |
+
|
| 144 |
+
// 3. Fallback: if it has short text content and wraps some tag, it is likely a thumbnail (like XHamster lazy loaders)
|
| 145 |
+
const textLen = a.textContent.trim().length;
|
| 146 |
+
if (textLen < 15 && a.querySelector('*')) return true;
|
| 147 |
+
|
| 148 |
+
return false;
|
| 149 |
+
};
|
| 150 |
+
|
| 151 |
+
const getPostCard = (el) => {
|
| 152 |
+
const card = el.closest('a[href*="/videos/"], a[href*="/shorts/"]');
|
| 153 |
+
if (!card) return null;
|
| 154 |
+
|
| 155 |
+
const url = card.href.toLowerCase();
|
| 156 |
+
// Ignore creator pages, main page directories and creator pagination pages (e.g. /creators/.../shorts/2)
|
| 157 |
+
if (url.includes('/creators/')) return null;
|
| 158 |
+
if (url.endsWith('/shorts') || url.endsWith('/shorts/') || url.endsWith('/videos') || url.endsWith('/videos/')) return null;
|
| 159 |
+
|
| 160 |
+
return card;
|
| 161 |
+
};
|
| 162 |
+
|
| 163 |
+
const getThumbnailAnchorForUrl = (url) => {
|
| 164 |
+
let thumb = null;
|
| 165 |
+
document.querySelectorAll('a[href*="/videos/"], a[href*="/shorts/"]').forEach(a => {
|
| 166 |
+
if (getCleanUrl(a.href) === url) {
|
| 167 |
+
if (isThumbnailAnchor(a)) {
|
| 168 |
+
thumb = a;
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
});
|
| 172 |
+
return thumb;
|
| 173 |
+
};
|
| 174 |
+
|
| 175 |
+
const getVisualTarget = (card) => {
|
| 176 |
+
// Target the parent container of the thumbnail (e.g. .thumb div) instead of the anchor itself
|
| 177 |
+
// so the selection outline and checkmark remain visible even if the anchor is set to display: none on hover.
|
| 178 |
+
return card.closest('.thumb, .vimg, .video-thumb, .image-wrap') || card.parentElement || card;
|
| 179 |
+
};
|
| 180 |
+
|
| 181 |
+
const toggleCardSelection = (url, select) => {
|
| 182 |
+
document.querySelectorAll('a[href*="/videos/"], a[href*="/shorts/"]').forEach(a => {
|
| 183 |
+
if (getCleanUrl(a.href) === url) {
|
| 184 |
+
if (isThumbnailAnchor(a)) {
|
| 185 |
+
const visualTarget = getVisualTarget(a);
|
| 186 |
+
if (select) {
|
| 187 |
+
visualTarget.classList.add('xh-selector-selected');
|
| 188 |
+
visualTarget.classList.remove('xh-selector-hover');
|
| 189 |
+
} else {
|
| 190 |
+
visualTarget.classList.remove('xh-selector-selected');
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
});
|
| 195 |
+
};
|
| 196 |
+
|
| 197 |
+
let isDragging = false;
|
| 198 |
+
let dragMode = null;
|
| 199 |
+
|
| 200 |
+
const mouseOver = (e) => {
|
| 201 |
+
const card = getPostCard(e.target);
|
| 202 |
+
if (card) {
|
| 203 |
+
const url = getCleanUrl(card.href);
|
| 204 |
+
const thumb = getThumbnailAnchorForUrl(url) || card;
|
| 205 |
+
const visualTarget = getVisualTarget(thumb);
|
| 206 |
+
|
| 207 |
+
if (isDragging) {
|
| 208 |
+
e.preventDefault();
|
| 209 |
+
e.stopPropagation();
|
| 210 |
+
|
| 211 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 212 |
+
selectedLinks.add(url);
|
| 213 |
+
toggleCardSelection(url, true);
|
| 214 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 215 |
+
selectedLinks.delete(url);
|
| 216 |
+
toggleCardSelection(url, false);
|
| 217 |
+
}
|
| 218 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 219 |
+
} else {
|
| 220 |
+
if (!visualTarget.classList.contains('xh-selector-selected')) {
|
| 221 |
+
visualTarget.classList.add('xh-selector-hover');
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
};
|
| 226 |
+
|
| 227 |
+
const mouseOut = (e) => {
|
| 228 |
+
const card = getPostCard(e.target);
|
| 229 |
+
if (card) {
|
| 230 |
+
const url = getCleanUrl(card.href);
|
| 231 |
+
const thumb = getThumbnailAnchorForUrl(url) || card;
|
| 232 |
+
const visualTarget = getVisualTarget(thumb);
|
| 233 |
+
visualTarget.classList.remove('xh-selector-hover');
|
| 234 |
+
}
|
| 235 |
+
};
|
| 236 |
+
|
| 237 |
+
const mouseDown = (e) => {
|
| 238 |
+
const card = getPostCard(e.target);
|
| 239 |
+
if (card) {
|
| 240 |
+
e.preventDefault();
|
| 241 |
+
e.stopPropagation();
|
| 242 |
+
isDragging = true;
|
| 243 |
+
|
| 244 |
+
const url = getCleanUrl(card.href);
|
| 245 |
+
|
| 246 |
+
if (selectedLinks.has(url)) {
|
| 247 |
+
dragMode = 'deselect';
|
| 248 |
+
selectedLinks.delete(url);
|
| 249 |
+
toggleCardSelection(url, false);
|
| 250 |
+
} else {
|
| 251 |
+
dragMode = 'select';
|
| 252 |
+
selectedLinks.add(url);
|
| 253 |
+
toggleCardSelection(url, true);
|
| 254 |
+
}
|
| 255 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 256 |
+
}
|
| 257 |
+
};
|
| 258 |
+
|
| 259 |
+
const mouseUp = (e) => {
|
| 260 |
+
isDragging = false;
|
| 261 |
+
dragMode = null;
|
| 262 |
+
};
|
| 263 |
+
|
| 264 |
+
const dragStart = (e) => {
|
| 265 |
+
const card = getPostCard(e.target);
|
| 266 |
+
if (card) {
|
| 267 |
+
e.preventDefault();
|
| 268 |
+
e.stopPropagation();
|
| 269 |
+
}
|
| 270 |
+
};
|
| 271 |
+
|
| 272 |
+
const click = (e) => {
|
| 273 |
+
const card = getPostCard(e.target);
|
| 274 |
+
if (card) {
|
| 275 |
+
e.preventDefault();
|
| 276 |
+
e.stopPropagation();
|
| 277 |
+
}
|
| 278 |
+
};
|
| 279 |
+
|
| 280 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 281 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 282 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 283 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 284 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 285 |
+
document.addEventListener('click', click, true);
|
| 286 |
+
|
| 287 |
+
selectAllBtn.onclick = () => {
|
| 288 |
+
const links = [];
|
| 289 |
+
document.querySelectorAll('a[href*="/videos/"], a[href*="/shorts/"]').forEach(a => {
|
| 290 |
+
const url = a.href.toLowerCase();
|
| 291 |
+
if (!url.includes('/creators/') && !url.endsWith('/shorts') && !url.endsWith('/shorts/') && !url.endsWith('/videos') && !url.endsWith('/videos/')) {
|
| 292 |
+
if (isThumbnailAnchor(a)) {
|
| 293 |
+
links.push(a);
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
});
|
| 297 |
+
|
| 298 |
+
let allSelected = true;
|
| 299 |
+
links.forEach(a => {
|
| 300 |
+
const url = getCleanUrl(a.href);
|
| 301 |
+
if (!selectedLinks.has(url)) {
|
| 302 |
+
allSelected = false;
|
| 303 |
+
}
|
| 304 |
+
});
|
| 305 |
+
|
| 306 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 307 |
+
links.forEach(a => {
|
| 308 |
+
const url = getCleanUrl(a.href);
|
| 309 |
+
selectedLinks.delete(url);
|
| 310 |
+
toggleCardSelection(url, false);
|
| 311 |
+
});
|
| 312 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 313 |
+
} else {
|
| 314 |
+
links.forEach(a => {
|
| 315 |
+
const url = getCleanUrl(a.href);
|
| 316 |
+
if (!selectedLinks.has(url)) {
|
| 317 |
+
selectedLinks.add(url);
|
| 318 |
+
toggleCardSelection(url, true);
|
| 319 |
+
}
|
| 320 |
+
});
|
| 321 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 322 |
+
}
|
| 323 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 324 |
+
};
|
| 325 |
+
|
| 326 |
+
copyBtn.onclick = () => {
|
| 327 |
+
if (selectedLinks.size === 0) return;
|
| 328 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 329 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 330 |
+
const ogText = copyBtn.textContent;
|
| 331 |
+
copyBtn.textContent = '¡Copiados!';
|
| 332 |
+
copyBtn.style.background = '#10b981';
|
| 333 |
+
setTimeout(() => {
|
| 334 |
+
copyBtn.textContent = ogText;
|
| 335 |
+
copyBtn.style.background = '#ef4444';
|
| 336 |
+
}, 2000);
|
| 337 |
+
});
|
| 338 |
+
};
|
| 339 |
+
|
| 340 |
+
closeBtn.onclick = () => {
|
| 341 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 342 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 343 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 344 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 345 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 346 |
+
document.removeEventListener('click', click, true);
|
| 347 |
+
container.remove();
|
| 348 |
+
style.remove();
|
| 349 |
+
document.querySelectorAll('.xh-selector-selected').forEach(el => el.classList.remove('xh-selector-selected'));
|
| 350 |
+
document.querySelectorAll('.xh-selector-hover').forEach(el => el.classList.remove('xh-selector-hover'));
|
| 351 |
+
window.__xhamsterSelectorActive = false;
|
| 352 |
+
|
| 353 |
+
try {
|
| 354 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'xhamster' });
|
| 355 |
+
} catch (e) {
|
| 356 |
+
console.log("Could not notify popup, it is probably closed");
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
window.dispatchEvent(new Event('XH_OFF'));
|
| 360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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
if (window.__xhandSelectorActive) return;
|
| 3 |
+
window.__xhandSelectorActive = true;
|
| 4 |
+
|
| 5 |
+
const selectedLinks = new Set();
|
| 6 |
+
|
| 7 |
+
const container = document.createElement('div');
|
| 8 |
+
container.id = 'xhand-floating-ui';
|
| 9 |
+
container.style.cssText = `
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 20px;
|
| 12 |
+
right: 20px;
|
| 13 |
+
background: #18181b;
|
| 14 |
+
color: #fff;
|
| 15 |
+
padding: 15px;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
border: 1px solid #27272a;
|
| 18 |
+
z-index: 999999;
|
| 19 |
+
font-family: sans-serif;
|
| 20 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
| 21 |
+
display: flex;
|
| 22 |
+
flex-direction: column;
|
| 23 |
+
gap: 10px;
|
| 24 |
+
min-width: 200px;
|
| 25 |
+
`;
|
| 26 |
+
|
| 27 |
+
const countDisplay = document.createElement('div');
|
| 28 |
+
countDisplay.textContent = '0 enlaces seleccionados';
|
| 29 |
+
countDisplay.style.fontWeight = 'bold';
|
| 30 |
+
countDisplay.style.textAlign = 'center';
|
| 31 |
+
countDisplay.style.fontSize = '14px';
|
| 32 |
+
|
| 33 |
+
const selectAllBtn = document.createElement('button');
|
| 34 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 35 |
+
selectAllBtn.style.cssText = `
|
| 36 |
+
background: #3f3f46;
|
| 37 |
+
color: white;
|
| 38 |
+
border: none;
|
| 39 |
+
padding: 8px;
|
| 40 |
+
border-radius: 6px;
|
| 41 |
+
cursor: pointer;
|
| 42 |
+
font-weight: 600;
|
| 43 |
+
font-size: 13px;
|
| 44 |
+
transition: background 0.2s;
|
| 45 |
+
`;
|
| 46 |
+
selectAllBtn.onmouseover = () => selectAllBtn.style.background = '#52525b';
|
| 47 |
+
selectAllBtn.onmouseout = () => selectAllBtn.style.background = '#3f3f46';
|
| 48 |
+
|
| 49 |
+
const copyBtn = document.createElement('button');
|
| 50 |
+
copyBtn.textContent = 'Copiar Enlaces';
|
| 51 |
+
copyBtn.style.cssText = `
|
| 52 |
+
background: #a78bfa;
|
| 53 |
+
color: white;
|
| 54 |
+
border: none;
|
| 55 |
+
padding: 10px;
|
| 56 |
+
border-radius: 6px;
|
| 57 |
+
cursor: pointer;
|
| 58 |
+
font-weight: bold;
|
| 59 |
+
`;
|
| 60 |
+
|
| 61 |
+
const closeBtn = document.createElement('button');
|
| 62 |
+
closeBtn.id = 'xhand-close-btn';
|
| 63 |
+
closeBtn.textContent = 'Cerrar Selector';
|
| 64 |
+
closeBtn.style.cssText = `
|
| 65 |
+
background: #27272a;
|
| 66 |
+
color: white;
|
| 67 |
+
border: 1px solid #3f3f46;
|
| 68 |
+
padding: 8px;
|
| 69 |
+
border-radius: 6px;
|
| 70 |
+
cursor: pointer;
|
| 71 |
+
font-size: 13px;
|
| 72 |
+
`;
|
| 73 |
+
|
| 74 |
+
container.appendChild(countDisplay);
|
| 75 |
+
container.appendChild(selectAllBtn);
|
| 76 |
+
container.appendChild(copyBtn);
|
| 77 |
+
container.appendChild(closeBtn);
|
| 78 |
+
document.body.appendChild(container);
|
| 79 |
+
|
| 80 |
+
const style = document.createElement('style');
|
| 81 |
+
style.id = 'xhand-style';
|
| 82 |
+
style.textContent = `
|
| 83 |
+
.xhand-selector-hover {
|
| 84 |
+
box-shadow: inset 0 0 0 4px #a78bfa !important, 0 0 10px rgba(167, 139, 250, 0.5) !important;
|
| 85 |
+
cursor: crosshair !important;
|
| 86 |
+
transition: all 0.2s;
|
| 87 |
+
position: relative !important;
|
| 88 |
+
z-index: 9999 !important;
|
| 89 |
+
}
|
| 90 |
+
.xhand-selector-selected {
|
| 91 |
+
box-shadow: inset 0 0 0 4px #10b981 !important, 0 0 15px rgba(16, 185, 129, 0.6) !important;
|
| 92 |
+
position: relative !important;
|
| 93 |
+
z-index: 9998 !important;
|
| 94 |
+
}
|
| 95 |
+
.xhand-selector-selected::after,
|
| 96 |
+
.xhand-selector-selected:hover::after {
|
| 97 |
+
content: '✓' !important;
|
| 98 |
+
position: absolute !important;
|
| 99 |
+
top: 8px !important;
|
| 100 |
+
left: 8px !important;
|
| 101 |
+
background: #10b981 !important;
|
| 102 |
+
color: white !important;
|
| 103 |
+
border-radius: 50% !important;
|
| 104 |
+
width: 28px !important;
|
| 105 |
+
height: 28px !important;
|
| 106 |
+
display: flex !important;
|
| 107 |
+
align-items: center !important;
|
| 108 |
+
justify-content: center !important;
|
| 109 |
+
font-weight: bold !important;
|
| 110 |
+
font-size: 16px !important;
|
| 111 |
+
z-index: 2147483647 !important;
|
| 112 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.5) !important;
|
| 113 |
+
pointer-events: none !important;
|
| 114 |
+
}
|
| 115 |
+
`;
|
| 116 |
+
document.head.appendChild(style);
|
| 117 |
+
|
| 118 |
+
// Helper to get normalized URLs for matching
|
| 119 |
+
const getCleanUrl = (href) => {
|
| 120 |
+
if (!href) return '';
|
| 121 |
+
let url = href.trim();
|
| 122 |
+
let clean = url.split('?')[0].split('#')[0].trim();
|
| 123 |
+
if (!clean.endsWith('/')) {
|
| 124 |
+
clean = clean + '/';
|
| 125 |
+
}
|
| 126 |
+
return clean;
|
| 127 |
+
};
|
| 128 |
+
|
| 129 |
+
// Helper to check if an anchor is a thumbnail cover rather than text title (robust and crash-proof)
|
| 130 |
+
const isThumbnailAnchor = (a) => {
|
| 131 |
+
if (!a) return false;
|
| 132 |
+
|
| 133 |
+
// 1. If it contains an image, video, canvas, or thumbnail class-like elements
|
| 134 |
+
if (a.querySelector('img, picture, canvas, video, [class*="thumb"], [class*="img"], [class*="preview"], [class*="cover"]')) return true;
|
| 135 |
+
|
| 136 |
+
// 2. Safe class name parsing (prevent crashes on animated SVG string wrappers)
|
| 137 |
+
let className = '';
|
| 138 |
+
if (typeof a.className === 'string') {
|
| 139 |
+
className = a.className.toLowerCase();
|
| 140 |
+
} else if (a.className && typeof a.className.baseVal === 'string') {
|
| 141 |
+
className = a.className.baseVal.toLowerCase();
|
| 142 |
+
}
|
| 143 |
+
if (className.includes('thumb') || className.includes('img') || className.includes('preview') || className.includes('cover') || className.includes('vimg')) return true;
|
| 144 |
+
|
| 145 |
+
// 3. Fallback: if it has short text content and wraps some tag, it is likely a thumbnail
|
| 146 |
+
const textLen = a.textContent.trim().length;
|
| 147 |
+
if (textLen < 15 && a.querySelector('*')) return true;
|
| 148 |
+
|
| 149 |
+
return false;
|
| 150 |
+
};
|
| 151 |
+
|
| 152 |
+
const getPostCard = (el) => {
|
| 153 |
+
const card = el.closest('a[href*="/videos/"]');
|
| 154 |
+
if (!card) return null;
|
| 155 |
+
|
| 156 |
+
const url = card.href.toLowerCase();
|
| 157 |
+
if (url.endsWith('/videos') || url.endsWith('/videos/')) return null;
|
| 158 |
+
|
| 159 |
+
return card;
|
| 160 |
+
};
|
| 161 |
+
|
| 162 |
+
const getThumbnailAnchorForUrl = (url) => {
|
| 163 |
+
let thumb = null;
|
| 164 |
+
document.querySelectorAll('a[href*="/videos/"]').forEach(a => {
|
| 165 |
+
if (getCleanUrl(a.href) === url) {
|
| 166 |
+
if (isThumbnailAnchor(a)) {
|
| 167 |
+
thumb = a;
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
});
|
| 171 |
+
return thumb;
|
| 172 |
+
};
|
| 173 |
+
|
| 174 |
+
const getVisualTarget = (card) => {
|
| 175 |
+
return card.closest('.thumb, .vimg, .video-thumb, .image-wrap, .card') || card.parentElement || card;
|
| 176 |
+
};
|
| 177 |
+
|
| 178 |
+
const toggleCardSelection = (url, select) => {
|
| 179 |
+
document.querySelectorAll('a[href*="/videos/"]').forEach(a => {
|
| 180 |
+
if (getCleanUrl(a.href) === url) {
|
| 181 |
+
if (isThumbnailAnchor(a)) {
|
| 182 |
+
const visualTarget = getVisualTarget(a);
|
| 183 |
+
if (select) {
|
| 184 |
+
visualTarget.classList.add('xhand-selector-selected');
|
| 185 |
+
visualTarget.classList.remove('xhand-selector-hover');
|
| 186 |
+
} else {
|
| 187 |
+
visualTarget.classList.remove('xhand-selector-selected');
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
});
|
| 192 |
+
};
|
| 193 |
+
|
| 194 |
+
let isDragging = false;
|
| 195 |
+
let dragMode = null;
|
| 196 |
+
|
| 197 |
+
const mouseOver = (e) => {
|
| 198 |
+
const card = getPostCard(e.target);
|
| 199 |
+
if (card) {
|
| 200 |
+
const url = getCleanUrl(card.href);
|
| 201 |
+
const thumb = getThumbnailAnchorForUrl(url) || card;
|
| 202 |
+
const visualTarget = getVisualTarget(thumb);
|
| 203 |
+
|
| 204 |
+
if (isDragging) {
|
| 205 |
+
e.preventDefault();
|
| 206 |
+
e.stopPropagation();
|
| 207 |
+
|
| 208 |
+
if (dragMode === 'select' && !selectedLinks.has(url)) {
|
| 209 |
+
selectedLinks.add(url);
|
| 210 |
+
toggleCardSelection(url, true);
|
| 211 |
+
} else if (dragMode === 'deselect' && selectedLinks.has(url)) {
|
| 212 |
+
selectedLinks.delete(url);
|
| 213 |
+
toggleCardSelection(url, false);
|
| 214 |
+
}
|
| 215 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 216 |
+
} else {
|
| 217 |
+
if (!visualTarget.classList.contains('xhand-selector-selected')) {
|
| 218 |
+
visualTarget.classList.add('xhand-selector-hover');
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
}
|
| 222 |
+
};
|
| 223 |
+
|
| 224 |
+
const mouseOut = (e) => {
|
| 225 |
+
const card = getPostCard(e.target);
|
| 226 |
+
if (card) {
|
| 227 |
+
const url = getCleanUrl(card.href);
|
| 228 |
+
const thumb = getThumbnailAnchorForUrl(url) || card;
|
| 229 |
+
const visualTarget = getVisualTarget(thumb);
|
| 230 |
+
visualTarget.classList.remove('xhand-selector-hover');
|
| 231 |
+
}
|
| 232 |
+
};
|
| 233 |
+
|
| 234 |
+
const mouseDown = (e) => {
|
| 235 |
+
const card = getPostCard(e.target);
|
| 236 |
+
if (card) {
|
| 237 |
+
e.preventDefault();
|
| 238 |
+
e.stopPropagation();
|
| 239 |
+
isDragging = true;
|
| 240 |
+
|
| 241 |
+
const url = getCleanUrl(card.href);
|
| 242 |
+
|
| 243 |
+
if (selectedLinks.has(url)) {
|
| 244 |
+
dragMode = 'deselect';
|
| 245 |
+
selectedLinks.delete(url);
|
| 246 |
+
toggleCardSelection(url, false);
|
| 247 |
+
} else {
|
| 248 |
+
dragMode = 'select';
|
| 249 |
+
selectedLinks.add(url);
|
| 250 |
+
toggleCardSelection(url, true);
|
| 251 |
+
}
|
| 252 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 253 |
+
}
|
| 254 |
+
};
|
| 255 |
+
|
| 256 |
+
const mouseUp = (e) => {
|
| 257 |
+
isDragging = false;
|
| 258 |
+
dragMode = null;
|
| 259 |
+
};
|
| 260 |
+
|
| 261 |
+
const dragStart = (e) => {
|
| 262 |
+
const card = getPostCard(e.target);
|
| 263 |
+
if (card) {
|
| 264 |
+
e.preventDefault();
|
| 265 |
+
e.stopPropagation();
|
| 266 |
+
}
|
| 267 |
+
};
|
| 268 |
+
|
| 269 |
+
const click = (e) => {
|
| 270 |
+
const card = getPostCard(e.target);
|
| 271 |
+
if (card) {
|
| 272 |
+
e.preventDefault();
|
| 273 |
+
e.stopPropagation();
|
| 274 |
+
}
|
| 275 |
+
};
|
| 276 |
+
|
| 277 |
+
document.addEventListener('mouseover', mouseOver, true);
|
| 278 |
+
document.addEventListener('mouseout', mouseOut, true);
|
| 279 |
+
document.addEventListener('mousedown', mouseDown, true);
|
| 280 |
+
window.addEventListener('mouseup', mouseUp, true);
|
| 281 |
+
document.addEventListener('dragstart', dragStart, true);
|
| 282 |
+
document.addEventListener('click', click, true);
|
| 283 |
+
|
| 284 |
+
selectAllBtn.onclick = () => {
|
| 285 |
+
const links = [];
|
| 286 |
+
document.querySelectorAll('a[href*="/videos/"]').forEach(a => {
|
| 287 |
+
const url = a.href.toLowerCase();
|
| 288 |
+
if (!url.endsWith('/videos') && !url.endsWith('/videos/')) {
|
| 289 |
+
if (isThumbnailAnchor(a)) {
|
| 290 |
+
links.push(a);
|
| 291 |
+
}
|
| 292 |
+
}
|
| 293 |
+
});
|
| 294 |
+
|
| 295 |
+
let allSelected = true;
|
| 296 |
+
links.forEach(a => {
|
| 297 |
+
const url = getCleanUrl(a.href);
|
| 298 |
+
if (!selectedLinks.has(url)) {
|
| 299 |
+
allSelected = false;
|
| 300 |
+
}
|
| 301 |
+
});
|
| 302 |
+
|
| 303 |
+
if (allSelected && selectedLinks.size > 0) {
|
| 304 |
+
links.forEach(a => {
|
| 305 |
+
const url = getCleanUrl(a.href);
|
| 306 |
+
selectedLinks.delete(url);
|
| 307 |
+
toggleCardSelection(url, false);
|
| 308 |
+
});
|
| 309 |
+
selectAllBtn.textContent = 'Seleccionar Todos';
|
| 310 |
+
} else {
|
| 311 |
+
links.forEach(a => {
|
| 312 |
+
const url = getCleanUrl(a.href);
|
| 313 |
+
if (!selectedLinks.has(url)) {
|
| 314 |
+
selectedLinks.add(url);
|
| 315 |
+
toggleCardSelection(url, true);
|
| 316 |
+
}
|
| 317 |
+
});
|
| 318 |
+
selectAllBtn.textContent = 'Deseleccionar Todos';
|
| 319 |
+
}
|
| 320 |
+
countDisplay.textContent = selectedLinks.size + ' enlaces seleccionados';
|
| 321 |
+
};
|
| 322 |
+
|
| 323 |
+
copyBtn.onclick = () => {
|
| 324 |
+
if (selectedLinks.size === 0) return;
|
| 325 |
+
const text = Array.from(selectedLinks).join('\n');
|
| 326 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 327 |
+
const ogText = copyBtn.textContent;
|
| 328 |
+
copyBtn.textContent = '¡Copiados!';
|
| 329 |
+
copyBtn.style.background = '#10b981';
|
| 330 |
+
setTimeout(() => {
|
| 331 |
+
copyBtn.textContent = ogText;
|
| 332 |
+
copyBtn.style.background = '#a78bfa';
|
| 333 |
+
}, 2000);
|
| 334 |
+
});
|
| 335 |
+
};
|
| 336 |
+
|
| 337 |
+
closeBtn.onclick = () => {
|
| 338 |
+
document.removeEventListener('mouseover', mouseOver, true);
|
| 339 |
+
document.removeEventListener('mouseout', mouseOut, true);
|
| 340 |
+
document.removeEventListener('mousedown', mouseDown, true);
|
| 341 |
+
window.removeEventListener('mouseup', mouseUp, true);
|
| 342 |
+
document.removeEventListener('dragstart', dragStart, true);
|
| 343 |
+
document.removeEventListener('click', click, true);
|
| 344 |
+
container.remove();
|
| 345 |
+
style.remove();
|
| 346 |
+
document.querySelectorAll('.xhand-selector-selected').forEach(el => el.classList.remove('xhand-selector-selected'));
|
| 347 |
+
document.querySelectorAll('.xhand-selector-hover').forEach(el => el.classList.remove('xhand-selector-hover'));
|
| 348 |
+
window.__xhandSelectorActive = false;
|
| 349 |
+
|
| 350 |
+
try {
|
| 351 |
+
chrome.runtime.sendMessage({ type: 'UI_CLOSED', tool: 'xhand' });
|
| 352 |
+
} catch (e) {
|
| 353 |
+
console.log("Could not notify popup, it is probably closed");
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
window.dispatchEvent(new Event('XHAND_OFF'));
|
| 357 |
+
};
|
| 358 |
+
})();
|
detector de enlaces - copia/src/xvideos/quick_scan.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(() => {
|
| 2 |
+
try {
|
| 3 |
+
const thumbs = document.querySelectorAll('.thumb-block, div[id^="video_"]');
|
| 4 |
+
const results = [];
|
| 5 |
+
const seenUrls = new Set();
|
| 6 |
+
|
| 7 |
+
thumbs.forEach(thumb => {
|
| 8 |
+
const linkEl = thumb.querySelector('a');
|
| 9 |
+
if (!linkEl) return;
|
| 10 |
+
|
| 11 |
+
let href = linkEl.getAttribute('href');
|
| 12 |
+
if (!href) return;
|
| 13 |
+
|
| 14 |
+
// Skip actual image/gallery links if any (though on video tab they should be videos)
|
| 15 |
+
if (href.includes('/gallery') || href.includes('.jpg') || href.includes('.png')) {
|
| 16 |
+
return;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
const postUrl = new URL(href, window.location.origin).href;
|
| 20 |
+
|
| 21 |
+
if (seenUrls.has(postUrl)) return;
|
| 22 |
+
|
| 23 |
+
// Extract title
|
| 24 |
+
const titleEl = thumb.querySelector('p.title a') || thumb.querySelector('.title a') || thumb.querySelector('p a') || thumb.querySelector('img');
|
| 25 |
+
let title = '';
|
| 26 |
+
if (titleEl) {
|
| 27 |
+
if (titleEl.tagName === 'IMG') {
|
| 28 |
+
title = titleEl.getAttribute('alt') || titleEl.getAttribute('title') || '';
|
| 29 |
+
} else {
|
| 30 |
+
title = titleEl.textContent.trim();
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
if (!title) {
|
| 34 |
+
title = "Video XVideos";
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
// Extract thumbnail
|
| 38 |
+
const imgEl = thumb.querySelector('img');
|
| 39 |
+
let thumbnailUrl = '';
|
| 40 |
+
if (imgEl) {
|
| 41 |
+
thumbnailUrl = imgEl.getAttribute('data-src') || imgEl.getAttribute('src') || '';
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
seenUrls.add(postUrl);
|
| 45 |
+
results.push({
|
| 46 |
+
title: title,
|
| 47 |
+
postUrl: postUrl,
|
| 48 |
+
thumbnailUrl: thumbnailUrl
|
| 49 |
+
});
|
| 50 |
+
});
|
| 51 |
+
|
| 52 |
+
// Find max page
|
| 53 |
+
let maxPage = 1;
|
| 54 |
+
const paginationLinks = document.querySelectorAll('.pagination a, .pagination li a, .pagination span');
|
| 55 |
+
paginationLinks.forEach(link => {
|
| 56 |
+
const num = parseInt(link.textContent.trim(), 10);
|
| 57 |
+
if (!isNaN(num) && num > maxPage) {
|
| 58 |
+
maxPage = num;
|
| 59 |
+
}
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
// Construct AJAX Base URL
|
| 63 |
+
const pathParts = window.location.pathname.split('/').filter(Boolean);
|
| 64 |
+
let username = '';
|
| 65 |
+
if (pathParts.length > 0) {
|
| 66 |
+
username = pathParts[0] === 'profiles' ? pathParts[1] : pathParts[0];
|
| 67 |
+
}
|
| 68 |
+
const ajaxBaseUrl = username ? (window.location.origin + '/profiles/' + username + '/videos/uploads/') : '';
|
| 69 |
+
|
| 70 |
+
return {
|
| 71 |
+
videos: results,
|
| 72 |
+
maxPage: maxPage,
|
| 73 |
+
ajaxBaseUrl: ajaxBaseUrl
|
| 74 |
+
};
|
| 75 |
+
} catch(e) {
|
| 76 |
+
return { error: e.message };
|
| 77 |
+
}
|
| 78 |
+
})();
|