mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 08:27:24 +00:00
picacg: re-login if login expires while loading comic information
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
"name": "Picacg",
|
"name": "Picacg",
|
||||||
"fileName": "picacg.js",
|
"fileName": "picacg.js",
|
||||||
"key": "picacg",
|
"key": "picacg",
|
||||||
"version": "1.0.0"
|
"version": "1.0.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nhentai",
|
"name": "nhentai",
|
||||||
|
14
picacg.js
14
picacg.js
@@ -3,7 +3,7 @@ class Picacg extends ComicSource {
|
|||||||
|
|
||||||
key = "picacg"
|
key = "picacg"
|
||||||
|
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
|
|
||||||
minAppVersion = "1.0.0"
|
minAppVersion = "1.0.0"
|
||||||
|
|
||||||
@@ -445,7 +445,17 @@ class Picacg extends ComicSource {
|
|||||||
})
|
})
|
||||||
return comics
|
return comics
|
||||||
}
|
}
|
||||||
let [info, eps, related] = await Promise.all([infoLoader(), epsLoader(), relatedLoader()])
|
let info, eps, related
|
||||||
|
try {
|
||||||
|
[info, eps, related] = await Promise.all([infoLoader(), epsLoader(), relatedLoader()])
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
if (e === 'Invalid status code: 401') {
|
||||||
|
await this.account.reLogin();
|
||||||
|
[info, eps, related] = await Promise.all([infoLoader(), epsLoader(), relatedLoader()]);
|
||||||
|
}
|
||||||
|
throw e
|
||||||
|
}
|
||||||
let tags = {}
|
let tags = {}
|
||||||
if(info.author) {
|
if(info.author) {
|
||||||
tags['Author'] = [info.author];
|
tags['Author'] = [info.author];
|
||||||
|
Reference in New Issue
Block a user