Git Product home page Git Product logo

bilibili-grpc-api's Introduction

bilibili grpc api

bilibili grpc相关的api请求,仅作研究学习。

鉴权参数:identify_v1和buvid,如需使用请在config.py中设置。

使用

proto文件生成py文件

python -m grpc_tools.protoc -I header --python_out=header header\metadata.proto

指定proto文件解码

python -m grpc_tools.protoc -I header --decode Metadata metadata.proto < test.bin

测试解析payload

python test.py -t video

{
    "epId": "341988",
    "cid": "240156492",
    "qn": "120",
    "fnval": 16,
    "fourk": true,
    "spmid": "pgc.pgc-video-detail.0.0",
    "fromSpmid": "default-value",
    "preferCodecType": "CODE265"
}

python test.py -t subtitle

{
    "pid": "712346749",
    "oid": "240156492",
    "type": 1
}

测试请求视频

python run.py

解析效果

原理详见:哔哩哔哩视频和字幕接口分析,欢迎指正不足之处。

返回数据proto文件构成复杂,有需要可以参考上面的文章自行编写proto文件。

  • 视频请求和返回解析

视频请求payload解析效果 视频请求返回解析效果 视频请求返回解析效果-末尾

  • 字幕请求返回解析

字幕请求返回解析

参考

bilibili-grpc-api's People

Contributors

seeflowerx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.