Skip to main content

Calculating the signature of the Bilibili's heartbeat requests

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bili-spyder-0.2.0.tar.gz (99.4 kB view details)

Uploaded Source

Built Distribution

bili_spyder-0.2.0-py3-none-any.whl (98.4 kB view details)

Uploaded Python 3

File details

Details for the file bili-spyder-0.2.0.tar.gz.

File metadata

  • Download URL: bili-spyder-0.2.0.tar.gz
  • Upload date:
  • Size: 99.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for bili-spyder-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bd09b53ce7ba9230a22915b8316d3f0e55035f86b54d87353fbd43e75913b96f
MD5 a6d67f6426e36382d546f81a155acd9a
BLAKE2b-256 61b374bdea9d6aa2a7b5985a3c01e5efb992ec7ce4d06404032f0854e5d35015

See more details on using hashes here.

File details

Details for the file bili_spyder-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bili_spyder-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 98.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for bili_spyder-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2e84a13ccccb766d75e9333db6e4aa14f70ecac62964508906b21566c9b128
MD5 f9d121c3b48e43514d5e6671fa8bb5f0
BLAKE2b-256 36a067226bc554382c5b560eb9e29e37131597c0761674ffccc399ea2aa2b588

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page