zerodytrash / tiktok-live-connector Goto Github PK
View Code? Open in Web Editor NEWNode.js library to receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.
Home Page: https://discord.gg/2c6kX6g3Pa
License: MIT License
Node.js library to receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.
Home Page: https://discord.gg/2c6kX6g3Pa
License: MIT License
Trying to find all the gift ID's is a bit tedious since some are a lot more rare than others. Do you have a list that I could use?
Hello! We can see the total amount of likes, but it is possible to see the count of each event?
A user XXX sent 34 likes.
Noticed the WebcastLiveIntroMessage
is not implemented in the proto file.
I'd create the proto myself but I'm not sure how you managed to RE the proto definitions.
This is a base64 encoded example:
CiMKF1dlYmNhc3RMaXZlSW50cm9NZXNzYWdlEIGWlPyS17qQYhCBlpT8kte6k
GIYASJOUmVhbCBsaWZlIGh1bWFub2lkIHJvYm90LiBTZW5kIHlvdXIgcXVlc3Rpb25zIGFuZCBmbG93ZXJzIGZvciByZWFsIHJvYm90IEFsZXguKp0ECIGIgO6
t6+64XxoIUHJvbW9ib3RKmQMKqgFodHRwczovL3AxNi1zaWduLXNnLnRpa3Rva2Nkbi5jb20vYXdlbWUvMTAweDEwMC90b3MtYWxpc2ctYXZ0LTAwNjgvMDNjZ
jk4ZDc0MmUwNmI5YWI5MGY3NmE0OTM4ODZiMGIud2VicD94LWV4cGlyZXM9MTY0NjQwOTYwMCZ4LXNpZ25hdHVyZT1GdnpDQU1yRTZzekZ3THJLbFZ0MVUlMkJ
EVDFHSSUzRAqsAWh0dHBzOi8vcDE2LXNpZ24tc2cudGlrdG9rY2RuLmNvbS9hd2VtZS8xMDB4MTAwL3Rvcy1hbGlzZy1hdnQtMDA2OC8wM2NmOThkNzQyZTA2Y
jlhYjkwZjc2YTQ5Mzg4NmIwYi5qcGVnP3gtZXhwaXJlcz0xNjQ2NDA5NjAwJngtc2lnbmF0dXJlPUlHJTJGOW5IeGl0bCUyRmxGbTRoODREREd4eWN5R3clM0Q
SOzEwMHgxMDAvdG9zLWFsaXNnLWF2dC0wMDY4LzAzY2Y5OGQ3NDJlMDZiOWFiOTBmNzZhNDkzODg2YjBisgEGCBwQoctiggIAsgIPcHJvbW9ib3Qucm9ib3Rz8
gJMTVM0d0xqQUJBQUFBQzF5SXlyOGhSbkFkcG8xS2NaNTRpeXh1Sll2TTh4MUIwUWkxcmVuZ2VVT1FHTDJpak5ycUwxTk8wcEhaaW1aMToYCAKqARMIAhIPcG1
fbXRfaG9zdGxhYmVs
I've been randomly getting this error for days now. It works for many hours, and then it just starts saying this and doesn't until the next day. Am I being rate limited or...?
Are you planning to add a mobile chat parser?
there are more tap events
Hi!
First I like to say thanks for your great work, it's very helpful for me right now!
For the project I'm working on I need to receive infos, if someone gifted a treasure box, that everyone in the room can open and may receive some coins. This box is unfortunately not part of the gift list. Is there a way to retrieve infos about it?
After scanning the raw Webcast I think, the WebcastEnvelopeMessage
may contain the searched infos, but i'm too dumb to get the raw data decoded... 😕
Hey! Thank you for your work)
data.gift.repeat_end - Today shows only 1.
But everything works on your site. Can not understand.
When I am trying to use this library in node, I get the error it cannot read 'security' of undefined as error.
The channel is live and using the sample code.
I am currently trying to create a react js app and wanted to be able to import this library. I have had no luck finding a workaround so maybe a feature request would be the right direction?
Could you please check from your side? We get no events.
Anytime a gift is sent, the topGifterRank data is null, even if the gifter is in top 3.
Turns out axios is a dump when it comes to proxies, and the default env proxy configurations cause axios to crash;
axios/axios#3384
Not sure if there's a fix available, but would be nice to be able to use proxies here
Failed to connect Error: Failed to sign request: Request failed with status code 429; 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=7125454688937397018
at signRequest (d:\PROJECTS\2dGame\canvas-boilerplate\node_modules\tiktok-live-connector\dist\lib\tiktokSignatureProvider.js:79:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async TikTokHttpClient._buildUrl2 (d:\PROJECTS\2dGame\canvas-boilerplate\node_modules\tiktok-live-connector\dist\lib\tiktokHttpClient.js:98:15)
at async TikTokHttpClient.getDeserializedObjectFromWebcastApi (d:\PROJECTS\2dGame\canvas-boilerplate\node_modules\tiktok-live-connector\dist\lib\tiktokHttpClient.js:63:15)
at async WebcastPushConnection._fetchRoomData2 (d:\PROJECTS\2dGame\canvas-boilerplate\node_modules\tiktok-live-connector\dist\index.js:499:25)
at async WebcastPushConnection.connect (d:\PROJECTS\2dGame\canvas-boilerplate\node_modules\tiktok-live-connector\dist\index.js:268:7) {stack: 'Error: Failed to sign request: Request failed…es\tiktok-live-connector\dist\index.js:268:7)', message: 'Failed to sign request: Request failed with …rsion_code=1.3.0&room_id=7125454688937397018'}
When running lives through your website ( https://tiktok-chat.herokuapp.com/ ) I seem to be getting a MUCH more accurate version of the data that I need, is there something that your doing that could help me more accurately receive gift data?
Hello! In Server.js I have added
thisConnection.on('like', msg => socket.emit('like', msg));
thisConnection.on('social', msg => socket.emit('social', msg));
In public app I have this:
socket.on('like', function(msg){
console.log("like");
console.log(msg.totalLikeCount);
});
socket.on('social', function(){
console.log("follow");
});
And there are no alerts coming. Gifts and chat are working fine. What am I doing wrong?
Hey! There is no timestamp at GIFT event
Hello, what can it be? We use a simple code and sometimes it gives this error
Uncaught TypeError: Cannot read properties of undefined (reading 'gift_type')
if (data.gift.gift_type === 1 && data.gift.repeat_end === 0) {} else {
Trying to use this package within a React site causes an error:
webcastWebsocket.js:26 Uncaught TypeError: Class extends value undefined is not a constructor or null
at Object../node_modules/tiktok-live-connector/dist/lib/webcastWebsocket.js (webcastWebsocket.js:26:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at Object../node_modules/tiktok-live-connector/dist/index.js (index.js:27:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at Object../node_modules/tiktok-live-connector/index.js (index.js:1:1)
at Object.options.factory (react refresh:6:1)
This issue suggests it is a circular import: https://stackoverflow.com/questions/37312197/node-js-v6-2-0-class-extends-is-not-a-function-error/ (but I don't think that's the reason)
This is the code for that file:
import {Component} from "react";
const { WebcastPushConnection } = require('tiktok-live-connector');
class Test extends Component {
render() {
return (
<div />
)
}
}
export default Test;
The Live Connector worked perfectly until yesterday. Today sometimes the Events Fires and sometimes nothing is received. The Connection seems to be established. I get no Errors.
Requesting that you add functionality to capture, display and log TikTok Live battle scores (along with opponent name).
EDIT: Also requesting a checkbox/tickbox to enable/disable timestamps next to all events (gifts, likes, shares, follows, chat messages, etc.)
EDIT 2: Also requesting that the MODERATOR label and NEW GIFTER label is added next to usernames as appropriate
Hey, thats really good idea to make that script. It will helps to make the shows more interactive.
Can you add an ability to save all that data to txt-file in real-time?
(honestly I need the function to forward that data to com-port, but txt-file is fine too)
Could you please suggest me best node.js app starting settings? I run it like this with no additional variables:
forever start app.js
And my connection to the socket is not always stable. maybe because wrong node.js starting values? The connection stops sometimes with xhr post error.
no information
After the last update. What does that mean?
Hello,
There seems to be a new strange issue with the data.gift.repeat_end = 1 not firing, but only for some gifters. I've made sure everything is up to date, and have even tried pointing the https://tiktok-chat-reader.zerody.one/ demo at a room.
From what I can tell, it seems to effect Australian gifters (not the host). I pointed the demo at an Australian live and these gifts of 1 roses show a red x1 that never turn black.
Point it at an American live and they turn black (indicating the repeat_end gift event fired):
Had the gifter try the same American room and only the initial gift (repeat_end = 0) fired in the same way as the Australian one.
Hello. A lot of profile pictures started to return a 403 error. Can you tell me what is the reason for this?
Can I check if user is live or not without connecting?
Hello, i'm getting this error in your demo since some hours.
Error: Failed to retrieve room_id from page source. mainPageHtml.match is not a function
Hi!
When i try to read a chat live, the package don't find the user, i followed the guide but it wont work
I have cloned the public website too but it's isnt working, it's working only your website.
Error: Failed to extract room_id from page source. User might be offline.
SyntaxError: Invalid or unexpected token
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
I have copy pasted the example and started an app.js
How to parse WebcastOecLiveShoppingMessage message type?
Hello, I am trying to show HLS link in client`s console after connect.
I have added this to connectionWrapper:
this.connection.getRoomInfo().then(roomInfo => {
this.log(`HLS URL: ${roomInfo.stream_url.flv_pull_url.HD1}`);
this.emit(`HLS URL: ${roomInfo.stream_url.flv_pull_url.HD1}`);
})
But client does not receive it, it is visible only only in bash console.
I've encountered an issue where it seems like it's only importing all of the data for some gift events. With others, it seems to only be importing the "sender details". I console.log() all of the data and that's all that's showing. It seems to only be happening with some users. Not sure if I'm doing something wrong.
how to get user profile URL in .jpeg format ? since unity doesn't support .webp format.
hint (in html viewer i can see the URL of the user profile after {largeravatar}
for example
i donot need this ( https://p77-sign-sg.tiktokcdn.com/tos-alisg-avt-0068/5ad4ae435e185ff8fc22a32663b4ad10~tplv-tiktok-shrink:72:72.webp?x-expires=1657882800&x-signature=b7Gb8remi6C67xl6e0iCq15beqA%3D )
Would it be possible to list the viewers that are watching the live under the number of viewers please
when i try to start the server in visualstudio code i get this error websocket: false
has happened to someone else thanks
Failed to connect Error: Failed to sign request: Request failed with status code 502; 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=7123874059737205509
at signRequest (/Users/jeremylai/Documents/node/node_modules/tiktok-live-connector/dist/lib/tiktokSignatureProvider.js:81:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async TikTokHttpClient._buildUrl2 (/Users/jeremylai/Documents/node/node_modules/tiktok-live-connector/dist/lib/tiktokHttpClient.js:98:15)
at async TikTokHttpClient.getDeserializedObjectFromWebcastApi (/Users/jeremylai/Documents/node/node_modules/tiktok-live-connector/dist/lib/tiktokHttpClient.js:63:15)
at async WebcastPushConnection._fetchRoomData2 (/Users/jeremylai/Documents/node/node_modules/tiktok-live-connector/dist/index.js:500:25)
at async WebcastPushConnection.connect (/Users/jeremylai/Documents/node/node_modules/tiktok-live-connector/dist/index.js:269:7)
Hello, is this TT issue? When I type these words in chat (any of them) they do not appear in msg.comment.
Do you have any ideas why? They are not offensive or something. Just usual things.
рогатка помощь абзац стадо
Hello,
I found a bug in the data structure of userBadges object when receiving a chat, it's always empty, no matter if the sender is a Moderator or not.
Is it related to this library or the issue is from TikTok's API ?
tiktokChatConnection.connect() shows isConnected: true although the streamer is not streaming anymore. If I go via the url https://www.tiktok.com/@user/live there is a black screen and a text with "LIVE has ended 2.5K viewers".
How to check if the streamer goes live?
i try to log topGifterRank. but it's always return null
my code :
tiktokChatConnection.on('chat', data => {
console.log('name : ' + data.nickname + ' | rank : ' + data.topGifterRank);
});
i'm sure use of latest version:
my package-lock.json:
"tiktok-live-connector": {
"version": "0.9.21",
"resolved": "https://registry.npmjs.org/tiktok-live-connector/-/tiktok-live-connector-0.9.21.tgz",
"integrity": "sha512-6Zhu1NLqd84h5OjGcfyMct7sz8/d1PfuA0sonLpWLPjgH5jCVSr2eIpVEwTucmAph1HpM6NqvxLQtlItpiM1Wg==",
"requires": {
"axios": "^0.25.0",
"protobufjs": "^6.11.2",
"websocket": "^1.0.34"
}
},
na
Hello,
Is there any way we can get sessionId from user's credentials ? If yes, I would gladly help.
I wanted to get the info of any user even if they are not streaming. I found that the getRoomInfo method works great for this, but I can't find the url for the profile picture.
Hi there! Great work on this, it was a lifesaver for me.
One issue I'm running into: when chat events come through, if there isn't immediate other chat messages to push it offscreen, those same chat events run again when it looks for more events (e.g. user 1 comments "hi" once, but the on("chat"...
with that data comes through multiple times. I figured one way to filter it out was to grab the timestamp of the chat message and just make sure I keep a log of previously seen messages, but I can't seem to figure out where to find that kind of stamp info. Is there a way I could modify the lib myself locally to add that data? I tried adding msgId
or timestamp
to the proto for WebcastChatMessage
but neither of those seem to have any affect on the results returned.
can you show an example of how to get the image and name of the gift? and other information
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.