KBlixt / subcleaner

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

Problematic SRT files #15

Closed ChristianMalazarte closed 1 year ago

ChristianMalazarte commented 1 year ago

I'm not sure what's wrong with these subs, but I'm getting this error for the entire series. I attached a txt version and a zip of all the show's subtitles. I'm using the REGEX that's in github that has caused no issues other than some Chinese TV show subs like this one.

Wrong text encoding?

[ERROR]: Exiting, There might be an issue with the regex, because everything in the subtitle would have gotten deleted. Nothing was changed.

If I Can Love You So (2019) - S01E01 - Episode 1 - (HDTV-720p-x265).en.zip If I Can Love You So (2019) - S01E01 - Episode 1 - (HDTV-720p-x265).en.txt

KBlixt commented 1 year ago

Mh, it appears as though the srt files are not conforming to the srt standard.

Srt standard requires something like this:

1 00:00:00,840 --> 00:00:08,960 This is the subtitle content The content can have more than 1 lines.

2 00:01:00,840 --> 00:01:08,960 This is the next subtitle block.

In the file you provided there appears to be an extra space between all lines. Either try to collapse them so there is only blank spaces between the blocks. Or wait until Monday when I've had time to take a look at this and might be able to handle this in the tool.

ChristianMalazarte commented 1 year ago

Awesome! No worries. Thanks!

KBlixt commented 1 year ago

Did you get it fixed?

ChristianMalazarte commented 1 year ago

Nope I haven't looked at this one yet.

KBlixt commented 1 year ago

Ok, let me know if you have any issues 🙂

ChristianMalazarte commented 1 year ago

I just bulk conformed the bad SRT with Subtitle Edit. But this SRT script can fix those subs also. I just don't know how to add it to your script, this is actually my first time editing Python code lol.

KBlixt commented 1 year ago

I'm not entirely sure what you are trying to do? The srt project is an srt editor not a cleaning script. I've created this script to work independently from other tools.

ChristianMalazarte commented 1 year ago

There's a script there that fixes malformed subtitles. But yeah, I'll close this then.

KBlixt commented 1 year ago

I'd just run that script first then and then run this. If you want you could probably make a batch job for them using bash or something for windows.