Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat out of sync - issue with Twitch itself? #1285

Open
2 tasks done
egormelyakin opened this issue Jan 7, 2025 · 10 comments
Open
2 tasks done

Chat out of sync - issue with Twitch itself? #1285

egormelyakin opened this issue Jan 7, 2025 · 10 comments
Labels
external The issue exists within an external library

Comments

@egormelyakin
Copy link

egormelyakin commented Jan 7, 2025

Checklist

Edition

Command Line Interface

Describe your issue here

When downloading and rendering chat from a Twitch clip, it is about 30-40 seconds in front of the clip itself, meaning the clip is delayed behind the chat replay. When opening the clip page in a browser, the chat replay there matches with the rendered chat exactly, being also in front of the clip, but chat replay on the VOD page is in sync with the video.

Add any related files or extra information here

For example, in this clip, the word "transaction" is mentioned right at the end of the clip, but in both the rendered chat and the chat replay on the clip page, this word is mentioned in one of the first messages, giving the desync of about 40 seconds.

In the chat replay on the VOD page, this desync is not there, only the clip page, possibly indicating some issue with Twitch clips themselves. I am not sure whether this is an issue or my end, or whether this issue is even new or not

Rendered chat

HonorablePoorWasabiPRChase-GoFX7qTL_BCvznuZ.mp4
@egormelyakin egormelyakin added the bug Something isn't working label Jan 7, 2025
@ScrubN
Copy link
Collaborator

ScrubN commented Jan 7, 2025

I noticed this behavior when viewing a clip on the Twitch website a bit ago. I'm not sure if theres much we can do.

@ScrubN ScrubN added external The issue exists within an external library and removed bug Something isn't working labels Jan 7, 2025
@Mishasama
Copy link

This is a bug on Twitch's side, and we can't do anything about it. You can try reporting it to them.

@egormelyakin
Copy link
Author

Yes, appears to be something with Twitch. As a temporary workaround, what I found seems to work, is instead of downloading the clip chat, to get clip info through the API, and download the chat for the VOD with the --beginning set to vod_offset - clip_duration, and --ending set to vod_offset. Not the most straightforward solution, but seems to work.

Seems to me that the vod_offset field responsible for the chat sync now mistakenly points at the end of the clip instead of the beginning, and that causes all the clip chat replays to be out of sync by exactly the length of the clip.

@Mishasama
Copy link

> a temporary workaround

The problem is that the VOD will eventually be deleted due to expiration, while the clip will exist forever. In this case, it will not be possible to obtain the chat history from the VOD.

Is there a need to add a new temporary feature that will no longer be needed sooner or later specifically for the Twitch bug? I feel like he should be pretty busy these days...

@superbonaci
Copy link
Contributor

@egormelyakin This is what I get with the Twitch API about the clip:

{
  "data": [
    {
      "id": "HonorablePoorWasabiPRChase-GoFX7qTL_BCvznuZ",
      "url": "https://clips.twitch.tv/HonorablePoorWasabiPRChase-GoFX7qTL_BCvznuZ",
      "embed_url": "https://clips.twitch.tv/embed?clip=HonorablePoorWasabiPRChase-GoFX7qTL_BCvznuZ",
      "broadcaster_id": "71092938",
      "broadcaster_name": "xQc",
      "creator_id": "160337225",
      "creator_name": "Dado_Hajduk",
      "video_id": "2346188660",
      "game_id": "23020",
      "language": "en",
      "title": "\"YOU LIAR!\" xD",
      "view_count": 1721,
      "created_at": "2025-01-06T22:57:23Z",
      "thumbnail_url": "https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/HonorablePoorWasabiPRChase-GoFX7qTL_BCvznuZ/8598e3fb-5514-48fc-b790-4b40a79f90d6/preview-480x272.jpg",
      "duration": 40.6,
      "vod_offset": 8914,
      "is_featured": false
    }
  ],
  "pagination": {}
}

