Skip to content

Commit 0d13e5d

Browse files
committed
新增:[ jd_opencard0902.py, jd_wxCompleteInfo.py, utils/jdCookie.js]
修改内容:[ TS_USER_AGENTS.ts, jd_CheckCK.js, jd_dpqd.js, jd_inviteFriendsGift.py, jd_jinggengInvite.py, jd_joinCommon_opencard.py, jd_lottery.js, jd_sevenDay.js, jd_shopCollectGift.py, jd_shopLeague_opencard.py, jd_superBrandStar.js, jd_wdz.py, jd_wxBirthGifts.py, jd_wxShopGift.py, utils/USER_AGENTS.js, utils/h5st.ts, utils/jinli_log.ts, utils/mf_log.ts, utils/sendNotify.js]
1 parent 7177bcf commit 0d13e5d

22 files changed

+5108
-14379
lines changed

TS_USER_AGENTS.ts

+21-29
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ function TotalBean(cookie: string) {
5656
}
5757

5858
function getRandomNumberByRange(start: number, end: number) {
59-
end <= start && (end = start + 100)
6059
return Math.floor(Math.random() * (end - start) + start)
6160
}
6261

@@ -120,8 +119,8 @@ async function requireConfig(check: boolean = false): Promise<string[]> {
120119
return cookiesArr
121120
}
122121

123-
async function checkCookie(cookie: string) {
124-
await wait(3000)
122+
async function checkCookie(cookie) {
123+
await wait(1000)
125124
try {
126125
let {data}: any = await axios.get(`https://api.m.jd.com/client.action?functionId=GetJDUserInfoUnion&appid=jd-cphdeveloper-m&body=${encodeURIComponent(JSON.stringify({"orgFlag": "JD_PinGou_New", "callSource": "mainorder", "channel": 4, "isHomewhite": 0, "sceneval": 2}))}&loginType=2&_=${Date.now()}&sceneval=2&g_login_type=1&callback=GetJDUserInfoUnion&g_ty=ls`, {
127126
headers: {
@@ -341,38 +340,31 @@ async function jdpingou() {
341340
return `jdpingou;iPhone;5.19.0;${version};${randomString(40)};network/wifi;model/${device};appBuild/100833;ADID/;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/${getRandomNumberByRange(10, 90)};pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`
342341
}
343342

344-
function get(url: string, headers?: any): Promise<any> {
345-
return new Promise((resolve, reject) => {
346-
axios.get(url, {
347-
headers: headers
348-
}).then(res => {
349-
if (typeof res.data === 'string' && res.data.includes('jsonpCBK')) {
350-
resolve(JSON.parse(res.data.match(/jsonpCBK.?\(([\w\W]*)\);?/)[1]))
343+
function get(url: string, prarms?: string, headers?: any) {
344+
return axios.get(url, {
345+
params: prarms,
346+
headers: headers
347+
})
348+
.then(res => {
349+
if (typeof res.data === 'string' && res.data.match(/^jsonpCBK/)) {
350+
return JSON.parse(res.data.match(/jsonpCBK.?\(([\w\W]*)\);/)[1])
351351
} else {
352-
resolve(res.data)
352+
return res.data
353353
}
354-
}).catch(err => {
355-
reject({
356-
code: err?.response?.status || -1,
357-
msg: err?.response?.statusText || err.message || 'error'
358-
})
359354
})
360-
})
355+
.catch(err => {
356+
console.log(err?.response?.status, err?.response?.statusText)
357+
});
361358
}
362359

363360
function post(url: string, prarms?: string | object, headers?: any): Promise<any> {
364-
return new Promise((resolve, reject) => {
365-
axios.post(url, prarms, {
366-
headers: headers
367-
}).then(res => {
368-
resolve(res.data)
369-
}).catch(err => {
370-
reject({
371-
code: err?.response?.status || -1,
372-
msg: err?.response?.statusText || err.message || 'error'
373-
})
374-
})
361+
return axios.post(url, prarms, {
362+
headers: headers
375363
})
364+
.then(res => res.data)
365+
.catch(err => {
366+
console.log(err?.response?.status, err?.response?.statusText)
367+
});
376368
}
377369

378370
export default USER_AGENT
@@ -396,4 +388,4 @@ export {
396388
jdpingou,
397389
get,
398390
post
399-
}
391+
}

jd_CheckCK.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
cron "30 2-22/2 * * *" jd_CheckCK.js, tag:京东CK检测by-ccwav
2+
京东CK检测
3+
cron:30 * * * *
34
*/
4-
//详细说明参考 https://github.com/ccwav/QLScript2.
55
const $ = new Env('京东CK检测');
66
const notify = $.isNode() ? require('./sendNotify') : '';
77
//Node.js用户请在jdCookie.js处填写京东ck;
@@ -138,15 +138,15 @@ if ($.isNode() && process.env.CHECKCK_ALLNOTIFY) {
138138
}
139139

140140
for (let i = 0; i < envs.length; i++) {
141-
if (envs[i].value) {
141+
if (envs[i].value) {
142142
var tempid=0;
143143
if(envs[i]._id){
144144
tempid=envs[i]._id;
145145
}
146146
if(envs[i].id){
147147
tempid=envs[i].id;
148148
}
149-
cookie = await getEnvById(tempid);
149+
cookie = await getEnvById(tempid);
150150
$.UserName = (cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
151151
$.UserName2 = decodeURIComponent($.UserName);
152152
$.index = i + 1;
@@ -194,7 +194,7 @@ if ($.isNode() && process.env.CHECKCK_ALLNOTIFY) {
194194
ReturnMessageTitle = `【账号${IndexAll}🆔】${$.UserName2}`;
195195
}
196196

197-
//await TotalBean();
197+
await TotalBean();
198198
if ($.NoReturn) {
199199
console.log(`接口1检测失败,尝试使用接口2....\n`);
200200
await isLoginByX1a0He();
@@ -472,7 +472,7 @@ if ($.isNode() && process.env.CHECKCK_ALLNOTIFY) {
472472
console.log(allMessage);
473473
if (strAllNotify)
474474
allMessage += `\n` + strAllNotify;
475-
475+
476476
await notify.sendNotify(`${$.name}`, `${allMessage}`, {
477477
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
478478
})

jd_dpqd.js

+46-35
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,50 @@
11
/*
2-
店铺签到,各类店铺签到,有新的店铺直接添加token即可
3-
============Quantumultx===============
4-
[task_local]
5-
#店铺签到
6-
15 2,14 * * * https://raw.githubusercontent.com/===4===/KR/main/jd_shop_sign.js, tag=店铺签到, enabled=true
7-
===========Loon============
8-
[Script]
9-
cron "15 2,14 * * *" script-path=https://raw.githubusercontent.com/===4===/KR/main/jd_shop_sign.js,tag=店铺签到
10-
============Surge=============
11-
店铺签到 = type=cron,cronexp="15 2,14 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/===4===/KR/main/jd_shop_sign.js
12-
===========小火箭========
13-
店铺签到 = type=cron,script-path=https://raw.githubusercontent.com/===4===/KR/main/jd_shop_sign.jss, cronexpr="15 2,14 * * *", timeout=3600, enable=true
2+
cron 45 0 0,23 * * * jd_dpqd.js
3+
店铺签到,店铺Token默认从本地环境变量DPQDTK中获取,若本地无则从远端获取。
4+
5+
Fix by HarbourJ
6+
TG: https://t.me/HarbourToulu
7+
8+
环境变量:
9+
DPQDTK: token1&token2
10+
仓库不再提供token
1411
*/
12+
13+
let token = []
14+
if (process.env.DPQDTK) {
15+
if (process.env.DPQDTK.includes('\n')) {
16+
token = [...process.env.DPQDTK.split('\n'),...token]
17+
} else {
18+
token = [...process.env.DPQDTK.split('&'),...token]
19+
}
20+
}
21+
22+
if (!token.length) {
23+
console.log('无本地店铺签到token, 尝试获取远端店铺签到token')
24+
token = [
25+
'EEE3CE0E98CAA371BF548D1A78A88D46',
26+
'0903CFF8DCB8B5A701D911BEEBF285F3',
27+
'B555EE1A9313D0DFD3074C2DE96604AC',
28+
'D727A06C3B3DF203AF5D21510B771D07',
29+
'466E9758EF90135CC36DDE1D804FA682',
30+
'8BFBEC50A0469627A70E706579855B25',
31+
'AF71DCCF9801F55C06D1EDB1E5D5C32A',
32+
'19DB0FE23AA9DC4864A9375CB7526362',
33+
'82052AC19BA3734BF2F5E7E91B283537',
34+
'BCBF4EE738A35FFC62745CB7FD5FFE12',
35+
'91DF93C32D9AA63043391C00C14431EE',
36+
'EA2128634865A07EFBBAC88F995E0765',
37+
'71DEC5804B8E333A9DAA0BF16EC6C8EB',
38+
'62AF2584588CFE5CC26C8F3D6EBBEDD7',
39+
'6F79CE75B2D272EBC34718C6C07CB63B',
40+
'75196DED685B6BF6EB7B55FBD9E45A77',
41+
'93C049896859A8BA43DF7AAEF841DA87',
42+
'5E75F128888B2002D54A69A92BCE64AB',
43+
'19DB0FE23AA9DC4864A9375CB7526362',
44+
'AF71DCCF9801F55C06D1EDB1E5D5C32A',
45+
]
46+
}
47+
console.log(token)
1548
const $ = new Env('店铺签到');
1649
const notify = $.isNode() ? require('./sendNotify') : '';
1750
//Node.js用户请在jdCookie.js处填写京东ck;
@@ -24,28 +57,6 @@ let activityId=''
2457
let vender=''
2558
let num=0
2659
let shopname=''
27-
const token = [
28-
"1F00BB7363612C2383557E0270B2970E",
29-
"91A41C0A7B4F22EDF887D47F168555FD",
30-
"26DB859B3FE57E3C6361B892264BB055",
31-
"ED130D17BCE3FA96DAD611A2A2ABD170",
32-
"8500B16BACB6E88500C0F24A1106EF26",
33-
"B8F0FA48DDC739BA4F5AEF821BFE9121",
34-
"E2BBCFB0AB8EC48F003B86C4323E2717",
35-
"07E913C217F4A260A2525793769E0FA7",
36-
"E92431BDF2EE7E630C48B4FB1E440427",
37-
"F30279867E8D74DF33E90DAC33738165",
38-
"B8F0FA48DDC739BA4F5AEF821BFE9121",
39-
"D07F1272CA61B9D4FD45082B19DADC54",
40-
"10D78DB822E2A8F13816A601E5729367",
41-
"7BE092260D85D71FC6F02F797C2C5FE8",
42-
"75E907EE0108AA1658692B8180C6CB02",
43-
"8500B16BACB6E88500C0F24A1106EF26",
44-
"A91FA0869F8D6DC14D824F85176BFAC0",
45-
"B70A83AD9737E1B3DD78FC1A69F35323",
46-
"0CE352C49E77D6354F8F12DD5D6745ED",
47-
"ED130D17BCE3FA96DAD611A2A2ABD170"
48-
]
4960

5061
if ($.isNode()) {
5162
Object.keys(jdCookieNode).forEach((item) => {
@@ -75,7 +86,7 @@ if ($.isNode()) {
7586
$.isLogin = true;
7687
$.nickName = '';
7788
message = '';
78-
//await TotalBean();
89+
await TotalBean();
7990
console.log(`\n******开始【京东账号${$.index}${$.nickName || $.UserName}*********\n`);
8091
if (!$.isLogin) {
8192
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});

jd_inviteFriendsGift.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from jdCookie import get_cookies
2222
getCk = get_cookies()
2323
except:
24-
print("请先下载依赖脚本,\n下载链接:https://raw.githubusercontent.com/555555/faker2/main/jdCookie.py")
24+
print("请先下载依赖脚本,\n下载链接:https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py")
2525
sys.exit(3)
2626
print = partial(print, flush=True)
2727
activatyname = '邀请赢大礼'

jd_jinggengInvite.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from jdCookie import get_cookies
3434
getCk = get_cookies()
3535
except:
36-
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/555555/faker2/main/jdCookie.py")
36+
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py")
3737
sys.exit(3)
3838
redis_url = os.environ.get("redis_url") if os.environ.get("redis_url") else "172.17.0.1"
3939
redis_pwd = os.environ.get("redis_pwd") if os.environ.get("redis_pwd") else ""

jd_joinCommon_opencard.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from jdCookie import get_cookies
3535
getCk = get_cookies()
3636
except:
37-
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/555555/faker2/main/jdCookie.py")
37+
print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py")
3838
sys.exit(3)
3939

4040
redis_url = os.environ.get("redis_url") if os.environ.get("redis_url") else "172.17.0.1"

0 commit comments

Comments
 (0)