mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 08:27:24 +00:00
[baozi] Fix login and comic loading
This commit is contained in:
13
baozi.js
13
baozi.js
@@ -5,7 +5,7 @@ class Baozi extends ComicSource {
|
|||||||
// 唯一标识符
|
// 唯一标识符
|
||||||
key = "baozi"
|
key = "baozi"
|
||||||
|
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
|
|
||||||
minAppVersion = "1.0.0"
|
minAppVersion = "1.0.0"
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class Baozi extends ComicSource {
|
|||||||
/// 登录
|
/// 登录
|
||||||
/// 返回任意值表示登录成功
|
/// 返回任意值表示登录成功
|
||||||
login: async (account, pwd) => {
|
login: async (account, pwd) => {
|
||||||
let res = await Network.post("https://cn.baozimh.com/api/bui/signin", {
|
let res = await Network.post(`${this.baseUrl}/api/bui/signin`, {
|
||||||
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryFUNUxpOwyUaDop8s'
|
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryFUNUxpOwyUaDop8s'
|
||||||
}, "------WebKitFormBoundaryFUNUxpOwyUaDop8s\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\n" + account + "\r\n------WebKitFormBoundaryFUNUxpOwyUaDop8s\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n" + pwd + "\r\n------WebKitFormBoundaryFUNUxpOwyUaDop8s--\r\n")
|
}, "------WebKitFormBoundaryFUNUxpOwyUaDop8s\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\n" + account + "\r\n------WebKitFormBoundaryFUNUxpOwyUaDop8s\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n" + pwd + "\r\n------WebKitFormBoundaryFUNUxpOwyUaDop8s--\r\n")
|
||||||
if(res.status !== 200) {
|
if(res.status !== 200) {
|
||||||
@@ -258,7 +258,8 @@ class Baozi extends ComicSource {
|
|||||||
let cover = document.querySelector("div.l-content > div > div > amp-img").attributes['src']
|
let cover = document.querySelector("div.l-content > div > div > amp-img").attributes['src']
|
||||||
let author = document.querySelector("h2.comics-detail__author").text.trim()
|
let author = document.querySelector("h2.comics-detail__author").text.trim()
|
||||||
let tags = document.querySelectorAll("div.tag-list > span").map(e => e.text.trim())
|
let tags = document.querySelectorAll("div.tag-list > span").map(e => e.text.trim())
|
||||||
let updateTime = document.querySelector("div.supporting-text > div > span > em").text.trim().replace('(', '').replace(')', '')
|
tags = [...tags.filter(e => e !== "")]
|
||||||
|
let updateTime = document.querySelector("div.supporting-text > div > span > em")?.text.trim().replace('(', '').replace(')', '')
|
||||||
let description = document.querySelector("p.comics-detail__desc").text.trim()
|
let description = document.querySelector("p.comics-detail__desc").text.trim()
|
||||||
let chapters = new Map()
|
let chapters = new Map()
|
||||||
let i = 0
|
let i = 0
|
||||||
@@ -270,6 +271,12 @@ class Baozi extends ComicSource {
|
|||||||
chapters.set(i.toString(), c.text.trim())
|
chapters.set(i.toString(), c.text.trim())
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
if (i === 0) {
|
||||||
|
for(let c of document.querySelectorAll("div.comics-chapters > a > div > span")) {
|
||||||
|
chapters.set(i.toString(), c.text.trim())
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
}
|
||||||
let recommend = []
|
let recommend = []
|
||||||
for(let c of document.querySelectorAll("div.recommend--item")) {
|
for(let c of document.querySelectorAll("div.recommend--item")) {
|
||||||
if(c.querySelectorAll("div.tag-comic").length > 0) {
|
if(c.querySelectorAll("div.tag-comic").length > 0) {
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
"name": "包子漫画",
|
"name": "包子漫画",
|
||||||
"fileName": "baozi.js",
|
"fileName": "baozi.js",
|
||||||
"key": "baozi",
|
"key": "baozi",
|
||||||
"version": "1.0.2"
|
"version": "1.0.3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Picacg",
|
"name": "Picacg",
|
||||||
|
Reference in New Issue
Block a user