diff --git a/index.json b/index.json index fcf643f..e7d461e 100644 --- a/index.json +++ b/index.json @@ -21,7 +21,7 @@ "name": "Picacg", "fileName": "picacg.js", "key": "picacg", - "version": "1.0.0" + "version": "1.0.1" }, { "name": "nhentai", diff --git a/picacg.js b/picacg.js index 2a496b5..3948fb1 100644 --- a/picacg.js +++ b/picacg.js @@ -3,7 +3,7 @@ class Picacg extends ComicSource { key = "picacg" - version = "1.0.0" + version = "1.0.1" minAppVersion = "1.0.0" @@ -445,7 +445,17 @@ class Picacg extends ComicSource { }) 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 = {} if(info.author) { tags['Author'] = [info.author];