yuppity / ttml2srt

Convert TTML subtitles used by Netflix, HBO, CMore and others to SRT format
The Unlicense
75 stars 32 forks source link

Add support for prime video italics #4

Open Paco8 opened 3 years ago

Paco8 commented 3 years ago

The application can convert the subtitles from amazon prime video but the italic tags are lost in the process. Amazon is using plain <span></span> tags to indicate italics. Some example lines:


   <p begin="00:01:25.336" end="00:01:28.714" region="AmazonDefaultRegion" style="AmazonDefaultStyle"><span>Lugar de nacimiento de Anck-su-namun,</span><br /> <span>concubina del faraón.</span></p>
   <p begin="00:01:28.798" end="00:01:31.425" region="AmazonDefaultRegion" style="AmazonDefaultStyle"><span>Ningún otro hombre podía tocarla.</span></p>
   <p begin="00:01:54.532" end="00:01:58.536" region="AmazonDefaultRegion" style="AmazonDefaultStyle"><span>Pero por amor,</span><br /> <span>estaban dispuestos a arriesgar la vida.</span></p>
   <p begin="00:02:17.888" end="00:02:21.350" region="AmazonDefaultRegion" style="AmazonDefaultStyle">¿Qué estáis haciendo aquí?</p>
   <p begin="00:02:39.577" end="00:02:42.121" region="AmazonDefaultRegion" style="AmazonDefaultStyle">¿Quién te ha tocado?</p>

I made a small modification to check for AmazonDefaultStyle to let the <span> tag to be converted to <i>.

I attach a sample file.

amazons-subs.zip