The simplest chat logger for streams on DLive (NodeJS, without auth) – Mikulski
Site Overlay

The simplest chat logger for streams on DLive (NodeJS, without auth)

DISCLAIMER:
I am not a programmer, but only an enthusiastic copy-paster who shares what he could figure out. It is possible that knowledgeable experts may find some points or formulations erroneous or ridiculous.
This material is for informational purposes only.

I continue the topic of the simplest chat loggers for not the most popular stream sites.

Features

The chat is connected via a websocket using the WS library.
It is noteworthy that in Dlive, in addition to simple messages, you can also catch follow, host, gift “lemons” (an analogue of bits on Twitch), ban of the user, promotion of the user to a moderator, deletion of the message and more.
It is likely that paid subscriptions and gift paid subscriptions also come to the chat, but I have not been able to catch them yet. If they do, I’ll edit this post and the code.
The script does not provide for restoring the connection in case of a dump, so it is recommended to use pm2 manager if the script is scheduled to work 24/7.

How to use it

Since this is javascript, you need nodejs and npm installed in the system.
Create a folder and a file in it with the extension.js.
While inside the newly created directory, install the WS repository:

npm i ws

You need to paste the copied code into the js file, which will go further. Well, or download the script from Github.
Edit the line in the script const channel = “” , by putting the name of the channel taken from the url in quotation marks. For example, the channel address https://dlive.tv/Mikulski – you need to put “Mikulski”.
Since the display name on DLive does not always match the channel identifier, the script first determines the identifier by the specified channel name.
Run the script:

node filename.js

Script

Page on Github


If this material is useful to you and you have the opportunity,
then support the author and the site with a small tip:
https://hipolink.me/mikulski/tips
Thanks💛


0 comments
Inline Feedbacks
View all comments