Git Product home page Git Product logo

ttml2ssa's People

Contributors

dokutan avatar frodo19 avatar paco8 avatar stephsc avatar zuzia-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ttml2ssa's Issues

Fixing the punctuation marks in Amazon subtitles

Hi, the punctuation marks in the Amazon subtitles for the Arabic language are not in its correct position (It worked fine with "script.module.ttml2ssa-0.3.2.zip" before).

You could test it in the Arabic subtitle of the movie "Back to the Future Part II" on primevideo, it looks like this.

11

When it should look like this.

22

RLM and LRM in the Netflix subtitles

Thank you so much for your add-on, you did an excellent job, In the Netflix subtitles sometimes we get ‏ and ‎, ‏ needs to be replaced with 'RIGHT-TO-LEFT EMBEDDING' and ‎ needs to be replaced with `LEFT-TO-RIGHT EMBEDDING' for the punctuation marks to be in the correct position in the subtitles, this PR explains the problem.

xbmc/inputstream.adaptive#366

Question

does this support Premiere Pro XML?

Converting SRT to Premiere Pro XML

ttml2ssa.cmd

To get the cmd working from any folder, it should be changed to following :
python "%~dp0src/__main__.py" %*

If one add the folder where ttml2ssa.cmd is located in the PATH, so when calling this app from some other folder it won't give an error that it cannot find src/__main__.py.

This is a very good app, I don't know much about python but as a c++ coder it wasn't much headbreaking to get things working.
And as I like my subs in a bit custom style, it's easy to change the defaults in the ttml2ssa.py to the way I prefer.

ValueError exception for timestamps without fractional or frame part

When trying to convert a ttml file which does not have fractional parts or frames for certain timestamps the tool will fail with the following error:

Converting file.ttml to file.ssa
Opening file.ttml with encoding utf-8
Traceback (most recent call last):
  File "src/__main__.py", line 209, in <module>
    ttml.parse_subtitle_file(input_file, args.encoding)
  File "/home/stephan/projects/ttml2ssa/src/ttml2ssa.py", line 127, in parse_subtitle_file
    self.parse_ttml_file(filename, file_encoding)
  File "/home/stephan/projects/ttml2ssa/src/ttml2ssa.py", line 135, in parse_ttml_file
    self.parse_ttml_from_string(doc.encode('utf-8'))
  File "/home/stephan/projects/ttml2ssa/src/ttml2ssa.py", line 241, in parse_ttml_from_string
    ms_begin, ms_end, text, position = self._process_parag(p)
  File "/home/stephan/projects/ttml2ssa/src/ttml2ssa.py", line 357, in _process_parag
    ms_end = self._tc.timeexpr_to_ms(end)
  File "/home/stephan/projects/ttml2ssa/src/timestampconverter.py", line 115, in fraction_timestamp_to_ms
    hh, mm, ss, fraction = re.split(r'[:.]', timestamp)
ValueError: not enough values to unpack (expected 4, got 3)

Output .ssa files are malformed according to Aegisub

Hi there, I'm trying to edit the .ssa file produced by your tool, using Aegisub. It says the file is malformed:

image

I also tried to load (without modification) the produced file in MPC-HC and if fails with no error.

Using a random online tool to do the conversion, this is what I've found:

yours

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, BackColour, OutlineColour, Bold, Italic, Alignment, BorderStyle, Outline, Shadow, MarginL, MarginR, MarginV
Style: Default,Arial,50,&H00FFFFFF,&H40000000,&H00000000,0,0,2,1,2,3,40,40,40

[Events]
Format: Layer, Start, End, Style, Text
Dialogue: 0,0:00:06.31,0:00:07.52,Default,{\i1}This doesn't work{\i0}

another online tool

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,monospace,20,&H00FFFFFF,&H0300FFFF,&H00000000,&H02000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:06.31,0:00:07.52,Default,,0,0,0,,{\i1}This works{\i0}

Other than minor differences in the style, the main difference is that yours lacks some format fields. It makes sense given the error message "not enought fields".

I'm no subtitle expert, I don't know what's the minimum set of fields required, here there's a good description of what they do but no mention if they are mandatory or not: https://forum.videohelp.com/attachment.php?attachmentid=33290&d=1440307546

Anyway, I'm forking (main...flagg19:ttml2ssa:main) and patching it up adding all missing fields with an empty/default value just to make it work because I need it. I'm opening this issue in case you didn't know and want to do a proper fix.

[Request] zhconv Converts Chinese

Hello Paco8.

I would like to ask you to consider integrating zhconv into the add-on. Let me explain why the streaming service needs Chinese conversion. Because there are multiple variants of Chinese (like French and Canadian French).
So now there is a problem that although the major international streamers (Netflix, Prime Video, Disney Plus) generally provide both Simplified and Traditional Chinese subtitles, many times the translation quality of Simplified Chinese is not as good as Traditional Chinese.
I can convert subtitles through external subtitle tools. But it would be very convenient to convert within Kodi through this add-on.

Thank you for making a very nice streaming service subtitle conversion add-on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.