Zibbp / ganymede

Twitch VOD and Live Stream archiving platform. Includes a rendered and real-time chat for each archive.

Home Page:https://github.com/Zibbp/ganymede

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game Categories List Per VoD?

AdamGaffney96 opened this issue · comments

Hi there, first off I love the app, been running it for a while now and I find it so much nicer and less awful to use than Twitch's VoD player. The only thing I feel like it critically missing is a list of which games have been played in the VoD. I don't even mind about it being timestamped or anything, it's easy enough to seek through a video to find it, however when you have a large archive it would be nice to just find the VoD's with the games you are interested in at a glance.

I assume this is info that can be fetched from the Twitch API as there is already the feature to filter downloads by game when setting up a watched channel, but are there any limitations that would cause this to not be pulled through? And if not, is it already pulled through and I'm just missing it?

Thanks,
Adam

This is possible using the GraphQL API and is already used to filter games as you said.

func GQLGetChapters(id string) (GQLChapterResponse, error) {
body := fmt.Sprintf(`{"operationName":"VideoPlayer_ChapterSelectButtonVideo","variables":{"videoID":"%s","includePrivate":false},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"8d2793384aac3773beab5e59bd5d6f585aedb923d292800119e03d40cd0f9b41"}}}`, id)
resp, err := gqlChapterRequest(body)
if err != nil {
return resp, fmt.Errorf("error getting video chapters: %w", err)
}
return resp, nil
}

I can have this run before the video JSON manifest is saved and include it in that. I'll probably also end up creating a database table to hold these as well so it's easier to query.

The player already supports chapters so I just need to get that information into the player which would look something like this
image

I wonder, would this be something only available for VoD's going forward, or would it be possible to refresh this metadata for existing VoD's (if they still exist on Twitch of course)?

I can create a task that will go through all vods and run a function to add this information. I can for sure add the chapters to the database and most likely to the info.json file as well.

Maybe a future version 2 of this could allow manual chapter creation via the ui.