MCPcopy Create free account
hub / github.com/Semporia/Scripts / getShareCode

Function getShareCode

jd_zjd.py:176–199  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

174
175#获取助力码
176def getShareCode(headers):
177 global assistStartRecordId, encPin, sid, aNum
178 try:
179 url = f'https://api.m.jd.com/api?functionId=distributeBeanActivityInfo&fromType=wxapp&timestamp={int(round(t * 1000))}'
180 body = 'body=%7B%22paramData%22%3A%7B%22channel%22%3A%22FISSION_BEAN%22%7D%7D&appid=swat_miniprogram&client=tjj_m&screen=1920*1080&osVersion=5.0.0&networkType=wifi&sdkName=orderDetail&sdkVersion=1.0.0&clientVersion=3.1.3&area=11'
181 responses = requests.post(url, headers=headers, data=body, verify=False, timeout=30).json()
182 if responses['success']:
183 data = responses['data']
184 sid = data['id']
185 encPin = data['encPin']
186 try:
187 assistStartRecordId = data['assistStartRecordId']
188 except:
189 starAssist(sid, header)
190 return getShareCode(headers)
191 aNum = 0
192 return assistStartRecordId, encPin, sid
193 except Exception as e:
194 if aNum < 5:
195 aNum += 1
196 return getShareCode(headers)
197 else:
198 print("getShareCode Error", e)
199 exit(2)
200
201#设置请求头
202def setHeaders(cookie):

Callers 2

assistFunction · 0.70
startFunction · 0.70

Calls 2

starAssistFunction · 0.85
postMethod · 0.45

Tested by

no test coverage detected