Skip to content

Commit f69bb69

Browse files
author
Leaf
committed
更新多用户,修复签到翻倍
1 parent 3827faa commit f69bb69

4 files changed

Lines changed: 215 additions & 88 deletions

File tree

‎jctq/jctq_daily.js‎

Lines changed: 59 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ let notifyStr = ''
1616
let rndtime = "" //毫秒
1717
let httpResult //global buffer
1818

19+
let userCookie = ''
20+
1921
let jctqCookie = ($.isNode() ? process.env.jctqCookie : $.getdata('jctqCookie')) || '';
2022
let jctqBubbleBody = ($.isNode() ? process.env.jctqBubbleBody : $.getdata('jctqBubbleBody')) || '';
2123
let jctqGiveBoxBody = ($.isNode() ? process.env.jctqGiveBoxBody : $.getdata('jctqGiveBoxBody')) || '';
2224

25+
let jctqCookieArr = []
2326
let jctqBubbleBodyArr = []
2427
let jctqGiveBoxBodyArr = []
2528

@@ -39,20 +42,28 @@ let refRotory = 'https://tq.xunsl.com/html/rotaryTable/index.html?keyword_wyq=wo
3942
{
4043
await checkEnv()
4144

42-
await queryShareStatus()
43-
await $.wait(1000)
44-
45-
await queryGiveBoxStatus()
46-
await $.wait(1000)
47-
48-
await queryBubbleStatus()
49-
await $.wait(1000)
45+
numBoxbody = jctqCookieArr.length
46+
console.log(`找到${numBoxbody}个cookie`)
5047

51-
await getTaskListByWeather()
52-
await $.wait(1000)
53-
54-
await queryRotaryTable()
55-
await $.wait(1000)
48+
for(let i=0; i<numBoxbody; i++) {
49+
console.log(`============= 账户${i+1} =============`)
50+
userCookie = jctqCookieArr[i]
51+
52+
await queryShareStatus()
53+
await $.wait(1000)
54+
55+
await queryGiveBoxStatus()
56+
await $.wait(1000)
57+
58+
await queryBubbleStatus()
59+
await $.wait(1000)
60+
61+
await getTaskListByWeather()
62+
await $.wait(1000)
63+
64+
await queryRotaryTable()
65+
await $.wait(1000)
66+
}
5667
}
5768

5869

