Python script to convert the Json containing all the chat of Twitch, to the Youtube Timed Text subtitle format (YTT).
- Use the users' colors
- Create a unique color for users who don't have one
- Display the subtitles in chat order (new at bottom). Do this by compiling collisions
- Display the chat at the bottom left of the screen
- Display unicode emojis
- Doesn't show Twitch only emojis (show only their names)
- Doesn't show users' badges
Either make it executable (chmod +x
), or just run python3 convert-combined-ytt.py twitchChat.json
. It will write the output to the console. You can save the file by redirecting the output with >
:
python3 convert-combined-ytt.py twitchChat.json > twitchChat.ytt
You can also use a second command line argument to set an output file. It's probably needed if your console/cmd is not in UTF-8. Beware, it'll write to the file without any confirmation asked if the file exists, overwritting it by default.
python3 convert-combined-ytt.py twitchChat.json twitchChat.ytt
You can use Twitch Downloader to download the JSON of the Twitch Chat :
TwitchDownloaderCLI -m ChatDownload -u videoID -o videoID.json
I also used YTSubConverter extensively to understand the YTT format. Note that they implemented at my request a feature to handle the reverse order of Collision in .ass format, allowing for chat order of subtitles (new at bottom).
This tool is great, so don't hesitate to use it if it fits your needs more.
Note that in order to do this script, I also made JSON to .ssa and JSON to .ass converters. If you want them, ask and I'll add them.
The script may have bugs. I didn't test it extensively. But looks good as far as I know. Don't hesitate to comment if you find bugs.
So.
Yeah, Youtube does everything locally, and it's a pain because it uses a lot of CPU. But I can't do nothing about that :/
About the preview, yeah, I know, Youtube shows only the classic subtitle way. But you have to keep in mind that this tool is only to sync the subtitles. If you upload the ytt, it will work as the video on the example. You can try on a private video to be sure, if you like, but I confirm it works.
I will eventually add the others converters, but keep in my that they don't work for Youtube. They are just for local play.
YTT (and some sort of JSON) are the only formats working in YT.