Code Monkey home page Code Monkey logo

live-danmu's Introduction

哔哩哔哩

介绍

通过浏览器运行JavaScript脚本获取直播弹幕,使用WebSocket向服务端发送弹幕.

配置

  1. WebSocket地址在第3行.
  2. 监听间隔(毫秒)在第4行.

使用

先运行服务端,再运行脚本.

响应参数

名称 说明
type 类型,system代表系统,welcome代表欢迎,message代表消息
userId 用户ID
nickname 昵称
content 内容

示例(参考抖音示例)

抖音

介绍

通过浏览器运行JavaScript脚本获取直播弹幕,使用WebSocket向服务端发送弹幕.

配置

  1. WebSocket地址在第3行.
  2. 监听间隔(毫秒)在第4行.

使用

先运行服务端,再运行脚本.

响应参数

名称 说明
type 类型,system代表系统,welcome代表欢迎,message代表消息
nickname 昵称
content 内容

示例(Tiktok/example/)

斗鱼

介绍

通过浏览器运行JavaScript脚本获取直播弹幕,使用WebSocket向服务端发送弹幕.

配置

  1. WebSocket地址在第3行.
  2. 监听间隔(毫秒)在第4行.

使用

先运行服务端,再运行脚本.

名称 说明
type 类型,system代表系统,welcome代表欢迎,message代表消息
userId 用户ID
nickname 昵称
content 内容

示例(参考抖音示例)

快手

请求官方API获取直播弹幕,使用WebSocket向客户端发送弹幕.

需求

  1. 语言: Python3.8+.
  2. 包: asyncio,websockets,requests,json.

配置

  1. WebSocket地址和端口分别在第9行和第10行.
  2. 监听间隔(毫秒)在第11行.

使用

客户端连接WebSocket后发送直播流ID(查看页面源代码,搜索liveStream后面ID的值即直播流ID).

响应参数

名称 说明
userId 用户ID
nickname 昵称
content 内容
timestmap 时间戳

示例(Kwai/example/)

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.