mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 13:16:21 +01:00
Update rumanhua1/rumanhua.js
This commit is contained in:
parent
44ac06e73f
commit
9769569e30
1 changed files with 18 additions and 10 deletions
|
|
@ -5,7 +5,11 @@ async function searchContent(keyword,page=0){
|
|||
};
|
||||
const postData = `k=${encodeURIComponent(keyword)}`;
|
||||
|
||||
const response = await fetch(`http://www.rumanhua1.com/s`, headers, "POST", postData );
|
||||
const response = await fetch(`http://www.rumanhua1.com/s`, {
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
body: postData
|
||||
});
|
||||
const html = await response.text();
|
||||
const results = [];
|
||||
const regex = /<div class="col-auto">[\s\S]*?<a href="([^"]+)"[\s\S]*?<img[^>]*src="([^"]+)"[\s\S]*?<p class="e-title">([^<]+)<\/p>[\s\S]*?<p class="tip">([^<]+)<\/p>/g;
|
||||
|
|
@ -13,11 +17,12 @@ async function searchContent(keyword,page=0){
|
|||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push({
|
||||
id: "http://www.rumanhua1.com" + match[1],
|
||||
imageURL: "http://www.rumanhua1.com" + match[2],
|
||||
imageURL: match[2],
|
||||
title: match[3]
|
||||
});
|
||||
}
|
||||
return JSON.stringify(results);
|
||||
console.log(JSON.stringify(results));
|
||||
return results;
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
|
|
@ -58,21 +63,24 @@ async function getChapters(url) {
|
|||
while ((match = chapterRegex.exec(htmlContent)) !== null) {
|
||||
chapters.push([
|
||||
String(index),
|
||||
[
|
||||
{
|
||||
id: "http://rumanhua1.com" + match[1],
|
||||
scanlation_group: "Rumanhua",
|
||||
title: match[2].trim()
|
||||
title: match[2].trim(),
|
||||
chapter: index,
|
||||
scanlation_group: "Rumanhua"
|
||||
}
|
||||
]
|
||||
]);
|
||||
index++;
|
||||
}
|
||||
|
||||
return {
|
||||
eng: chapters
|
||||
en: chapters
|
||||
};
|
||||
}
|
||||
|
||||
const response = await fetchv2(url);
|
||||
const response = await fetch(url);
|
||||
const data = await response.text();
|
||||
console.log(JSON.stringify(parseHtmlData(data)));
|
||||
return parseHtmlData(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue