Skip to content

Commit ba3ccca

Browse files
committed
fix
1 parent 5df4fb2 commit ba3ccca

17 files changed

+2969
-2382
lines changed

config.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"jd_jxred": [9,13,20],
3+
"jd_super_redrain": 1,
34
"jd_fruit":[6, 12 ,18],
45
"jx_sign": [8, 13],
56
"jd_bean_sign": [0],
@@ -42,7 +43,6 @@
4243
"jd_shop": [0],
4344
"jd_sign_graphics": [5],
4445
"jd_speed_redpocke": [0, 22],
45-
"jd_superBrand": [9,13,16,19,20],
4646
"jd_superMarket": [6, 8, 10, 12, 14, 16, 18, 20, 22],
4747
"jd_tyt": [6, 10, 14, 18, 22],
4848
"jd_wish": [1, 3],
@@ -59,15 +59,17 @@
5959
"jd_daily_egg": 1,
6060
"jd_xsqjd":[10,23],
6161
"jd_ys":[2,3],
62+
"jd_jump":[0, 21],
6263
"jd_selectionOfficer": [10],
6364
"jd_carnivalcity_help": [2,10],
64-
"jd_lol": [10],
6565
"jd_qjd": [2,22],
6666
"jd_cjhz": [5,23],
6767
"jd_nnfls": [10,20],
6868
"jd_sjjc": [10,20],
6969
"jd_dqmh": [10],
7070
"jd_xtg": [3,4],
71+
"jd_vivo": [3,9,16],
72+
"jd_travel_shop": [3],
7173
"jd_bean_change": [17],
7274
"jd_jdfactory": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
7375
"jd_speed_sign": [11],

jd_carnivalcity.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function headInfo() {
137137
if (data.data.taskType === "13" || data.data.taskType === "15") {
138138
console.log(`开始 【顶部】浏览任务,需等待6秒`)
139139
await doBrowseHead(data.data.taskIndex, data.data.taskId, data.data.taskType)
140-
} else if (data.data.taskType === "14") {
140+
} else if (data.data.taskType === "14" && ["car","card"].includes(process.env.FS_LEVEL)) {
141141
console.log(`开始 【顶部】加购任务`)
142142
await getHeadJoinPrize(data.data.taskId, data.data.taskIndex)
143143
}
@@ -594,8 +594,7 @@ async function doHelp() {
594594
}
595595
}
596596
//助力API
597-
toHelp()
598-
function toHelp(code='05a5a96f-5fe9-4f8f-a6ec-e349d72662e5') {
597+
function toHelp(code) {
599598
return new Promise(resolve => {
600599
const body = {"shareId":code,"apiMapping":"/khc/task/doSupport"}
601600
$.post(taskUrl(body), (err, resp, data) => {

jd_cfd.js

+17-7
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ if ($.isNode()) {
8080
await $.wait(2000);
8181
}
8282
}
83+
8384
$.strMyShareIds = ['7B3EB02C2F929E3EA7021FC2A4223F720D34C6176E92DA34C067C0BBCE3B7045']
8485
await shareCodesFormat()
8586
for (let i = 0; i < cookiesArr.length; i++) {
@@ -294,9 +295,17 @@ function GetPropCardCenterInfo() {
294295
break;
295296
}
296297
}
297-
if (!$.canuse) console.log(`无可用道具卡\n`)
298+
for (let key of Object.keys(data.cardInfo.richcard)) {
299+
let vo = data.cardInfo.richcard[key]
300+
if (vo.dwCardNums > 0) {
301+
$.canuse = true;
302+
await UsePropCard(vo.strCardTypeIndex)
303+
break;
304+
}
305+
}
306+
if (!$.canuse) console.log(`无可用道具卡`)
298307
} else {
299-
console.log(`有在使用中的道具卡,跳过使用\n`)
308+
console.log(`有在使用中的道具卡,跳过使用`)
300309
}
301310
}
302311
}
@@ -320,9 +329,9 @@ function UsePropCard(strCardTypeIndex) {
320329
data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]);
321330
if (data.iRet === 0) {
322331
let cardName = strCardTypeIndex.split("_")[1];
323-
console.log(`使用道具卡【${cardName}】成功\n`)
332+
console.log(`使用道具卡【${cardName}】成功`)
324333
} else {
325-
console.log(`使用道具卡失败:${JSON.stringify(data)}\n`)
334+
console.log(`使用道具卡失败:${JSON.stringify(data)}`)
326335
}
327336
}
328337
} catch (e) {
@@ -610,7 +619,7 @@ async function getTakeAggrPage(type) {
610619
console.log(`${$.name} GetTakeAggrPage API请求失败,请检查网路重试`)
611620
} else {
612621
data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]);
613-
console.log(`领助力奖励`)
622+
console.log(`\n领助力奖励`)
614623
let helpNum = []
615624
for (let key of Object.keys(data.Data.Employee.EmployeeList)) {
616625
let vo = data.Data.Employee.EmployeeList[key]
@@ -1480,6 +1489,7 @@ function taskListUrl(function_path, body = '', bizCode = 'jxbfd') {
14801489
"Host": "m.jingxi.com",
14811490
"Accept": "*/*",
14821491
"Accept-Encoding": "gzip, deflate, br",
1492+
"User-Agent": UA,
14831493
"Accept-Language": "zh-CN,zh-Hans;q=0.9",
14841494
"Referer": "https://st.jingxi.com/",
14851495
"Cookie": cookie
@@ -1539,7 +1549,7 @@ function readShareCode() {
15391549
resolve(data);
15401550
}
15411551
})
1542-
await $.wait(10000);
1552+
await $.wait(30 * 1000);
15431553
resolve()
15441554
})
15451555
}
@@ -1573,7 +1583,7 @@ function uploadShareCode(code) {
15731583
resolve(data);
15741584
}
15751585
})
1576-
await $.wait(10000);
1586+
await $.wait(30 * 1000);
15771587
resolve()
15781588
})
15791589
}

