mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 13:16:21 +01:00
Add dev/mangadev.js
This commit is contained in:
parent
9769569e30
commit
ba5b2437f6
1 changed files with 77 additions and 0 deletions
77
dev/mangadev.js
Normal file
77
dev/mangadev.js
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
async function searchContent(keyword, page=0) {
|
||||
const results = [];
|
||||
try {
|
||||
const regex = /REGEX_PATTERN/g;
|
||||
|
||||
let match;
|
||||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push({
|
||||
id: match[1].trim(),
|
||||
imageURL: match[2].trim(),
|
||||
title: match[3].trim()
|
||||
});
|
||||
}
|
||||
|
||||
return results;
|
||||
} catch (err) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
try {
|
||||
const regex = /REGEX_PATTERN/g;
|
||||
|
||||
return {
|
||||
description: "",
|
||||
tags: []
|
||||
};
|
||||
} catch (err) {
|
||||
return {
|
||||
description: "Error",
|
||||
tags: []
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const regex = /REGEX_PATTERN/g;
|
||||
let match;
|
||||
let index = 0;
|
||||
|
||||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push([
|
||||
String(index),
|
||||
[{
|
||||
id: match[1].trim(),
|
||||
title: match[2].trim(),
|
||||
chapter: index,
|
||||
scanlation_group: ""
|
||||
}]
|
||||
]);
|
||||
index++;
|
||||
}
|
||||
|
||||
return { en: results };
|
||||
} catch (err) {
|
||||
return { en: [] };
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const regex = /REGEX_PATTERN/g;
|
||||
|
||||
let match;
|
||||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push(match[1].trim());
|
||||
}
|
||||
|
||||
return results;
|
||||
} catch (err) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue