mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +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 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 html = await response.text();
|
||||||
const results = [];
|
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;
|
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) {
|
while ((match = regex.exec(html)) !== null) {
|
||||||
results.push({
|
results.push({
|
||||||
id: "http://www.rumanhua1.com" + match[1],
|
id: "http://www.rumanhua1.com" + match[1],
|
||||||
imageURL: "http://www.rumanhua1.com" + match[2],
|
imageURL: match[2],
|
||||||
title: match[3]
|
title: match[3]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return JSON.stringify(results);
|
console.log(JSON.stringify(results));
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getContentData(url) {
|
async function getContentData(url) {
|
||||||
|
|
@ -58,21 +63,24 @@ async function getChapters(url) {
|
||||||
while ((match = chapterRegex.exec(htmlContent)) !== null) {
|
while ((match = chapterRegex.exec(htmlContent)) !== null) {
|
||||||
chapters.push([
|
chapters.push([
|
||||||
String(index),
|
String(index),
|
||||||
{
|
[
|
||||||
id: "http://rumanhua1.com" + match[1],
|
{
|
||||||
scanlation_group: "Rumanhua",
|
id: "http://rumanhua1.com" + match[1],
|
||||||
title: match[2].trim()
|
title: match[2].trim(),
|
||||||
}
|
chapter: index,
|
||||||
|
scanlation_group: "Rumanhua"
|
||||||
|
}
|
||||||
|
]
|
||||||
]);
|
]);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
eng: chapters
|
en: chapters
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetchv2(url);
|
const response = await fetch(url);
|
||||||
const data = await response.text();
|
const data = await response.text();
|
||||||
console.log(JSON.stringify(parseHtmlData(data)));
|
console.log(JSON.stringify(parseHtmlData(data)));
|
||||||
return parseHtmlData(data);
|
return parseHtmlData(data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue