Comments (11)
Why are you so cool? It works. Thank you.
from tiktok-live-connector.
hi,
the like
and social
event were introduced 2 days ago. I would assume that you need to update the package.
Simply run npm i tiktok-livestream-chat-connector
to install the latest version.
from tiktok-live-connector.
btw note that the social
event also contains shares.
from tiktok-live-connector.
It helped, thank you! Could you please suggest, why can gifts come doubled? The gift event fires twice on every gift.
socket.on('gift', function(msg){
|
| console.log("gift");
| if (msg.giftId == "6064") {hp -= 10;gift1b.load();gift1b.play();console.log(msg.giftId)}
| if (msg.giftId == "5487") {hp -= 50;gift2b.load();gift2b.play();}
| if (msg.giftId == "5524") {hp -= 1000;gift3b.load();gift3b.play();}
| if (msg.giftId == "5655") {hp += 10;gift4b.load();gift4b.play();console.log(msg.giftId)}
| if (msg.giftId == "5177") {hp += 50;gift5b.load();gift5b.play();}
| if (msg.giftId == "5354") {hp += 1000;gift6b.load();gift6b.play();}
|
| });
They come one after another. 2 times one gift.
from tiktok-live-connector.
Users have the capability to send gifts in a streak. This increases the gift
.repeat_count
value until the user terminates the streak. During this time new gift events are triggered again and again with an increased repeat_count
value.
From what I have seen, the repeat_count
value is not always correct. But this seems to be a tiktok issue...
Take a look at the latest reader demo, which now also displays gifts: https://github.com/zerodytrash/TikTok-Chat-Reader
from tiktok-live-connector.
Hmmm... On our test streams even the first single gift came twice. There was no gift streaks before that user...
from tiktok-live-connector.
does the problem also occur on https://tiktok-chat.herokuapp.com/ ?
from tiktok-live-connector.
from tiktok-live-connector.
Just tested on your Heroku app - same! Gifts come twice. Is there a way to ignore repeat_count and show any gifts only once?
from tiktok-live-connector.
okay, i took a closer look and found out that tiktok transmits the gift with the final repeat count at the end of a streak. This happens even if the gift was sent only once by the viewer. But that doesn't always happen. Strange. To find out if the gift is a final streak summary, you can use the repeat_end
property. It is set to 0
for a running streak and 1
for a finished streak. So if only one gift was sent, sometimes you will get two gift events. One with repeat_end
:0
and another with repeat_end
:1
.
in logic like this:
if(data.gift.repeat_end === 1) {
// streak end, process gift
} else {
// is still in streak phase. ignore or show/count temporarily.
}
from tiktok-live-connector.
Hi help me pls
from tiktok-live-connector.
Related Issues (20)
- envelope
- Websocket error
- Every few minutes, the connection stops, possibly due to Cloudflare implemented on TikTok. This issue also exists in the Python version
- TypeError: ProxyAgent is not a constructor
- ranked members joining not detected HOT 1
- Parse Error HOT 5
- Error: Failed to fetch room info. timeout of 10000ms exceeded
- Too Many Requests [429] HOT 2
- [Bug] Unhandled "Interval" when process is shutdown leading to application Timeouts.
- Too Many Requests [429] HOT 2
- [Bug] Connected to the live room and no data was received after that HOT 8
- More info on these config URLs
- Websocket connection failed, Error: Expected a Sec-WebSocket-Protocol header. HOT 6
- Error: Request failed with status code 429 HOT 3
- [Question] Any way to obtain a real-time list of the most viewed live streams on the platform?
- How can I contact you?
- Too Many Requests [429]
- Failed to connect Error: Missing cursor in initial fetch response. HOT 12
- Not continue listening after the StreamEnd
- liveIntro event always saying "Kommt auf denn Server drauf!!!" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiktok-live-connector.