Amazon Video - subtitle downloader

Allows you to download subtitles from Amazon Video

< Feedback on Amazon Video - subtitle downloader

Review: Good - script works

§
Posted: 21-02-2022
Edited: 21-02-2022

The script works great, but I noticed that Amazon has started to include italics in the subs (at least for their original shows).

An example I found is from Reacher S01E02, where italics are used in various parts of the episode. I looked through the console and found the code used for them, which are . They only need to be replaced with to be compatible with normal video-players.

The same code is used for other languages as well, here are a few examples of English and Spanish LA:

English

[Charlie] My husband
trusted Reacher.

Spanish LA

Mi esposo confiaba en Reacher.

Please consider adding this feature. Thanks!!

§
Posted: 21-02-2022
Edited: 21-02-2022

I couldn't find a way to post the full code without the lines dissapearing, the codes used for italics by Amazon are <$pan style="s0"> and <$pan> (replace $ with s and add the / symbol before the closing span), they only have to be replaced with the italic codes used by other services (the ones with "i").

§
Posted: 21-02-2022

I posted more lines from that episode to Pastebin, so you can have a detailed look at the code.
https://pastebin.com/tFfm2shy

§
Posted: 21-02-2022

Markdown's code block works fine:

   <p begin="00:00:43.461" end="00:00:45.379" region="r0"><span style="s0">[thunder crashes]</span></p>
   <p begin="00:00:45.463" end="00:00:48.424" region="r0"><span style="s0">[thunder rolling]</span></p>

```
text
```

Anyway, I don't have access to any amazon acc so send me a full subtitle file. IIRC Amazon has a section where they define styles so that s0 won't always be italics. But I don't know if making a half-assed parser for their format is a good idea. Maybe it's better to just let people download original subs in xml format. Then they can convert them in programs like SubtitleEdit which does much better job. To do that you can replace line

function xmlToSrt(xmlString, lang) {

with

function xmlToSrt(xmlString, lang) { return xmlString;
§
Posted: 22-02-2022

I extracted both English and Spanish subs from the episode above.
https://www33.zippyshare.com/v/tkzabvrt/file.html

The other stuff that gets added aside from the italics are codes for "fontface" and "color", all of them in the same lines as the italics. Also saw a placement code like {\an8}, but only on the English subs.

§
Posted: 22-02-2022

Give version 1.9.0 a try. I don't plan to add colours and fonts. Just italics, bold and position (just top or bottom, determined by second value of tts:origin in region element - if it's lower than 50% then it's going to the top of the screen).

§
Posted: 24-02-2022

Give version 1.9.0 a try. I don't plan to add colours and fonts. Just italics, bold and position (just top or bottom, determined by second value of tts:origin in region element - if it's lower than 50% then it's going to the top of the screen).

The 1.9.0 version works almost flawlessly (both italics and position are kept now), but there's a "Failed to parse XML subtitle file, see browser console for more details" message displayed various times when downloading, related to the Japaneses subtitles. It fails to convert those from .ttml2 to .srt for some reason.

§
Posted: 24-02-2022

Then send me them so I can fix the problem.

§
Posted: 24-02-2022

Then send me them so I can fix the problem.

I added the subs from two episodes here: https://www46.zippyshare.com/v/BVojJggL/file.html
Not sure what would be the cause of the issue, as I don't see any special characters that would mess up the conversion.

§
Posted: 24-02-2022

Regions in those subs are missing "origin" attribute. Added a default value, 1.9.1 should convert those Japanese subs correctly. But they use some other features of styles and regions and I don't plan to support them, so I don't know how good the conversion is.

§
Posted: 03-03-2022
Edited: 03-03-2022

Regions in those subs are missing "origin" attribute. Added a default value, 1.9.1 should convert those Japanese subs correctly. But they use some other features of styles and regions and I don't plan to support them, so I don't know how good the conversion is.

The conversion works fine now, the previous error message doesn't appear anymore.

Thank you for taking the time to update the code for special characters :)

Post reply

Sign in to post a reply.