mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
a0ec0f5b24
commit
eb096222b0
22
jd_coupon.js
22
jd_coupon.js
@ -32,13 +32,14 @@ if ($.isNode()) {
|
||||
console.log("优惠劵失败...")
|
||||
return;
|
||||
}
|
||||
if (codeList.length === 0) {
|
||||
$.randomCode = random(10, 13);
|
||||
// console.log($.randomCode)
|
||||
// console.log(codeList.length)
|
||||
if (codeList.length <= 1) {
|
||||
console.log("暂无优惠劵...")
|
||||
return;
|
||||
}
|
||||
// console.log(codeList)
|
||||
|
||||
|
||||
if ($.randomCode === 10){
|
||||
console.log("优惠券地址: https://u.jd.com/"+codeList[0])
|
||||
|
||||
$.jfurl = "https://u.jd.com/"+codeList[0]
|
||||
@ -51,12 +52,11 @@ if ($.isNode()) {
|
||||
await getShorttoLong()
|
||||
console.log("\n---- 执行 ----")
|
||||
|
||||
// cookiesArr = cookiesArr.sort(function() {
|
||||
// return .5 - Math.random();
|
||||
// });
|
||||
let ckNum = cookiesArr.length > 5 ? 5 : cookiesArr.length;
|
||||
// console.log(ckNum)
|
||||
for (let i = 0; i < ckNum; i++) {
|
||||
cookiesArr = cookiesArr.sort(function() {
|
||||
return .5 - Math.random();
|
||||
});
|
||||
// let ckNum = cookiesArr.length > 1 ? 1 : cookiesArr.length;
|
||||
for (let i = 0; i < 1; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
cookie = cookiesArr[i];
|
||||
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||
@ -82,7 +82,7 @@ if ($.isNode()) {
|
||||
await $.wait(4000);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})().catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user