Calculating the signature of the Bilibili's heartbeat requests
Project description
bili-spyder
Calculating the signature of the Bilibili's heartbeat requests
For the moment, only supported on Unix platforms with a x86-64 architecture!
Installation
-
install this package by pip first.
pip3 install bili-spyder
-
check if the Imported functions feature is supported or not.
python3 -c "from wasmer import Features; print(Features.host_functions())"
if it printed out
True
, skip the steps below, otherwise follow the steps below. -
compile a new
wasmer
by yourself. the issue https://github.com/wasmerio/python-ext-wasm/issues/215 may help you, good lucky!if you don't want to compile one by yourself and the Python verison you used is 3.8, consider the one I compiled.
-
use the new one to reinstall
wasmer
.
Usage
from bili_spyder import calc_sign, calc_sign_async
data = {
'id': '[1, 33, 1, 23058]',
'device': '["AUTO8115983198593723", "2ddca4d0-2e72-427e-9b97-55ee70536381"]',
'ets': 1598401991,
'benchmark': 'seacasdgyijfhofiuxoannn',
'time': 300,
'ts': 1598402290937,
}
secret_rule = [2, 5, 1, 4]
sign = calc_sign(data, secret_rule)
sign = await calc_sign_async(data, secret_rule)
About the wasm file
the wasm file is downloaded from https://i0.hdslb.com/bfs/live/e791556706f88d88b4846a61a583b31db007f83d.wasm and the file name is its sha1
.
Special Thanks
This project is inspired by and got much help from the project https://github.com/lkeme/bilibili-pcheartbeat
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bili_spyder-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 211516767e8feef6598409cecde7b8cddee0614fb0e91f6c3cf690bd65efc779 |
|
MD5 | 4e30a140e6bf7ba3a12d5816ca4fae28 |
|
BLAKE2b-256 | 3182f47f92d86418e6a910c1cb387cf2f046b6192d3f20a949bdf7d3a7d2ce2f |