rany2 / edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
https://pypi.org/project/edge-tts/
GNU General Public License v3.0
4.21k stars 444 forks source link

Ampersand (&) is converted to HTML version (&) in subtitles #184

Closed Scoffins closed 1 month ago

Scoffins commented 5 months ago

When outputting subtitles, ampersands (&) in text input are converted to & in the subtitles file.

This is a problem when using the subtitles file in things like FFMPEG.

rany2 commented 5 months ago

Doesn't WebVTT require this? I think it's valid

Scoffins commented 5 months ago

I'm not sure about that but when I replace & with & in the subtitle file it works perfectly. But I've only tested with FFMPEG so I don't know how it would respond to other encoders/players. For now it's not a major issue as I'm using SED to automatically replace the html entity, but it would be nice to not need the extra command and temp file to accomplish it.

Very good work here btw, this tool is incredibly useful and much easier than making the calls manually via cURL. Thank you.

rany2 commented 1 month ago

I'll be using a real subtitles library soon instead of my homegrown one which will support multiple subtitle formats. My WebVTT implementation is actually correct but unfortunately the support is a bit shoddy as it's not wildly used

rany2 commented 1 month ago

Anyway it's not actually a bug, just caused by poor WebVTT support.