-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathddo_lxj.py
132 lines (121 loc) · 4.7 KB
/
ddo_lxj.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# 京东领现金
# Author:ddo
# update time:2021/8/23
import urllib
import urllib.parse
import requests
import json
import re
import time
import random
proxies = {
"http": None,
"https": None,
}
def randomstr(num):
randomstr = ""
for i in range(num):
randomstr = randomstr + random.choice("abcdefghijklmnopqrstuvwxyz0123456789")
return randomstr
def getsign(functionid, body, jduuid):
data={
"functionId":functionid,
"body":body,
"uuid":jduuid,
"client":"android",
"clientVersion":"9.2.2"
}
sign=requests.post(url="https://jdsign.tk/ddo",data=json.dumps(data)).text
# print(sign)
return sign
def main(ck):
try:
headers = {
"Host": "api.m.jd.com",
"Connection": "keep-alive",
"User-Agent": "okhttp/3.12.1;jdmall;android;version/9.2.2;build/89568;screen/1440x2560;os/7.1.2;network/wifi",
"Accept": "*/*",
"Referer": "https://h5.m.jd.com/rn/42yjy8na6pFsq1cx9MJQ5aTgu3kX/index.html",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"cookie": ck,
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
jduuid = randomstr(16)
functionId= "cash_sign"
body= "{\"breakReward\":0,\"inviteCode\":null,\"remind\":0,\"type\":0}"
sign=getsign(functionId,body,jduuid)
url = "https://api.m.jd.com/client.action?functionId=cash_sign&clientVersion=9.2.2&client=android&uuid=%s&%s" % (
jduuid, sign)
data = "body=%7B%22breakReward%22%3A0%2C%22inviteCode%22%3Anull%2C%22remind%22%3A0%2C%22type%22%3A0%7D"
r = requests.post(url, headers=headers, data=data, proxies=proxies)
print(r.text)
# r=requests.get(url,headers=headers,proxies=proxies)
except:
print("error")
def doTask(ck, body):
try:
jduuid = randomstr(16)
headers = {
"Host": "api.m.jd.com",
"Connection": "keep-alive",
"User-Agent": "okhttp/3.12.1;jdmall;android;version/9.2.2;build/89568;screen/1440x2560;os/7.1.2;network/wifi",
"Accept": "*/*",
"Referer": "http s://h5.m.jd.com/rn/42yjy8na6pFsq1cx9MJQ5aTgu3kX/index.html",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"cookie": ck,
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
functionId= "cash_doTask"
sign=getsign(functionId,body,jduuid)
url = "https://api.m.jd.com/client.action?functionId=cash_doTask&clientVersion=9.2.2&build=89568&client=android&uuid=%s&%s" % (
jduuid, sign)
data = "body=" + urllib.parse.quote_plus(body)
r = requests.post(url, headers=headers, data=data, proxies=proxies)
print(r.text)
except:
print("err")
def doTasker(ck):
try:
jduuid = randomstr(16)
headers = {
"Host": "api.m.jd.com",
"Connection": "keep-alive",
"User-Agent": "okhttp/3.12.1;jdmall;android;version/9.2.2;build/89568;screen/1440x2560;os/7.1.2;network/wifi",
"Accept": "*/*",
"Referer": "http s://h5.m.jd.com/rn/42yjy8na6pFsq1cx9MJQ5aTgu3kX/index.html",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"cookie": ck,
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
params = {
"functionId": "cash_homePage",
"body": "{}",
"uuid": jduuid,
"client": "android",
"clientVersion": "9.2.2"
}
sign = requests.post(url="http://1.117.2.106:63343/getSignFromJni", data=params, proxies=proxies).text
url = "https://api.m.jd.com/client.action?functionId=cash_homePage&clientVersion=9.2.2&build=89568&client=android&uuid=%s&%s" % (
jduuid, sign)
data = "body=%7B%7D"
r = requests.post(url, headers=headers, data=data, proxies=proxies)
TaskList = json.loads(r.text)["data"]["result"]["taskInfos"]
for i in TaskList:
if i["finishFlag"] == 2:
TaskInfo = i["desc"].split(",")
print(TaskInfo)
for ii in TaskInfo:
body = "{\"taskInfo\":\"%s\",\"type\":%s}"%(TaskInfo,i["type"])
time.sleep(5)
doTask(ck, body)
except:
print("err")
if __name__ == '__main__':
f = open("/jd/config/config.sh")
cookies = re.findall("\"(pt_key=.*?;pt_pin=.*?;)\"",f.read())
for i in cookies:
main(i)
doTasker(i)