FriendTeamInc / VodBot

A command line interface VOD and Clip manager for Twitch.
MIT License
14 stars 1 forks source link

Chat Archive and Captioning Upload #33

Closed NotQuiteApex closed 3 years ago

NotQuiteApex commented 3 years ago

Closes #32

This pull request will add the ability to download chat logs from Twitch VODs alongside the VOD download itself, as well as the ability to reformat and export said logs into useful closed captioning formats like SAMI and RealText.

NotQuiteApex commented 3 years ago

PR TODO:

NotQuiteApex commented 3 years ago

SAMI Format Document: https://www.w3.org/WAI/sami.html Notes: uses milliseconds for timestamps, doesn't seem to have a stop parameter for SYNC (because of this, may need multilines to stack?). very html/xml-like but has oddities Related stackoverflow question: https://stackoverflow.com/questions/55201241/need-help-to-format-youtube-sami-smi-caption Example:

<SAMI>
    <BODY>
        <SYNC Start=200><P Class=ENUSCC><font color="#ff0000"><b>NotQuiteApex</b></font><font color="#ffffff">: faek PogChamp :y</font>
        <SYNC Start=10000><P Class=ENUSCC><font color="#f0f000"><b>NotQuiteApex</b></font><font color="#ffffff">: faek PogChamp 2!!!!!!!</font>
    </BODY>
</SAMI>

RealText Format Document: http://sites.mpc.com.br/ric/realtext/RealText_tutor.html Notes: uses seconds in quotes (???), text can overlap itself (useful maybe?) Example:

<window type="generic"
 wordwrap="true" />

<font face="arial">

<!-- overlapping chat -->
<time begin="0" end="5"/><font color="#ff0000"><b>NotQuiteApex</b></font><font color="#ffffff">: faek PogChamp :y</font>
<time begin="2" end="10"/><font color="#f0f000"><b>NotQuiteApex</b></font><font color="#ffffff">: faek PogChamp 2!!!!!!!</font>

</font>
</window>

Definitely gonna need some formatting rules and config flags.

NotQuiteApex commented 3 years ago

Also, YouTube let's subtitle tracks be named. VodBot should absolutely name the chat upload appropriately automatically.

EDIT: setting the values of snippet.videoId (the video ID at the end of a youtube url), language ("en-US", should be changeable in config, see here for stuff about bcp-47 names), and name (call it "Twitch Chat" ?) will perform this action.

NotQuiteApex commented 3 years ago

I would like to add support for TTML as well before calling this finished, since that can align text properly.

NotQuiteApex commented 3 years ago

A basic version of TTML is working but colors are broken and it is not adjusting the text to the left as it is supposed to, so I'm leaving it behind for now.