Git Product home page Git Product logo

tiktok-chat-reader's Introduction

TikTok-Chat-Reader

A chat reader for TikTok LIVE utilizing TikTok-Live-Connector and Socket.IO to forward the data to the client. This demo project uses the unofficial TikTok API to retrieve chat comments, gifts and other events from TikTok LIVE.

Installation

To run the chat reader locally, follow these steps:

  1. Install Node.js on your system
  2. Clone this repository or download and extract this ZIP file
  3. Open a console/terminal in the root directory of the project
  4. Enter npm i to install all required dependencies
  5. Enter node server.js to start the application server

Now you should see the following message: Server running! Please visit http://localhost:8091
Simply open http://localhost:8091/ in your browser. Thats it.

If you have problems with Node.js, you can also just open the index.html from the public folder.
This will use the server backend of the demo site, which is sufficient for testing purposes. If you want to offer it to others or make many connections at the same time, please consider using your own server.

Screenshot

TikTok LIVE Chat Reader (Demo)

tiktok-chat-reader's People

Contributors

zerodytrash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tiktok-chat-reader's Issues

Cannot find module 'node:events'

Hi,
I tried to follow the 5 installation steps. Everything worked besides step 5) starting the server.js.
I get the following error output:
`
internal/modules/cjs/loader.js:818
throw err;
^

Error: Cannot find module 'node:events'
Require stack:

  • /home/ralf/Dokumente/work/TikTok-Chat-Reader/node_modules/tiktok-live-connector/dist/index.js
  • /home/ralf/Dokumente/work/TikTok-Chat-Reader/node_modules/tiktok-live-connector/index.js
  • /home/ralf/Dokumente/work/TikTok-Chat-Reader/connectionWrapper.js
  • /home/ralf/Dokumente/work/TikTok-Chat-Reader/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/home/ralf/Dokumente/work/TikTok-Chat-Reader/node_modules/tiktok-live-connector/dist/index.js:23:5)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/ralf/Dokumente/work/TikTok-Chat-Reader/node_modules/tiktok-live-connector/dist/index.js',
    '/home/ralf/Dokumente/work/TikTok-Chat-Reader/node_modules/tiktok-live-connector/index.js',
    '/home/ralf/Dokumente/work/TikTok-Chat-Reader/connectionWrapper.js',
    '/home/ralf/Dokumente/work/TikTok-Chat-Reader/server.js'
    ]
    }
    `
    I tried to start it via browser and index.html and this worked. But i need to run the server..

OS: Ubuntu 22.04.4 LTS 64bit
Standard nodejs: v12.22.9

Any ideas? Thanks in advance.

connect error

