KBlixt / subcleaner

removes ads from subtitle files cleanly.
288 stars 13 forks source link

".." breaks script #24

Closed altano closed 1 year ago

altano commented 1 year ago

Hey, first off thanks for making this script.

I am processing a large number of srt files and I got several errors. The common thing with all the blocks that cause errors are that they start and end in "..", like so:

387
00:23:08,086 --> 00:23:10,680

..but the way he
describes me...

This gives me the following error:

➜  subcleaner git:(master) python3 ./subcleaner.py --dry-run --library ~/Downloads/Star\ Trek\ -\ Voyager\ -\ Subtitles -r ~/Downloads/Star\ Trek\ -\ Voyager\ -\ Subtitles -e
   ERROR: subcleaner was unable to decode the file. reason:
   ERROR: Parsing error at block ..but the way he in file /Users/alan/Downloads/Star Trek - Voyager - Subtitles/Star_Trek_Voyager - season 7.en/Star Trek Voyager - 7x17 - Workforce  Part 2.DVD.en.srt.
KBlixt commented 1 year ago

Will look into this asap

But from my initial view this seems to be a miss configured srt file.

Srt specifies that spaces are only allowed between blocks, not between the time stamp and the content.

I'll look into handling this though.

KBlixt commented 1 year ago

I have implemented a more forgiving block splitter to allow for less well formatted srt files.

please verify that it works on your end as well now.