Coder Social home page Coder Social logo

douyudanmu's Introduction

pip install

websocket_client==0.57.0

douyudanmu

斗鱼直播间弹幕爬取python

image

我最近在学习python的直播间弹幕爬取,但是由于斗鱼官方把第三方api的接口改变了,必须要注册为开发者才能使用官方提供的方法进行弹幕爬取。所以我通过搜索教程了解到可以使用浏览器自带的爬取功能对弹幕进行爬取。

原理如下:

利用websocket建立wss 连接

wss://danmuproxy.douyu.com:8506/'

8501-8507都可以使用。

发送登录信息

发生入组信息

发送心跳数据,(和b站不一样更高级了,有心跳数据了)。

利用wss必须对发送包进行加密,对接收的数据进行解包,

这些操作官方api 有提供,所以我就不再进行解释了。

就能返回弹幕数据。

将roomid = "666743" 改成你需要的id。

直接运行即可,会提示输入房间号码

douyudanmu's People

Contributors

shuishen49 avatar

Stargazers

Fried Li avatar

Watchers

 avatar

douyudanmu's Issues

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.