Skip to content

Commit 6631290

Browse files
authored
Update jukan.js
1 parent 0539a95 commit 6631290

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

Task/jukan.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const $ = new Env('聚看点')
1212
let CookieArr=[],BodyArr=[];
1313
let cookie = $.getdata('jukan_ck')
1414
let bodys = $.getdata('jukan_body')
15+
let UA = 'QianZhuan/60.0.6 (iPhone; iOS 13.7; Scale/3.00)'
1516

1617
if ($.isNode()) {
1718
if (process.env.JUKAN_COOKIE && process.env.JUKAN_COOKIE.indexOf('&') > -1) {
@@ -76,6 +77,8 @@ if (typeof $request !== 'undefined') {
7677
cookieval = CookieArr[i]
7778
bodyval = BodyArr[i]
7879
ID = decodeURIComponent(bodyval).match(/"openid" : "\w+"/)
80+
apptoken = decodeURIComponent(bodyval).match(/"apptoken" : "\w+"/)
81+
$.log(apptoken)
7982
bodys = [bodyval,bodyval.replace(/time%22%20%3A%20%22\d+/, 'cateid%22%20:%20%2253')]
8083
$.index = i + 1;
8184
await getsign();
@@ -94,7 +97,7 @@ function getsign() {
9497
return new Promise((resolve, reject) =>{
9598
let signurl = {
9699
url: `https://www.xiaodouzhuan.cn/jkd/user/usersign.action`,
97-
headers: {Cookie:cookieval},
100+
headers: {Cookie:cookieval,'User-Agent':UA},
98101
body: bodyval
99102
}
100103
$.post(signurl, async(error, response, data) => {
@@ -126,7 +129,7 @@ function userinfo() {
126129
return new Promise((resolve, reject) =>{
127130
let infourl = {
128131
url: `https://www.xiaodouzhuan.cn/jkd/newMobileMenu/infoMe.action`,
129-
headers: {Cookie:cookieval},
132+
headers: {Cookie:cookieval,'User-Agent':UA},
130133
body: bodyval
131134
}
132135
$.post(infourl, async(error, resp, data) => {
@@ -144,33 +147,32 @@ function userinfo() {
144147
}
145148
function artList() {
146149
return new Promise((resolve, reject) =>{
147-
148150
let infourl = {
149151
url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artlist.action`,
150-
headers: {Cookie:cookieval},
152+
headers: {Cookie:cookieval,'User-Agent':UA},
151153
body: readbodyVal
152154
}
153-
//$.log(infourl.body)
154155
$.post(infourl, async(error, resp, data) => {
155156
let get_list = JSON.parse(data)
156157
//$.log( data)
157158
$.log("【开始自动阅读】")
158159
if (get_list.ret == "ok"){
159160
for( lists of get_list.artlist){
160-
if(lists.item_type=="article"){
161161
art_Title = lists.art_title
162162
artid =lists.art_id
163163
screen_Name = lists.screen_name
164+
if(lists.item_type=="article"){
165+
arttype = "1"
164166
$.log("正在阅读文章: "+art_Title +" -------- <"+screen_Name +">\n ")
165-
await readTask(lists.art_id,lists.open_url)
167+
await readTask(lists.art_id,arttype)
166168
}
167169
if(lists.item_type=="video"){
168-
art_Title = lists.art_title
169-
artid =lists.art_id
170-
screen_Name = lists.screen_name
171-
artvideo = 1
170+
arttype = "2"
172171
$.log("正在观看视频: "+art_Title +" -------- <"+screen_Name +">\n ")
173-
await readTask(lists.art_id,lists.open_url)
172+
await readTask(lists.art_id,arttype)
173+
}
174+
if(taskresult == `R-ART-1002`|| taskresult ==`R-ART-0017`){
175+
break
174176
}
175177
}
176178
}
@@ -180,17 +182,18 @@ function artList() {
180182
}
181183

182184

183-
function readTask(artid,readurl) {
185+
function readTask(artid,arttype) {
184186
return new Promise((resolve, reject) =>{
185187
let rewurl = {
186188
url: `https://www.xiaodouzhuan.cn/jkd/newmobile/artDetail.action`,
187-
headers: {Cookie:cookieval},
188-
body: `jsondata={ "appid" : "xzwl", "channel" : "IOS-qianzhuan", "psign" : "0cf94b87f584dfc81a87fa74dcb3757f", "appversioncode" : "6006", "time" : "1609293915", "relate" : 1, "requestid" : "1609293912717038", "artid" : "${artid}", "os" : "IOS",${ID}, "apptoken" : "xzwltoken070704", "appversion" : "60.0.6"}`
189+
headers: {Cookie:cookieval,'User-Agent':UA},
190+
body: `jsondata={"appid":"xzwl","channel":"IOS-qianzhuan","psign":"0cf94b87f584dfc81a87fa74dcb3757f","relate":1,"artid":"${artid}","os":"IOS",${ID},${apptoken},"appversion":"60.0.6"}`
189191
}
190192
$.post(rewurl, async(error, resp, data) => {
193+
//$.log(data)
191194
if(resp.statusCode ==200){
192-
await $.wait(30000)
193-
await finishTask(artid)
195+
await $.wait(32000)
196+
await finishTask(artid,arttype)
194197
} else {
195198
$.log("阅读失败: "+data)
196199
}
@@ -199,20 +202,19 @@ function readTask(artid,readurl) {
199202
})
200203
}
201204

202-
function finishTask(artid) {
205+
function finishTask(artid,arttype) {
203206
return new Promise((resolve, reject) =>{
204207
let finishurl = {
205208
url: `https://www.xiaodouzhuan.cn/jkd/account/readAccount.action`,
206-
headers: {Cookie:cookieval},
207-
body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":1,"channel":"IOS-qianzhuan","apptoken":"xzwltoken070704","appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}`
209+
headers: {Cookie:cookieval,'User-Agent':UA}, body: `jsondata={"read_weal":"0","appid":"xzwl","paytype":${arttype},"channel":"IOS-qianzhuan",${apptoken},"appversion":"60.0.6",${ID},"os":"iOS","artid":"${artid}","readmodel":"1"}`
208210
}
209211
$.post(finishurl, async(error, response, data) => {
210212
$.log(data+"\n")
211213
let do_read = JSON.parse(data)
214+
taskresult = do_read.rtn_code
212215
if (do_read.ret == "ok"){
213216
$.log("获得收益: +"+do_read.profit +"\n")
214-
// $.desc += '获得总收益: +' + get_reward.data.coin
215-
//await invite()
217+
// $.desc += '获得总收益: +' +
216218
}
217219
resolve()
218220
})

0 commit comments

Comments
 (0)