When I try to connect, I get the following error:
Failed to connect Error: Failed to retrieve room_id from page source. timeout of 10000ms exceeded
at WebcastPushConnection._retrieveRoomId2 (E:\TikTok-Live-Connector-main\node_modules\tiktok-live-connector\dist\index.js:509:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WebcastPushConnection.connect (E:\TikTok-Live-Connector-main\node_modules\tiktok-live-connector\dist\index.js:265:9)

What should I do about it?
I am looking forward to your reply.Thank you.

Parse Error

It hasn't worked locally for 3 days, it shows this error in the terminal:

New connection from origin http://localhost:8091/
WRAPPER @@pepit@123: Error event triggered: Error while connecting, Error: Failed to retrieve room_id from page source. Parse Error
{ info: 'Error while connecting',
exception:
Error: Failed to retrieve room_id from page source. Parse Error
at WebcastPushConnection._retrieveRoomId2 (/home/pepito/TikTok-Chat-Reader/node_modules/tiktok-live-connector/dist/index.js:501:11)
at process._tickCallback (internal/process/next_tick.js:68:7) }
WRAPPER @@pepit@123: Connection failed, Error: Failed to retrieve room_id from page source. Parse Error.

And in the browser:

Error: Failed to retrieve room_id from page source. Parse Error

Any solution?

Generate Overlay URL - Duplicate messages

Currently, I have been experiencing an issue where messages duplicate themselves when I believe they shouldn't. The peculiar thing is that, when examining the demo, there are no repeated messages. Additionally, I have noticed that when it initially loads past messages, there are no repeated messages, but when it comes to all new messages, including events, duplicates occur. I don't know exactly if this is an issue with my tiktok account but this has been happening.

[FEATURE REQUEST] Read certain comments out loud

So if I were doing a TikTok LIVE where I was drawing/doing art, it would be nice to be able to concentrate on my art without having to check the comments all the time. Would be cool if this project could read certain comments out loud so I could hear them without looking up from my drawing?

This is an amazing project. Thank you for sharing πŸ™

Feature Request - Write chat to log file

Hello, I was wondering is there any chance that there could be an additional feature?
Whilst the tool is running is it able to write into a log file?

Or if anyone can share me the code I need to add to make this work. Much Appreciated

Many thanks

Connection issue

I'm suddenly receiving the error

Request failed with status code 500

I get this error when I run it locally and on your demo page. What's strange is that it was working perfectly fine earlier today. Any assistance in resolving this issue would be appreciated.

Apache-PHP

Looking for a Way to Run this on Apache Server

Installing script on cPanel

Hello,

I have an issue when trying to install this script on cPanel, even with the setup Node.js application.
Contacted you on Keybase/Twitter.

User who join the live are overwritten

When some one joins the live the message appears that a user joined the live.
But it will be overwritten by the next message so you can't see it when lots of messages appear

connecting but not showing anything

Hi,

it seems that since a few hours the demo app is not working anymore. It seems connecting but is not showing anything as messages, gifts, likes, ...

Thanks!

Failed to sign request: Request failed with status code 525

[FREATURE REQUEST] Timestamps

Requesting a checkbox/tickbox to enable/disable timestamps next to all events (gifts, likes, shares, follows, chat messages, etc.)

error connecting

connect server with nextJs

hello bro , thank you for this great repo , I'm so new with backend stuff , and I'm just wondering , is there any possible way to connect my front-end (nextJS) with the server you create , I mean instead of reader static file from express just provide an endpoint where i can use it for my implementation at front-end , thanks again .

Error: Failed to sign request: timeout of 5000ms exceeded

Hi,

I am using the Demo version and in the last few hours I get:

Error: Failed to sign request: timeout of 5000ms exceeded; URL: https://webcast.tiktok.com/webcast/im/fetch/?aid=1988&app_language=en-US&app_name=tiktok_web&browser_language=en&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F102.0.5005.63+Safari%2F537.36&cookie_enabled=true&cursor=&internal_ext=&device_platform=web&focus_state=true&from_page=user&history_len=4&is_fullscreen=false&is_page_visible=true&did_rule=3&fetch_rule=1&identity=audience&last_rtt=0&live_id=12&resp_content_type=protobuf&screen_height=1152&screen_width=2048&tz_name=Europe%2FBerlin&referer=https%3A%2F%2Fwww.tiktok.com%2F&root_referer=https%3A%2F%2Fwww.tiktok.com%2F&version_code=180800&webcast_sdk_version=1.3.0&update_version_code=1.3.0&room_id=7185777797653793542

Any idea?

Thanks a lot!

Error While Connecting

I got this error while trying to run the chat reader locally, what should I do?

New connection from origin http://localhost:8081/
WRAPPER @@rrpas: Error event triggered: Error while connecting, Error: Missing cursor in initial fetch response.
{
info: 'Error while connecting',
exception: Error: Missing cursor in initial fetch response.
at WebcastPushConnection._fetchRoomData2 (D:\Downloads\tiktok\TikTok-Chat-Reader-main\node_modules\tiktok-live-connector\dist\index.js:503:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WebcastPushConnection.connect (D:\Downloads\tiktok\TikTok-Chat-Reader-main\node_modules\tiktok-live-connector\dist\index.js:268:7)
}
WRAPPER @@rrpas: Connection failed, Error: Missing cursor in initial fetch response.

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.