Skip to content

yw-mao/bilibili-pcheartbeat

 
 

Repository files navigation

Bilibili Heartbeat Server

Introduction

Stargazers over time

Demo

Example OR Documentation

Example OR Documentation

Quick Start

  1. Clone or download this repository

  2. Install CN-Nodejs or EN-Nodejs

  3. Use npm to install packages

> npm install
  1. Start-up
# cli
default port 3000
> node app.js 

custom port 1-65535
> node app.js -p 5200
> node app.js --port 5201
# pm2
cp ecosystem.config.js.example  ecosystem.config.js
npm install -g pm2
pm2 start ecosystem.config.js

API

Use POST method to access API, and the return data is in JSON format

/enc

Url

http://127.0.0.1:3000/enc

Headers

  • Content-type: application/json

Param

{
  "t": {
    "id": [1, 199, 0, 123456],
    "device": "[\"device\",\"device\"]",
    "ets": "ets",
    "benchmark": "secret_key",
    "time": "heartbeat_interval",
    "ts": "ts",
    "ua": "ua"
  },
  "r": [2, 5, 1, 4]
}

Return

  • Success
{
  "code": 0,
  "s": "be02e0ac4248ff3e59bea681258319bec489db3b5766eb0d40ce25516889c6df2bb8383c16d8a9bbb3ced7283388fb4df89718430064564bfaf6be246b983910",
  "message": "success"
}
  • Error 1
{
  "code": -1,
  "s": "",
  "message": "HTTP 405 Method Not Allowed"
}
  • Error 2
{
  "code": -2,
  "s": "",
  "message": "The request is missing a required parameter."
}
  • Error 3
{
"code": -2,
"s": "",
"message": "other errors msg"
}

Disclaimer

The project is for study and technical communication only, do not use it for illegal purposes!

I don"t take any responsibility if legal dispute occurs.

License

GPL v3

Copyright (c) 2018-2021 bilibili-pcheartbeat.

About

bilibili-pcheartbeat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.6%
  • Python 9.7%
  • Other 0.7%