MCPcopy
hub / github.com/MakiNaruto/Automatic_ticket_purchase / get_sign_code

Function get_sign_code

tools.py:147–161  ·  view source on GitHub ↗

返回请求选座信息接口必备的sign信息 :return:

(h5_token: str, time_stamp, api_param)

Source from the content-addressed store, hash-verified

145
146
147def get_sign_code(h5_token: str, time_stamp, api_param) -> str:
148 """
149 返回请求选座信息接口必备的sign信息
150
151 :return:
152 """
153 node = execjs.get()
154 with open('signcode.js', 'r', encoding='utf-8') as f:
155 js_file = f.read()
156 js_exec = node.compile(js_file)
157 param1 = '{}&{}&12574478&'.format(h5_token, time_stamp)
158
159 context = param1 + api_param
160 sign_code = js_exec.call('calcaulate', context)
161 return sign_code
162
163
164def get_select_seat_params(item_id, data_id=None):

Callers 3

get_seat_dynamic_infoFunction · 0.85
get_select_seat_apiFunction · 0.85
get_valuable_seat_idFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected