Closed TheMadog24 closed 1 year ago
As far as I can tell none of the current requests that we make return stream chapters and I have no clue where to begin looking. If @lay295 can figure out the request then I would easily be able to implement the metadata to downloaded videos.
Oh interesting. On the one hand, yes that is helpful, but on the other hand, the mainapp.py script (where I assume the queries are made) is fucking 27,000 lines. I'll try looking through it.
I dunno if they've changed their GQL call but this is what I've used before
Tartube does not handle chapters, it is merely a glorified yt-dlp GUI frontend. Here is the script responsible for all of the metadata scraping in yt-dlp. It looks like there's a lot of other metadata we could grab as well so I may look into that too.
right now, the only player i know that reads embedded chapter metadata is VLC. But I'm using mediainfo.js in my project to extract the metadata, and form a chapters menu with it. If there is other metadata you can grab, that would be interesting.
Personally, I'd be in favor of storing whatever metadata we gather inside the chat json instead of somehow in the mp4 file.
I am a little afraid Twitch is gonna crack down more on these GQL calls with the integrity endpoint check... But we'll cross that road when we get there.
Storing the chapters and other metadata in the chat file would actually make it much easier to work with for me, since Mediainfo.js can't be a local file, and doesn't work offline.
I am also surprised that you guys haven't asked what I'm working on that uses TwitchDownloader. You have all been very nice and willing to help, despite all of my odd requests, lol.
I assumed you just wanted the chapters for playback purposes. If you're going to be actually using the information then we should add it to both video and chat files. It could be practical in the future for chats anyways.
Also VLC, MPV, Handbrake, XMedia, and Gnome Videos are all able to read chapter data.
If you're going to be actually using the information then we should add it to both video and chat files. It could be practical in the future for chats anyways.
For my application of it, either is fine, and both is also fine. Having the chapter data stored in the video file is how it works now, but that system doesn't work if you have no internet (since it relies on web resources). Having it stored in the chat file would allow me to always make it work, but that also relies on the people pairing the correct video and chat together.
Also VLC, MPV, Handbrake, XMedia, and Gnome Videos are all able to read chapter data.
AH, I forgot about Handbrake, but I'm not familiar with the others.
To further this, even if you wanted to export those chapters to a separate file, that would also work for me. I believe Chapter files are stored as .WebVTT
?
As far as I can tell chapters are not standardized as a whole, they're standardized per encoding format/tool
https://twitch.tv/videos/1694846567
Note: The "date" metadata key is known as "year" in most formats.
I'm torn between directly embedding the GQL chapter response or beautifying it in ChatRoot.
Edit: I think I'll beautify it so it's easier to understand in layman's
Here's the current chatdownload version. Any objections/suggestions? I assume there's more chapter types than just GAME_CHANGE
, probably stream markers, that would fill in the empty strings but I'm having trouble with EditThisCookie so I can't verify this.
I'm not sure if I'm the one you're asking, but it looks great to me!
I assume there's more chapter types than just
GAME_CHANGE
, probably stream markers, that would fill in the empty strings but I'm having trouble with EditThisCookie so I can't verify this.
By using cookie quick manager with firefox, I was able to get my token and confirm that stream markers are not returned in the chapter response. Not sure if there really is any chapter type other than GAME_CHANGE
, though I will still keep the check in videodownload just in case.
Feel free to correct me if I am wrong, but I thought the stream markers were only visible by the streamer.
If a user has editor permissions then they can also see stream markers.
Checklist
Write your feature request here
I would love to be able to have chapters in one way or another, whether it be generating a chapter file, or embedding chapters into the mp4 metadata with ffmpeg.