Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error converting ttml from BBC iPlayer #9

Open
nanderer opened this issue Dec 3, 2023 · 1 comment
Open

error converting ttml from BBC iPlayer #9

nanderer opened this issue Dec 3, 2023 · 1 comment

Comments

@nanderer
Copy link

nanderer commented Dec 3, 2023

Hi,

i got this error

$ python3 ttml2srt.py Doctor\ Who:\ Unleashed\,\ 60th\ Anniversary\ Specials\,\ Wild\ Blue\ Yonder\ \[m001t439\].en.ttml Doctor\ Who:\ Unleashed\,\ 60th\ Anniversary\ Specials\,\ Wild\ Blue\ Yonder\ \[m001t439\].en.srt
Traceback (most recent call last):
  File "ttml2srt.py", line 572, in <module>
    ttml.write2file(getattr(args, 'output-file') or '-')
  File "ttml2srt.py", line 489, in write2file
    for parag in self.paragraphs(generator=True):
  File "ttml2srt.py", line 462, in paragraphs
    for i, s in enumerate(self.to_paragraphs()))
  File "ttml2srt.py", line 380, in to_paragraphs
    [self.process_parag(p) for p in self.lines], key=lambda x: x[0])
  File "ttml2srt.py", line 380, in <listcomp>
    [self.process_parag(p) for p in self.lines], key=lambda x: x[0])
  File "ttml2srt.py", line 371, in process_parag
    ms_begin, subrip_begin = self.timeexpr_to_subrip(begin)
  File "ttml2srt.py", line 310, in timeexpr_to_subrip
    ms = self.timeexpr_to_ms(time_expr) + self.shift
  File "ttml2srt.py", line 131, in timeexpr_to_ms
    return self._timeexpr_to_ms(*args)
  File "ttml2srt.py", line 139, in _timeexpr_to_ms
    return self.timeexpr_to_ms(time_expr)
  File "ttml2srt.py", line 250, in frame_timestamp_to_ms
    hh, mm, ss, frames = [int(i) for i in timestamp.split('.')[0].split(':')]
ValueError: not enough values to unpack (expected 4, got 3)

when trying to convert this file
231203ttmlError.zip

please have a look into it, thx!

@nanderer
Copy link
Author

nanderer commented Dec 4, 2023

btw codingcatgirl's is not crashing but your tool got a better syntax and seams to work more accurately ...

yuppity added a commit that referenced this issue Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant