zenwarr / mpv-config

Collection of my personalized mpv scripts and configuration files
20 stars 3 forks source link

subtitle-search: remove ass subtitle font tags and color #11

Closed mrfragger closed 1 year ago

mrfragger commented 1 year ago

Thanks so much for this script. Use it for audiobooks to search vtt subtitles. Came across this mkv with embedded ass subs for a movie and it would show 01.20.53.599: <font color="#804040">Name:</font> Get inside

appended these two search/replace lines which solved it under -- remove voice tag

 text = string.gsub(text, '<font color="#%d%d%d%d%d%d">', "")
 text = string.gsub(text, '</font>', "")

01.20.53.599: Name: Get inside

zenwarr commented 1 year ago

Thank you for using the config and for your contribution! I've modified your code to match hex numbers and predefined color names too, and included it into the fix.