Nexchan commited on
Commit
bce427e
1 Parent(s): 7dc9cea

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -3
index.js CHANGED
@@ -103,7 +103,7 @@ async function komiku_download(url) {
103
  const imagePaths = await downloadImages(imgList, tempDir, instanceID);
104
  const pdfPath = await createPDF(imagePaths, instanceID, tempDir);
105
 
106
- return { path: `/static/${instanceID}.pdf`, title: title };
107
  } catch (error) {
108
  console.log(error);
109
  throw error;
@@ -188,7 +188,7 @@ async function nhentai(url) {
188
  const jsonString = scriptContent.match(/JSON\.parse\("(.*)"\)/)[1];
189
  const decodedString = jsonString.replace(/\\u0022/g, '"').replace(/\\u005C/g, '\\');
190
  const jsonData = JSON.parse(decodedString);
191
- //console.log(jsonData)
192
 
193
  const imgList = [];
194
  for (let i = 0; i < jsonData.images.pages.length; i++) {
@@ -199,7 +199,7 @@ async function nhentai(url) {
199
  const pdfPath = await createPDF(imagePaths, instanceID, tempDir);
200
 
201
  console.log(`PDF berhasil dibuat: ${pdfPath}`);
202
- return { path: pdfPath, result: jsonData };
203
  } catch (error) {
204
  console.log(error);
205
  throw error;
 
103
  const imagePaths = await downloadImages(imgList, tempDir, instanceID);
104
  const pdfPath = await createPDF(imagePaths, instanceID, tempDir);
105
 
106
+ return { url: "https://arashicode-komik.hf.space/static/" + instanceID + ".pdf", path: `/static/${instanceID}.pdf`, title: title };
107
  } catch (error) {
108
  console.log(error);
109
  throw error;
 
188
  const jsonString = scriptContent.match(/JSON\.parse\("(.*)"\)/)[1];
189
  const decodedString = jsonString.replace(/\\u0022/g, '"').replace(/\\u005C/g, '\\');
190
  const jsonData = JSON.parse(decodedString);
191
+ console.log(jsonData)
192
 
193
  const imgList = [];
194
  for (let i = 0; i < jsonData.images.pages.length; i++) {
 
199
  const pdfPath = await createPDF(imagePaths, instanceID, tempDir);
200
 
201
  console.log(`PDF berhasil dibuat: ${pdfPath}`);
202
+ return { url: "https://arashicode-komik.hf.space/static/" + instanceID + ".pdf", path: pdfPath, result: jsonData };
203
  } catch (error) {
204
  console.log(error);
205
  throw error;