MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_bt_params

Method get_bt_params

mod/project/node/nodeutil/base.py:272–290  ·  view source on GitHub ↗
(self, other_data: dict = None)

Source from the content-addressed store, hash-verified

270 return "", "数据格式错误: %s" % str(data)
271
272 def get_bt_params(self, other_data: dict = None) -> Dict:
273 now = int(time.time() * 1000)
274 other_data = other_data or {}
275 if self.app_key:
276 md5_panel_key = hashlib.md5(self.app_key.request_token.encode()).hexdigest()
277 request_token = hashlib.md5("{}{}".format(now, md5_panel_key).encode()).hexdigest()
278 other_data["request_token"] = request_token
279 other_data["request_time"] = str(now)
280 form_data = json.dumps(other_data)
281 return {
282 "client_bind_token": self.app_key.app_token,
283 "form_data": public.aes_encrypt(form_data, self.app_key.app_key)
284 }
285 else:
286 md5_panel_key = hashlib.md5(self.api_key.encode()).hexdigest()
287 request_token = hashlib.md5("{}{}".format(now, md5_panel_key).encode()).hexdigest()
288 other_data["request_token"] = request_token
289 other_data["request_time"] = str(now)
290 return other_data
291
292 def _request(self, path: str, action: str, pdata: dict = None) -> Tuple[Optional[any], str]:
293 url = "{}{}".format(self.origin, path)

Callers 7

_requestMethod · 0.95
_upload_big_fileMethod · 0.95
_upload_little_fileMethod · 0.95
upload_proxyMethod · 0.95
_proxy_websocketMethod · 0.95
download_proxyMethod · 0.95
_download_fileMethod · 0.95

Calls 5

timeMethod · 0.80
aes_encryptMethod · 0.80
md5Method · 0.45
formatMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected