TikTok-Live-Connector
TikTok-Live-Connector copied to clipboard
Duplicate chat events
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.
hi,
this is a strange behavior. Have not experienced this problem before.
Can you check if a websocket connection is used? You can see this in the promise result of the connect()
function.
Property: upgradedToWebsocket
Hello, I have encountered such a problem, may I ask if there is any way to fix it?
The error did not occur in my case. If someone can reproduce the problem, feel free to fix it.
This may be related to my use of the system agent caused by repeated monitoring, SO far I have not been able to find the cause.
Or 3 or 8 repeat chat events can occur when the number of channels monitored is small.
May I ask here? How to emit roomInfo from 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}`);
})
Is this correct?
The error did not occur in my case. If someone can reproduce the problem, feel free to fix it.
Yes, there is such a problem. It occurs in chats with a small number of participants. I figured out how it happens. The query periodically returns cursor = 0, which causes the chat messages to be requested from the beginning.
I wrote a C# library similar to this one. In my implementation, I simply check that the new cursor is not equal to 0. If it is, then I ignore the query result and make a new one with the previous cursor.
The error did not occur in my case. If someone can reproduce the problem, feel free to fix it.
Yes, there is such a problem. It occurs in chats with a small number of participants. I figured out how it happens. The query periodically returns cursor = 0, which causes the chat messages to be requested from the beginning.
I wrote a C# library similar to this one. In my implementation, I simply check that the new cursor is not equal to 0. If it is, then I ignore the query result and make a new one with the previous cursor.
The null cursor fix is already implemented: https://github.com/zerodytrash/TikTok-Live-Connector/blob/63129d353032b67636600e753393195f355e5c3a/src/index.js#L339-L341
Let me know if the problem persists.
May I ask here? How to emit roomInfo from 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}`); })
Is this correct?
Not sure what you want to do with the code. Please create a new issue since this has nothing to do with this issue.
I have solved this problem. It seems to have some influence on the Network in China. Every time it is reconnected, it will be re-issued. thank you ------------------ 原始邮件 ------------------ 发件人: "zerodytrash/TikTok-Live-Connector" @.>; 发送时间: 2022年4月18日(星期一) 晚上10:09 @.>; @.@.>; 主题: Re: [zerodytrash/TikTok-Live-Connector] Duplicate chat events (Issue #17)
May I ask here? How to emit roomInfo from 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}
); })
Is this correct?
Not sure what you want to do with the code. Please create a new issue since this has nothing to do with this issue.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Thank you for your answer. The problems I have tested are more about the network environment in China.
------------------ 原始邮件 ------------------ 发件人: "zerodytrash/TikTok-Live-Connector" @.>; 发送时间: 2022年4月18日(星期一) 晚上10:06 @.>; @.@.>; 主题: Re: [zerodytrash/TikTok-Live-Connector] Duplicate chat events (Issue #17)
The error did not occur in my case. If someone can reproduce the problem, feel free to fix it.
Yes, there is such a problem. It occurs in chats with a small number of participants. I figured out how it happens. The query periodically returns cursor = 0, which causes the chat messages to be requested from the beginning.
I wrote a C# library similar to this one. In my implementation, I simply check that the new cursor is not equal to 0. If it is, then I ignore the query result and make a new one with the previous cursor.
The null cursor fix is already implemented: https://github.com/zerodytrash/TikTok-Live-Connector/blob/63129d353032b67636600e753393195f355e5c3a/src/index.js#L339
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
I'm also working on the gift question. Find the email reply to you
------------------ 原始邮件 ------------------ 发件人: "zerodytrash/TikTok-Live-Connector" @.>; 发送时间: 2022年4月18日(星期一) 晚上10:09 @.>; @.@.>; 主题: Re: [zerodytrash/TikTok-Live-Connector] Duplicate chat events (Issue #17)
May I ask here? How to emit roomInfo from 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}
); })
Is this correct?
Not sure what you want to do with the code. Please create a new issue since this has nothing to do with this issue.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
@zerodytrash If you look at the proto contents of chat events there are a various types of IDs, I think you can use one of them to identify messages uniquely. I've looked at it briefly but not in-depth
@zerodytrash If you look at there proto contents of chat events there are a various types of IDs, I think you can use one of them to identify messages uniquely. I've looked at it briefly but no in-depth
good point. does anyone still have problems with duplicate events?
Hello, I ran into a problem with duplicate gift event
Hello, I ran into a problem with duplicate gift event
make sure you handle gift streaks correctly https://github.com/zerodytrash/TikTok-Live-Connector#gift
There is a new event attribute msgId
in the latest version which can be used to detect duplicates.
I also encountered the problem of repeated gift messages today, and both msgId and createTime are not repeated