Skip to main content

bili-spyder

Calculating the signature of the Bilibili's heartbeat requests

Installation

pip install bili-spyder

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)

See also: https://github.com/acgnhiki/bili-spyder-example

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

Metadata

Release files for bili-spyder 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bili-spyder 0.2.0
File Size Uploaded
bili-spyder-0.2.0.tar.gz 99.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bili-spyder 0.2.0
File Interpreter ABI Platform
bili_spyder-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 197.8 kB

Release files / bili-spyder-0.2.0.tar.gz

Download URL bili-spyder-0.2.0.tar.gz
Size 99.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bd09b53ce7ba9230a22915b8316d3f0e55035f86b54d87353fbd43e75913b96f
BLAKE2b-256 checksum
How to use checksums
61b374bdea9d6aa2a7b5985a3c01e5efb992ec7ce4d06404032f0854e5d35015
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.5

Release files / bili_spyder-0.2.0-py3-none-any.whl

Download URL bili_spyder-0.2.0-py3-none-any.whl
Size 98.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb2e84a13ccccb766d75e9333db6e4aa14f70ecac62964508906b21566c9b128
BLAKE2b-256 checksum
How to use checksums
36a067226bc554382c5b560eb9e29e37131597c0761674ffccc399ea2aa2b588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page