Amazon Video - subtitle downloader

Allows you to download subtitles from Amazon Video

< Feedback on Amazon Video - subtitle downloader

سوئال / ئىنكاس

§
يوللانغان ۋاقتى: 2022-11-14
تەھرىرلەنگەن ۋاقتى: 2022-11-14

Hi, thanks for the script.
But I found someting wrong with Japanese Subs.
There is Ruby Character in Japanese, but this script can't deal with it.
For example,"早(はや)く脱出(だっしゅつ)ロケットへ" will be like "早はやく 脱出だっしゅつロケットへ", which is confused.
ttml2 file: https://p.sda1.dev/8/c401ab81ffe19b7a27c576fede34309f/_2021.ttml2
SRT file: https://p.sda1.dev/8/61dbdf5a2a3fbfabe1bc01b7ec4f1d3c/_._2021.srt

Tithen-Firionئاپتور
§
يوللانغان ۋاقتى: 2022-11-14

Don't have access to any Amazon video with Japanese subs to test, so you will have to test it yourself before I make the changes official:

At line 80, change

  let italic = line.getAttribute('tts:fontStyle') === 'italic';
  let bold = line.getAttribute('tts:fontWeight') === 'bold';
  if(topStyle !== null) {
    italic = italic || styles[topStyle][0];
    bold = bold || styles[topStyle][1];
  }

  if(italic) {
    prefix = '<i>';
    suffix = '</i>';
  }
  if(bold) {
    prefix += '<b>';
    suffix = '</b>' + suffix;
  }

to

  let italic = line.getAttribute('tts:fontStyle') === 'italic';
  let bold = line.getAttribute('tts:fontWeight') === 'bold';
  let ruby = line.getAttribute('tts:ruby') === 'text';
  if(topStyle !== null) {
    italic = italic || styles[topStyle][0];
    bold = bold || styles[topStyle][1];
    ruby = ruby || styles[topStyle][2];
  }

  if(italic) {
    prefix = '<i>';
    suffix = '</i>';
  }
  if(bold) {
    prefix += '<b>';
    suffix = '</b>' + suffix;
  }
  if(ruby) {
    prefix += '(';
    suffix = ')' + suffix;
  }

At line 134 (NOW 134, before change it's line 128) change:

      const italic = style.getAttribute('tts:fontStyle') === 'italic';
      const bold = style.getAttribute('tts:fontWeight') === 'bold';
      styles[id] = [italic, bold];

to

      const italic = style.getAttribute('tts:fontStyle') === 'italic';
      const bold = style.getAttribute('tts:fontWeight') === 'bold';
      const ruby = style.getAttribute('tts:ruby') === 'text';
      styles[id] = [italic, bold, ruby];

Save, download some subs, test if it's how it should be and let me know. If everything's ok I'll push a new version of the script.

§
يوللانغان ۋاقتى: 2022-11-14

Don't have access to any Amazon video with Japanese subs to test, so you will have to test it yourself before I make the changes official:

At line 80, change

  let italic = line.getAttribute('tts:fontStyle') === 'italic';
  let bold = line.getAttribute('tts:fontWeight') === 'bold';
  if(topStyle !== null) {
    italic = italic || styles[topStyle][0];
    bold = bold || styles[topStyle][1];
  }

  if(italic) {
    prefix = '<i>';
    suffix = '</i>';
  }
  if(bold) {
    prefix += '<b>';
    suffix = '</b>' + suffix;
  }

to

  let italic = line.getAttribute('tts:fontStyle') === 'italic';
  let bold = line.getAttribute('tts:fontWeight') === 'bold';
  let ruby = line.getAttribute('tts:ruby') === 'text';
  if(topStyle !== null) {
    italic = italic || styles[topStyle][0];
    bold = bold || styles[topStyle][1];
    ruby = ruby || styles[topStyle][2];
  }

  if(italic) {
    prefix = '<i>';
    suffix = '</i>';
  }
  if(bold) {
    prefix += '<b>';
    suffix = '</b>' + suffix;
  }
  if(ruby) {
    prefix += '(';
    suffix = ')' + suffix;
  }

At line 134 (NOW 134, before change it's line 128) change:

      const italic = style.getAttribute('tts:fontStyle') === 'italic';
      const bold = style.getAttribute('tts:fontWeight') === 'bold';
      styles[id] = [italic, bold];

to

      const italic = style.getAttribute('tts:fontStyle') === 'italic';
      const bold = style.getAttribute('tts:fontWeight') === 'bold';
      const ruby = style.getAttribute('tts:ruby') === 'text';
      styles[id] = [italic, bold, ruby];

Save, download some subs, test if it's how it should be and let me know. If everything's ok I'll push a new version of the script.

I downloaded some subs, and it worked well.
Thank you very much!

§
يوللانغان ۋاقتى: 2022-11-19
تەھرىرلەنگەن ۋاقتى: 2022-11-19

Don't have access to any Amazon video with Japanese subs to test, so you will have to test it yourself before I make the changes official:

At line 80, change

  let italic = line.getAttribute('tts:fontStyle') === 'italic';
  let bold = line.getAttribute('tts:fontWeight') === 'bold';
  if(topStyle !== null) {
    italic = italic || styles[topStyle][0];
    bold = bold || styles[topStyle][1];
  }

  if(italic) {
    prefix = '<i>';
    suffix = '</i>';
  }
  if(bold) {
    prefix += '<b>';
    suffix = '</b>' + suffix;
  }

to

  let italic = line.getAttribute('tts:fontStyle') === 'italic';
  let bold = line.getAttribute('tts:fontWeight') === 'bold';
  let ruby = line.getAttribute('tts:ruby') === 'text';
  if(topStyle !== null) {
    italic = italic || styles[topStyle][0];
    bold = bold || styles[topStyle][1];
    ruby = ruby || styles[topStyle][2];
  }

  if(italic) {
    prefix = '<i>';
    suffix = '</i>';
  }
  if(bold) {
    prefix += '<b>';
    suffix = '</b>' + suffix;
  }
  if(ruby) {
    prefix += '(';
    suffix = ')' + suffix;
  }

At line 134 (NOW 134, before change it's line 128) change:

      const italic = style.getAttribute('tts:fontStyle') === 'italic';
      const bold = style.getAttribute('tts:fontWeight') === 'bold';
      styles[id] = [italic, bold];

to

      const italic = style.getAttribute('tts:fontStyle') === 'italic';
      const bold = style.getAttribute('tts:fontWeight') === 'bold';
      const ruby = style.getAttribute('tts:ruby') === 'text';
      styles[id] = [italic, bold, ruby];

Save, download some subs, test if it's how it should be and let me know. If everything's ok I'll push a new version of the script.

Hello, I ran into another issue when downloading some subtitles.
"TypeError: Cannot read properties of undefined (reading 'catalog')" was the error message that appeared.

Tithen-Firionئاپتور
§
يوللانغان ۋاقتى: 2022-11-19

Can you watch that? If you can't then you can't download the subtitles either.

§
يوللانغان ۋاقتى: 2022-11-20

Can you watch that? If you can't then you can't download the subtitles either.

Yes, I can watch it: https://imgur.com/a/YDciz3c

Tithen-Firionئاپتور
§
يوللانغان ۋاقتى: 2022-11-20

Let's take it to PMs.

جاۋاب قايتۇرۇش

جاۋاب قايتۇرۇش ئۈچۈن كىرىش.