Code update
This commit is contained in:
@@ -24,7 +24,7 @@ async function get_gallery(galleryid) {
|
|||||||
|
|
||||||
Array.from(doc.querySelectorAll('#lang-list a')).forEach(elm => lang_list[elm.innerText] = elm.getAttribute('href').slice(11, -5));
|
Array.from(doc.querySelectorAll('#lang-list a')).forEach(elm => lang_list[elm.innerText] = elm.getAttribute('href').slice(11, -5));
|
||||||
|
|
||||||
const cover = doc.querySelector('.cover img').src.replace('bigtn', 'webpbigtn').replace(/.jpg$/, '.webp');
|
const cover = replace_jpg_tn(doc.querySelector('.cover img').src);
|
||||||
|
|
||||||
const title = doc.querySelector('.gallery h1 a').innerText;
|
const title = doc.querySelector('.gallery h1 a').innerText;
|
||||||
const artists = Array.from(doc.querySelectorAll('.gallery h2 a'), elm => elm.innerText);
|
const artists = Array.from(doc.querySelectorAll('.gallery h2 a'), elm => elm.innerText);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ async function get_gallery_block(galleryid) {
|
|||||||
const gallery_url = title_elm.href;
|
const gallery_url = title_elm.href;
|
||||||
const title = title_elm.textContent;
|
const title = title_elm.textContent;
|
||||||
|
|
||||||
const thumbnails = Array.from(doc.querySelectorAll('.dj-img-cont img'), elm => `https:${elm.getAttribute('data-src').replace('bigtn', 'webpbigtn').replace(/.jpg$/, '.webp')}`);
|
const thumbnails = Array.from(doc.querySelectorAll('.dj-img-cont img'), elm => replace_jpg_tn(elm.getAttribute('data-src')));
|
||||||
|
|
||||||
const artists = Array.from(doc.querySelectorAll('.artist-list a'), elm => elm.innerText);
|
const artists = Array.from(doc.querySelectorAll('.artist-list a'), elm => elm.innerText);
|
||||||
const series = Array.from(doc.querySelectorAll('a[href^="/series/"]'), elm => elm.innerText);
|
const series = Array.from(doc.querySelectorAll('a[href^="/series/"]'), elm => elm.innerText);
|
||||||
|
|||||||
@@ -61,4 +61,10 @@ function do_search(query) {
|
|||||||
put_results_on_page();
|
put_results_on_page();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function replace_jpg_tn(tn) {
|
||||||
|
if (tn.endsWith('jpg')) tn = tn.replace('bigtn', 'webpbigtn').replace(/jpg$/, 'webp');
|
||||||
|
|
||||||
|
return `https:${tn}`
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
0.0.7-DEV06
|
0.0.7-DEV07
|
||||||
Reference in New Issue
Block a user