Skip to content

Commit

Permalink
更新逻辑,修复解码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm2060 authored and yingziwu committed Feb 27, 2024
1 parent 2202057 commit 71b85e4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/rules/special/original/jjwxc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ export class Jjwxc extends BaseRuleClass {
// "chapterIds"
// );
chapterGetInfoUrl +=
"&versionCode=349&token=" + sid ;
"&versionCode=349&token=" + sid;
} else {
throw new Error(
`当前需要手动捕获android版app token,详见github主页说明`
Expand All @@ -1009,19 +1009,24 @@ export class Jjwxc extends BaseRuleClass {
_GM_xmlhttpRequest({
url: url,
headers: {
// accept: "application/json",
// accept: "application/json",
referer: "http://android.jjwxc.net?v=349",
// not_tip: "updateTime",
// not_tip: "updateTime",
"user-agent": "Dalvik/2.1.0",
// "accept-encoding": "gzip",
// "accept-encoding": "gzip",
},
method: "GET",
onload: function (response) {
if (response.status === 200) {
retryTime = 0;
if (isVIP) {
const decodeResponseText = decodeVIPResopnce(response.responseHeaders, String(response.responseText));
let decodeResponseText = String(response.responseText);
let resultI = JSON.parse('{"message":"try again!"}');
try {
resultI = JSON.parse(decodeResponseText);
} catch (e) {
decodeResponseText = decodeVIPResopnce(response.responseHeaders, String(response.responseText));
}
try {
resultI = JSON.parse(decodeResponseText);
} catch (e) {
Expand Down Expand Up @@ -1050,8 +1055,8 @@ export class Jjwxc extends BaseRuleClass {
retryTime++;
if (retryTime > retryLimit) {
retryTime = 0;
log.error(`请求${chapterGetInfoUrl.toString() }$失败`);
throw new Error(`请求${chapterGetInfoUrl.toString() }$失败`);
log.error(`请求${chapterGetInfoUrl.toString()}$失败`);
throw new Error(`请求${chapterGetInfoUrl.toString()}$失败`);
}
result = await getChapterInfo(chapterGetInfoUrl.toString());
}
Expand Down

0 comments on commit 71b85e4

Please sign in to comment.