Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -527,8 +527,9 @@ async function nhentai(url) {
|
|
| 527 |
console.log(jsonData);
|
| 528 |
|
| 529 |
const imgList = jsonData.images.pages.map((_, index) => ({
|
| 530 |
-
|
| 531 |
-
|
|
|
|
| 532 |
|
| 533 |
const imagePaths = await downloadImageNhs(imgList, tempDir, instanceID);
|
| 534 |
const pdfPath = await createPDF(imagePaths, instanceID, tempDir);
|
|
@@ -549,6 +550,9 @@ async function nhentai(url) {
|
|
| 549 |
|
| 550 |
async function downloadImageNh(image, tempDir, instanceID) {
|
| 551 |
const servers = [
|
|
|
|
|
|
|
|
|
|
| 552 |
"https://i5.nhentai.net",
|
| 553 |
"https://i3.nhentai.net",
|
| 554 |
"https://i7.nhentai.net"
|
|
|
|
| 527 |
console.log(jsonData);
|
| 528 |
|
| 529 |
const imgList = jsonData.images.pages.map((_, index) => ({
|
| 530 |
+
path: `https://i5.nhentai.net/galleries/${jsonData.media_id}/${index + 1}.${jsonData.images.pages[index].t === "w" ? "webp" : jsonData.images.pages[index].t === "p" ? "png" : "jpg"}`
|
| 531 |
+
}));
|
| 532 |
+
|
| 533 |
|
| 534 |
const imagePaths = await downloadImageNhs(imgList, tempDir, instanceID);
|
| 535 |
const pdfPath = await createPDF(imagePaths, instanceID, tempDir);
|
|
|
|
| 550 |
|
| 551 |
async function downloadImageNh(image, tempDir, instanceID) {
|
| 552 |
const servers = [
|
| 553 |
+
"https://i1.nhentai.net",
|
| 554 |
+
"https://i2.nhentai.net",
|
| 555 |
+
"https://i4.nhentai.net",
|
| 556 |
"https://i5.nhentai.net",
|
| 557 |
"https://i3.nhentai.net",
|
| 558 |
"https://i7.nhentai.net"
|