Skip to content

Commit e27249d

Browse files
authored
Update baidu_speed.js
1 parent bd23ec8 commit e27249d

1 file changed

Lines changed: 24 additions & 25 deletions

File tree

‎Task/baidu_speed.js‎

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@ if ($.isNode()) {
4242
if (CookieArr[i]) {
4343
cookieval = CookieArr[i];
4444
$.index = i + 1;
45-
}
4645
await getsign();
4746
await coinInfo();
4847
await firstbox();
49-
await TaskCenter();
48+
//await acchristmas()
49+
await TaskCenter()
5050
//await get_search();
5151
//await getRewards();
5252
//await drawPrize();
5353
//await get_pkg()
54-
}
55-
})()
54+
}
55+
}
56+
})()
5657
.catch((e) => $.logErr(e))
5758
.finally(() => $.done())
5859

@@ -129,19 +130,15 @@ function TaskCenter() {
129130
//$.log("获取任务数据"+data)
130131
tasks = get_tasks.data.comps
131132
for ( x in tasks){
132-
taskid = tasks[x].taskId
133+
//taskid = tasks[x].taskId
133134
id = tasks[x].id
134-
if(id ==1069){
135-
token = tasks[x].data.btn[0].iosAdUrl.split("?")[1]
136-
}
137-
if(id ==962){
135+
if(id == 962){
138136
for (jingangs of tasks[x].data.jingang_list_ios ){
139137
if(jingangs.jingangType==2){
140138
tid = jingangs.jingangTid
141139
taskName = '【'+jingangs.jingangName+'】'
142140
RefererUrl = jingangs.jingangUrl
143141
$.log(taskName+"tid:"+tid)
144-
//$.log(tasks[x].data.countDown[tid].countDown)
145142
if ($.isNode()){
146143
await $.wait(1000)
147144
await get_pkg();
@@ -154,23 +151,24 @@ else if(tasks[x].data.countDown[tid].countDown ==0){
154151
}
155152
}
156153
}
157-
} else if(id ==1076){
158-
for ( tasklists of tasks[x].data.tasklist){
159-
tid = tasklists.id
160-
taskName = tasklists.title
154+
} else {
155+
let taskArr = tasks[x].data.tasklist
156+
for (y in taskArr){
157+
tid = taskArr[y].id
158+
taskName = taskArr[y].title
161159
$.log(taskName+" tid:"+tid)
162-
if(tasklists.type == 'openApp'){
163-
RefererUrl = tasklists.adLink
160+
if(taskArr[y].type == 'openApp'){
161+
RefererUrl = taskArr[y].adLink
164162
await get_pkg()
165163
}
166-
if(tasklists.type == 'watch'){
164+
if(taskArr[y].type == 'watch'){
167165
// $.log(tasklists.+'\n')
168-
cmd = tid==346 ? 100:184
166+
cmd = tid==346 ? 100:184
169167
await get_search()
170-
};
168+
};
171169
}
172170
}
173-
}
171+
}
174172
} catch(e){
175173
$.logErr(e, resp);
176174
} finally {
@@ -218,11 +216,11 @@ function get_pkg() {
218216
}
219217
$.get(pkgurl, async(error, resp, data) => {
220218
let get_pkg = JSON.parse(data)
221-
//$.log("数据: "+data+'\n')
219+
// $.log("数据: "+data+'\n')
222220
if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){
223221
Pkg = get_pkg.data.adInfo[0].material.pkg
224222
taskid = get_pkg.data.taskPf.taskId;
225-
// $.log("\n"+taskid +" "+ Pkg)
223+
$.log("\n"+taskid +" "+ Pkg)
226224
await activeBox()
227225
}
228226
else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){
@@ -285,8 +283,9 @@ function activeBox() {
285283
return new Promise((resolve, reject) =>{
286284
let actboxurl = {
287285
url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`,
288-
headers: {Cookie:cookieval,Referer: 'https://eopa.baidu.com/page/pagekey-ASKWNd8W?productid=2&type=1&tid=${tid}'}
286+
headers: {Cookie:cookieval,Referer:RefererUrl}
289287
}
288+
$.log(tid)
290289
$.get(actboxurl, async(error, response, data) => {
291290
//let act_box = JSON.parse(data)
292291
//$.log('actbox: ' + data)
@@ -306,7 +305,7 @@ function Tasks() {
306305
}
307306
$.get(taskurl, async(error, response, data) => {
308307
let do_task = JSON.parse(data)
309-
await $.wait(15000);
308+
await $.wait(30000);
310309
//$.log(data+'\n')
311310
if (do_task.errno == 0){
312311
$.desc += taskName + "获得收益"+ do_task.data.coin +"\n"
@@ -359,7 +358,7 @@ function searchBox(id) {
359358
$.post(searchurl, async(error, resp, data) => {
360359
let do_search = JSON.parse(data)
361360
//$.log(data+'\n')
362-
if (do_search.errno == 0 && do_search.data[`197`].istip == 1) {
361+
if (do_search.errno == 0 && do_search.data['197'].istip == 1) {
363362
$.log(" 获得收益: " +do_search.data[`197`].tips+'\n')
364363
//$.desc += do_search.data[`197`].tips +"\n"
365364
} else {

0 commit comments

Comments
 (0)