@@ -78,19 +89,14 @@ async function showmsg() {
7889
async function checkEnv() {
7990

8091
if(jctqCookie) {
81-
if(jctqCookie.indexOf('@') > -1) {
82-
jctqCookies = jctqCookie.split('@')
83-
jctqCookie = jctqCookies[0]
84-
console.log('检测到多于一个jctqCookie,开始跑第一个账户。请注意本脚本只支持单账户,如需多账户请自行修改。')
85-
}
86-
if(jctqCookie.indexOf('cookie=') == -1 && jctqCookie.indexOf('zqkey=') > -1) {
87-
jctqCookie = jctqCookie.replace(/zqkey=/, "cookie=")
88-
}
89-
if(jctqCookie.indexOf('cookie_id=') == -1 && jctqCookie.indexOf('zqkey_id=') > -1) {
90-
jctqCookie = jctqCookie.replace(/zqkey_id=/, "cookie_id=")
91-
}
92-
if(jctqCookie.indexOf('app_version=') == -1) {
93-
jctqCookie = 'app_version=8.3.7&' + jctqCookie
92+
if(jctqCookie.indexOf('&') > -1) {
93+
let jctqCookies = jctqCookie.split('@')
94+
for(let i=0; i<jctqCookies.length; i++) {
95+
jctqCookieArr.push(replaceCookie(jctqCookies[i]))
96+
}
97+
} else {
98+
99+
jctqCookieArr.push(replaceCookie(jctqCookie))
94100
}
95101
}
96102

@@ -117,13 +123,26 @@ async function checkEnv() {
117123
}
118124
}
119125

126+
function replaceCookie(jctqCookieItem) {
127+
if(jctqCookieItem.indexOf('cookie=') == -1 && jctqCookieItem.indexOf('zqkey=') > -1) {
128+
jctqCookieItem = jctqCookieItem.replace(/zqkey=/, "cookie=")
129+
}
130+
if(jctqCookieItem.indexOf('cookie_id=') == -1 && jctqCookieItem.indexOf('zqkey_id=') > -1) {
131+
jctqCookieItem = jctqCookieItem.replace(/zqkey_id=/, "cookie_id=")
132+
}
133+
if(jctqCookieItem.indexOf('app_version=') == -1) {
134+
jctqCookieItem = 'app_version=8.3.7&' + jctqCookieItem
135+
}
136+
return jctqCookieItem
137+
}
138+
120139
///////////////////////////////////////////////////////////////////
121140

122141
//时段转发以及转发页面红包冷却查询 -- 30分钟一次
123142
async function queryShareStatus() {
124143
let caller = printCaller()
125144
let url = 'http://tq.xunsl.com/WebApi/ShareNew/bereadExtraList'
126-
let urlObject = populatePostUrl(url,refHotShare,jctqCookie)
145+
let urlObject = populatePostUrl(url,refHotShare,userCookie)
127146
await httpPost(urlObject,caller)
128147
let result = httpResult;
129148
if(!result) return
@@ -182,7 +201,7 @@ async function queryShareStatus() {
182201
async function getRewardShareBox() {
183202
let caller = printCaller()
184203
let url = 'http://tq.xunsl.com/WebApi/TimePacket/getReward'
185-
let urlObject = populatePostUrl(url,refHotShare,jctqCookie)
204+
let urlObject = populatePostUrl(url,refHotShare,userCookie)
186205
await httpPost(urlObject,caller)
187206
let result = httpResult;
188207
if(!result) return
@@ -198,7 +217,7 @@ async function getRewardShareBox() {
198217
async function listsNewTag() {
199218
let caller = printCaller()
200219
let url = 'http://tq.xunsl.com/WebApi/ArticleTop/listsNewTag'
201-
let urlObject = populatePostUrl(url,refHotShare,jctqCookie)
220+
let urlObject = populatePostUrl(url,refHotShare,userCookie)
202221
await httpPost(urlObject,caller)
203222
let result = httpResult;
204223
if(!result) return
@@ -219,7 +238,7 @@ async function listsNewTag() {
219238
async function getShareArticleReward(articleId) {
220239
let caller = printCaller()
221240
let url = 'http://tq.xunsl.com/WebApi/ShareNew/getShareArticleReward'
222-
let reqBody = jctqCookie + '&article_id=' + articleId
241+
let reqBody = userCookie + '&article_id=' + articleId
223242
let urlObject = populatePostUrl(url,refHotShare,reqBody)
224243
await httpPost(urlObject,caller)
225244
let result = httpResult;
@@ -238,7 +257,7 @@ async function getShareArticleReward(articleId) {
238257
async function execExtractTask(action,name) {
239258
let caller = printCaller()
240259
let url = 'http://tq.xunsl.com/WebApi/ShareNew/execExtractTask'
241-
let reqBody = jctqCookie + '&action=' + action
260+
let reqBody = userCookie + '&action=' + action
242261
let urlObject = populatePostUrl(url,refHotShare,reqBody)
243262
await httpPost(urlObject,caller)
244263
let result = httpResult;
@@ -254,7 +273,7 @@ async function execExtractTask(action,name) {
254273
//首页气泡红包查询
255274
async function queryBubbleStatus() {
256275
let caller = printCaller()
257-
let url = 'https://tq.xunsl.com/v17/weather/index.json?' + jctqCookie
276+
let url = 'https://tq.xunsl.com/v17/weather/index.json?' + userCookie
258277
let urlObject = populateGetUrl(url,refHotShare)
259278
await httpGet(urlObject,caller)
260279
let result = httpResult;
@@ -307,7 +326,7 @@ async function getRewardBubble(bubbleBodyItem) {
307326
//福利页面定时宝箱查询
308327
async function queryGiveBoxStatus() {
309328
let caller = printCaller()
310-
let url = 'https://tq.xunsl.com/v17/Weather/getBoxByweather.json?' + jctqCookie
329+
let url = 'https://tq.xunsl.com/v17/Weather/getBoxByweather.json?' + userCookie
311330
let urlObject = populateGetUrl(url,refHotShare)
312331
await httpGet(urlObject,caller)
313332
let result = httpResult;
@@ -367,7 +386,7 @@ async function queryRotaryTable() {
367386
rndtime = Math.floor(new Date().getTime())
368387
let caller = printCaller()
369388
let url = 'https://tq.xunsl.com/WebApi/RotaryTable/getData?_='+rndtime
370-
let urlObject = populatePostUrl(url,refRotory,jctqCookie)
389+
let urlObject = populatePostUrl(url,refRotory,userCookie)
371390
await httpPost(urlObject,caller)
372391
let result = httpResult;
373392
if(!result) return
@@ -404,7 +423,7 @@ async function chestReward(idx) {
404423
rndtime = Math.floor(new Date().getTime())
405424
let caller = printCaller()
406425
let url = 'https://tq.xunsl.com/WebApi/RotaryTable/chestReward?_='+rndtime
407-
let reqBody = jctqCookie + '&num=' + idx
426+
let reqBody = userCookie + '&num=' + idx
408427
let urlObject = populatePostUrl(url,refRotory,reqBody)
409428
await httpPost(urlObject,caller)
410429
let result = httpResult;
@@ -422,7 +441,7 @@ async function turnRotary() {
422441
rndtime = Math.floor(new Date().getTime())
423442
let caller = printCaller()
424443
let url = 'https://tq.xunsl.com/WebApi/RotaryTable/turnRotary?_='+rndtime
425-
let urlObject = populatePostUrl(url,refRotory,jctqCookie)
444+
let urlObject = populatePostUrl(url,refRotory,userCookie)
426445
await httpPost(urlObject,caller)
427446
let result = httpResult;
428447
if(!result) return
@@ -437,7 +456,7 @@ async function turnRotary() {
437456
//查询日常任务进度
438457
async function getTaskListByWeather() {
439458
let caller = printCaller()
440-
let url = 'https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json?' + jctqCookie
459+
let url = 'https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json?' + userCookie
441460
let urlObject = populateGetUrl(url,refHotShare)
442461
await httpGet(urlObject,caller)
443462
let result = httpResult;
@@ -465,7 +484,7 @@ async function getTaskListByWeather() {
465484
//刷福利视频
466485
async function recordVideoNum() {
467486
let caller = printCaller()
468-
let url = 'https://tq.xunsl.com/V17/NewTask/recordNum.json?' + jctqCookie
487+
let url = 'https://tq.xunsl.com/V17/NewTask/recordNum.json?' + userCookie
469488
let urlObject = populateGetUrl(url,refHotShare)
470489
await httpGet(urlObject,caller)
471490
let result = httpResult;
@@ -488,7 +507,7 @@ function populatePostUrl(url,referer,reqBody){
488507
'device-platform' : 'android',
489508
'Connection' : 'keep-alive',
490509
'app-type' : 'jcweather',
491-
'Referer' : referer + jctqCookie,
510+
'Referer' : referer + userCookie,
492511
},
493512
body: reqBody
494513
}
@@ -505,7 +524,7 @@ function populateGetUrl(url,referer){
505524
'device-platform' : 'android',
506525
'Connection' : 'keep-alive',
507526
'app-type' : 'jcweather',
508-
'Referer' : referer + jctqCookie,
527+
'Referer' : referer + userCookie,
509528
}
510529
}
511530
return urlObject;

0 commit comments

Comments
 (0)