The problem is that the VOD will eventually be deleted due to expiration, while the clip will exist forever. In this case, it will not be possible to obtain the chat history from the VOD.

Yes, but the problem is that it affects all VODS
, not only this one. I don't think Twitch has enough storage to just keep all VODS, it would use insane amounts of hard drives.

Some people complain that Highlights don't save the chat, but for some clearly there is:
Why does Twitch sometimes not save my chat in Highlights?

About the chat history for the Highlight, I don't know if Twitch keeps the entire chat of the VOD and only shows the corresponding part in the highlight, or trims the chat the same duration of the highlight. Then it would be a problem if does not match exactly...

@superbonaci
Copy link
Contributor

superbonaci commented Jan 10, 2025

The starting point of the highlight in the VOD is not accurate either, for example

https://www.twitch.tv/xqc/clip/MotionlessBenevolentVampireGOWSkull-6PyPUdoKvIZS2jlK

links to VOD 1:28:32 where says "Watch Full Video"
https://twitch.tv/videos/2346188660?tt_content=full_vod_button&tt_medium=clips_watch_page&t=1h28m32s

But in the VOD the highlight starts at 1:28:08
https://www.twitch.tv/videos/2346188660?t=1h28m08s

so it's 24 seconds more. The highlight duration is 28 seconds:

{
  "data": [
    {
      "id": "MotionlessBenevolentVampireGOWSkull-6PyPUdoKvIZS2jlK",
      "url": "https://clips.twitch.tv/MotionlessBenevolentVampireGOWSkull-6PyPUdoKvIZS2jlK",
      "embed_url": "https://clips.twitch.tv/embed?clip=MotionlessBenevolentVampireGOWSkull-6PyPUdoKvIZS2jlK",
      "broadcaster_id": "71092938",
      "broadcaster_name": "xQc",
      "creator_id": "39296520",
      "creator_name": "kewkpad",
      "video_id": "2346188660",
      "game_id": "509658",
      "language": "en",
      "title": "LOL",
      "view_count": 1717,
      "created_at": "2025-01-06T21:56:59Z",
      "thumbnail_url": "https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/MotionlessBenevolentVampireGOWSkull-6PyPUdoKvIZS2jlK/b611639c-b94b-46c8-b2c7-21739b868bbf/preview-480x272.jpg",
      "duration": 28.7,
      "vod_offset": 5312,
      "is_featured": false
    }
  ],
  "pagination": {}
}

But don't know if that has something to do.

@superbonaci
Copy link
Contributor

the chat of the VOD can't be downloaded once the VOD expires, I've checked and get the error

(Invalid VOD, deleted/expired VOD possibly?)

@Mishasama
Copy link

I think the best practice at the moment is for users to use the enqueue function of VOD Download to fetch data for a specified range of clips and chats at the same time before the VOD corresponding to the clip expires. Then they can deal with it on their own. As for the case where the VOD has already expired, there is nothing we can do about it.

It's not like we can just add in the clip download module whether the VOD has expired or not, and then handle it differently depending on the situation, is it?
I know this will be convenient... but it's ultimately a bug on Twitch's part, and I still think it's more appropriate to encourage users to complain about it in a big way — because you guys already paid for it.

@ScrubN
Copy link
Collaborator

ScrubN commented Jan 11, 2025

The problem is that the VOD will eventually be deleted due to expiration, while the clip will exist forever. In this case, it will not be possible to obtain the chat history from the VOD.

Clip chats are generated by Twitch servers based on the VOD chat. In other words, when the VOD expires, the clip chat log expires with it.

@ScrubN
Copy link
Collaborator

ScrubN commented Jan 11, 2025

Seeing the example from suberbonaci about the clip offset being wrong too, it seems impossible for us to patch around the issue on our end. It needs to be fixed by Twitch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue exists within an external library
Projects
None yet
Development

No branches or pull requests

4 participants