mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 08:27:24 +00:00
[nhentai] fix tag and title
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
"name": "nhentai",
|
"name": "nhentai",
|
||||||
"fileName": "nhentai.js",
|
"fileName": "nhentai.js",
|
||||||
"key": "nhentai",
|
"key": "nhentai",
|
||||||
"version": "1.0.2"
|
"version": "1.0.3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "紳士漫畫",
|
"name": "紳士漫畫",
|
||||||
|
13
nhentai.js
13
nhentai.js
@@ -7,7 +7,7 @@ class Nhentai extends ComicSource {
|
|||||||
// unique id of the source
|
// unique id of the source
|
||||||
key = "nhentai"
|
key = "nhentai"
|
||||||
|
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
|
|
||||||
minAppVersion = "1.0.0"
|
minAppVersion = "1.0.0"
|
||||||
|
|
||||||
@@ -183,7 +183,8 @@ class Nhentai extends ComicSource {
|
|||||||
}
|
}
|
||||||
category = category.replaceAll(" ", "-")
|
category = category.replaceAll(" ", "-")
|
||||||
let sort = (options[0] || "popular").replaceAll("@", "-")
|
let sort = (options[0] || "popular").replaceAll("@", "-")
|
||||||
let url = `${this.baseUrl}/${param}/${category}${sort}?page=${page}`
|
category = category.replaceAll('.', '-');
|
||||||
|
let url = `${this.baseUrl}/${param}/${encodeURIComponent(category)}${sort}?page=${page}`
|
||||||
let res = await Network.get(url, {})
|
let res = await Network.get(url, {})
|
||||||
return this.parseComicList(res.body)
|
return this.parseComicList(res.body)
|
||||||
},
|
},
|
||||||
@@ -305,8 +306,12 @@ class Nhentai extends ComicSource {
|
|||||||
}
|
}
|
||||||
let document = new HtmlDocument(res.body)
|
let document = new HtmlDocument(res.body)
|
||||||
let cover = document.querySelector("div#cover > a > img").attributes["data-src"];
|
let cover = document.querySelector("div#cover > a > img").attributes["data-src"];
|
||||||
let title = document.querySelector("h1.title").text;
|
let title = document.querySelector("h2.title")?.text;
|
||||||
let subtitle = document.querySelector("h2.subtitle")?.text;
|
let subtitle = document.querySelector("h1.title").text;
|
||||||
|
if(!title) {
|
||||||
|
title = subtitle
|
||||||
|
subtitle = null
|
||||||
|
}
|
||||||
let tags = new Map();
|
let tags = new Map();
|
||||||
let uploadTime = new Date(Date.parse(document.querySelector("time")?.attributes["datetime"]))
|
let uploadTime = new Date(Date.parse(document.querySelector("time")?.attributes["datetime"]))
|
||||||
let formatTime = (time) => {
|
let formatTime = (time) => {
|
||||||
|
Reference in New Issue
Block a user