From ca8b3acee6f2cf50457535e082ee6e6169a9cb70 Mon Sep 17 00:00:00 2001 From: Pacalini <141402887+Pacalini@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:49:06 +0800 Subject: [PATCH 1/2] ehentai: fix normal thumbnails --- ehentai.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ehentai.js b/ehentai.js index 999e966..a3babc9 100644 --- a/ehentai.js +++ b/ehentai.js @@ -710,14 +710,10 @@ class Ehentai extends ComicSource { } images.push(url) } - for(let e of document.querySelectorAll("div.gt200 > a > div").map((e) => e.children[0])) { + for(let e of document.querySelectorAll("div.gt200 > a > div")) { let style = e.attributes['style']; let r = style.split("background:transparent url(")[1] let url = r.split(")")[0] - if(r.includes('px')) { - let position = Number(r.split(') -')[1].split('px')[0]) - url += `@x=${position}-${position + 100}` - } images.push(url) } } From 7b06398e144c7b16c8f3fe7ea81434daee3efd83 Mon Sep 17 00:00:00 2001 From: Pacalini <141402887+Pacalini@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:52:03 +0800 Subject: [PATCH 2/2] ehentai: handle thumbnail labeling --- ehentai.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ehentai.js b/ehentai.js index a3babc9..37305ee 100644 --- a/ehentai.js +++ b/ehentai.js @@ -710,10 +710,15 @@ class Ehentai extends ComicSource { } images.push(url) } - for(let e of document.querySelectorAll("div.gt200 > a > div")) { + for(let e of document.querySelectorAll("div.gt200 > a > div") + .map(e => e.children.length === 0 ? e : e.children[0])) { let style = e.attributes['style']; let r = style.split("background:transparent url(")[1] let url = r.split(")")[0] + if(r.includes('px')) { + let position = Number(r.split(') -')[1].split('px')[0]) + url += `@x=${position}-${position + 100}` + } images.push(url) } }