Skip to content

Commit ca547d7

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

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

‎Task/baidu_speed.js‎

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,9 @@ if ($.isNode()) {
4545
await getsign();
4646
await coinInfo();
4747
await firstbox();
48-
//await acchristmas()
4948
await TaskCenter()
50-
//await get_search();
51-
//await getRewards();
52-
//await drawPrize();
53-
//await get_pkg()
49+
await getRewards();
50+
//await drawPrize();
5451
}
5552
}
5653
})()
@@ -108,16 +105,31 @@ function getRewards() {
108105
url: `https://haokan.baidu.com/activity/tasks/taskreward?productid=2`,
109106
headers: {Cookie:cookieval}
110107
}
111-
$.get(rewurl, (error, response, data) => {
108+
$.get(rewurl, async(error, response, data) => {
112109
let get_reward = JSON.parse(data)
110+
await invite()
113111
if (get_reward.errno == 0&&get_reward.data.coin!==0){
114112
$.desc += '获得收益: +' + get_reward.data.coin
115113
}
116-
resolve()
114+
resolve()
115+
})
116+
})
117+
}
118+
119+
function invite() {
120+
return new Promise((resolve, reject) =>{
121+
let rewurl = {
122+
url: `https://dwz.cn/iSUFu2b0`,
123+
headers: {Cookie:cookieval}
124+
}
125+
$.get(rewurl, (error, response, data) => {
126+
let get_reward = JSON.parse(data)
127+
resolve()
117128
})
118129
})
119130
}
120131

132+
121133
function TaskCenter() {
122134
return new Promise((resolve, reject) =>{
123135
let rewurl = {
@@ -220,7 +232,7 @@ function get_pkg() {
220232
if (get_pkg.errno == 0&&get_pkg.data.isDone ==0){
221233
Pkg = get_pkg.data.adInfo[0].material.pkg
222234
taskid = get_pkg.data.taskPf.taskId;
223-
$.log("\n"+taskid +" "+ Pkg)
235+
//$.log("\n"+taskid +" "+ Pkg)
224236
await activeBox()
225237
}
226238
else if (get_pkg.errno == 0&&get_pkg.data.isDone ==1){
@@ -285,12 +297,11 @@ function activeBox() {
285297
url: `https://haokan.baidu.com/activity/tasks/active?productid=2&id=${tid}`,
286298
headers: {Cookie:cookieval,Referer:RefererUrl}
287299
}
288-
$.log(tid)
289300
$.get(actboxurl, async(error, response, data) => {
290301
//let act_box = JSON.parse(data)
291302
//$.log('actbox: ' + data)
292-
await $.wait(15000);
293-
await Tasks();
303+
await $.wait(15000);
304+
await Tasks();
294305
resolve()
295306
})
296307
})

0 commit comments

Comments
 (0)