jd_fanli.py

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
"""
2+
const $ = new Env("京东饭粒");
3+
京东饭粒任务
4+
活动入口:https://u.jd.com/ytWx4w0
5+
每天60豆小毛,爱要不要
6+
cron:
7+
46 9 * * * jd_fanli.py
8+
"""
9+
import json
10+
import sys
11+
import os
12+
import time
13+
import re
14+
import requests
15+
import random
16+
17+
proxies = {"http": None, "https": None}
18+
19+
20+
def printf(text):
21+
print(text)
22+
sys.stdout.flush()
23+
24+
25+
def randomstr(num):
26+
randomstr = ""
27+
for i in range(num):
28+
randomstr = randomstr + random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
29+
return randomstr
30+
31+
32+
def randomstr1():
33+
randomstr = ""
34+
for i in range(16):
35+
randomstr = randomstr + random.choice("0123456789")
36+
randomstr += "-"
37+
for i in range(16):
38+
randomstr = randomstr + random.choice("0123456789")
39+
return randomstr
40+
41+
42+
def getheader(ck):
43+
return {
44+
"Host": "ifanli.m.jd.com",
45+
"Connection": "keep-alive",
46+
"Accept": "application/json, text/plain, */*",
47+
"Cache-Control": "no-cache",
48+
"User-Agent": "jdapp;android;10.2.2;11;%s;model/Mi 10;osVer/30;appBuild/91077;partner/xiaomi001;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 11; Mi 10 Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045715 Mobile Safari/537.36" % randomstr1(),
49+
"Sec-Fetch-Mode": "cors",
50+
"X-Requested-With": "com.jingdong.app.mall",
51+
"Sec-Fetch-Site": "same-origin",
52+
"Referer": "https://ifanli.m.jd.com/rebate/earnBean.html?paltform=null",
53+
"Accept-Encoding": "gzip, deflate, br",
54+
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
55+
"Cookie": ck,
56+
"Content-Type": "application/json;charset=UTF-8"
57+
}
58+
59+
60+
def getTaskList(ck):
61+
url = "https://ifanli.m.jd.com/rebateapi/task/getTaskList"
62+
headers = getheader(ck)
63+
r = requests.get(url, headers=headers, proxies=proxies)
64+
# printf(r.text)
65+
return r.json()["content"]
66+
67+
68+
def getTaskFinishCount(ck):
69+
url = "https://ifanli.m.jd.com/rebateapi/task/getTaskFinishCount"
70+
headers = getheader(ck)
71+
r = requests.get(url, headers=headers, proxies=proxies)
72+
printf(
73+
'已完成任务次数:' + str(r.json()["content"]["finishCount"]) + ' 总任务次数:' + str(r.json()["content"]["maxTaskCount"]))
74+
return r.json()["content"]
75+
76+
77+
def saveTaskRecord(ck, taskId, taskType):
78+
url = "https://ifanli.m.jd.com/rebateapi/task/saveTaskRecord"
79+
headers = getheader(ck)
80+
data = '{"taskId":%s,"taskType":%s}' % (taskId, taskType)
81+
r = requests.post(url, headers=headers, data=data, proxies=proxies)
82+
# printf(r.text)
83+
return r.json()["content"]["uid"], r.json()["content"]["tt"]
84+
85+
86+
def saveTaskRecord1(ck, taskId, uid, tt, taskType):
87+
# tt=int(time.time()*1000)
88+
url = "https://ifanli.m.jd.com/rebateapi/task/saveTaskRecord"
89+
headers = getheader(ck)
90+
data = '{"taskId":%s,"taskType":%s,"uid":"%s","tt":%s}' % (taskId, taskType, uid, tt)
91+
# printf(data)
92+
r = requests.post(url, headers=headers, data=data, proxies=proxies)
93+
printf(r.json()["content"]["msg"])
94+
95+
96+
if __name__ == '__main__':
97+
try:
98+
cks = os.environ["JD_COOKIE"].split("&")
99+
except:
100+
f = open("/jd/config/config.sh", "r", encoding='utf-8')
101+
cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read())
102+
f.close()
103+
for ck in cks:
104+
ptpin = re.findall(r"pt_pin=(.*?);", ck)[0]
105+
printf("--------开始京东账号" + ptpin + "--------")
106+
try:
107+
count = getTaskFinishCount(ck)
108+
if count["finishCount"] < count["maxTaskCount"]:
109+
for times in range(count["maxTaskCount"] - count["finishCount"]):
110+
tasks = getTaskList(ck)
111+
for i in tasks:
112+
if i["statusName"] != "活动结束":
113+
printf("开始做任务:" + i["taskName"])
114+
uid, tt = saveTaskRecord(ck, i["taskId"], i["taskType"])
115+
time.sleep(10)
116+
saveTaskRecord1(ck, i["taskId"], uid, tt, i["taskType"])
117+
break
118+
except:
119+
printf("发生异常错误")

0 commit comments

Comments
 (0)