arcusmaximus / YTSubConverter

A tool for creating styled YouTube subtitles
MIT License
767 stars 55 forks source link

Non-Printable Character Inside YTT File? #62

Closed LexBarun closed 2 years ago

LexBarun commented 2 years ago

I need to modify the YTT file to recolor the characters with a color gradient. Later, I got a black background box at the beginning of each CC and found there's a non-printable character (U+200B, Zero Width Space) on each <p>. For example: <p t="46063" d="1401" p="21" wp="1" ws="1">U+200Bkimi ni deatte</p> My question is, are they actually needed for YTT? Thanks!

arcusmaximus commented 2 years ago

The simple answer is yes, they are needed. YouTube's subtitle display is actually full of bugs, and YTSubConverter uses zero-width spaces to work around many of them.

If you want to create a color gradient, it'll be much easier to do this before conversion (in the .ass file) rather than after. I'm attaching my Aegisub script for doing just that. Rename it to gradient.lua, place it in Aegisub's "automation" folder, and activate it from Aegisub's "Automation -> Apply gradient" menu. The UI should be self-explanatory. gradient.lua.txt