替换获取pt_pin的正则,解决部分cookie填写不规范获取用户名为null的情况

This commit is contained in:
lxk0301
2021-03-24 15:27:58 +08:00
parent 7751d21b63
commit d00eb6a81f
95 changed files with 99 additions and 3720 deletions

View File

@ -64,7 +64,7 @@ const JD_API_HOST = 'https://lkyl.dianpusoft.cn/api';
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1])
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
@ -87,11 +87,11 @@ const JD_API_HOST = 'https://lkyl.dianpusoft.cn/api';
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.token = $.helpToken[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1])
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
if ($.newShareCodes.length > 1) {
console.log('----', (i + 1) % $.newShareCodes.length)
let code = $.newShareCodes[(i + 1) % $.newShareCodes.length]['code']
console.log(`\n${$.UserName} 去给自己的下一账号 ${decodeURIComponent($.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=(.+?);/) && $.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=(.+?);/)[1])}助力,助力码为 ${code}\n`)
console.log(`\n${$.UserName} 去给自己的下一账号 ${decodeURIComponent($.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=([^; ]+)(?=;?)/) && $.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=([^; ]+)(?=;?)/)[1])}助力,助力码为 ${code}\n`)
await createAssistUser(code, $.createAssistUserID);
}
console.log(`\n去帮助作者:LXK9301\n`)