Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

subtitles are save with new lines in between #4

Open
batch08 opened this issue Mar 4, 2018 · 20 comments
Open

subtitles are save with new lines in between #4

batch08 opened this issue Mar 4, 2018 · 20 comments

Comments

@batch08
Copy link

batch08 commented Mar 4, 2018

running the cleaner, changed the format of the subtitle content thus crashing the transcoder of plex.

`1

00:00:02,099 --> 00:00:03,498

Previously on "arrow"...

2

00:00:03,524 --> 00:00:04,791

These are

Innocent people.

3`

@oskameDEV
Copy link
Owner

Hi there, not sure how to debug that though as I do add a new line after each block. I'm checking some of my own files but can't find one where there isnt a new space between a block.

Can you email me this subtitle file? oscar{at}kitsune.work and I'll have a look

@oskameDEV oskameDEV added the bug Something isn't working label Mar 4, 2018
@oskameDEV
Copy link
Owner

oskameDEV commented Mar 4, 2018

Okay, will look into this tomorrow.

I see what is going on. Has to be related to difference in OS where a new line is a different "symbol"(\n \r \r\b \n\n) Should be able to fix this quickly

@oskameDEV
Copy link
Owner

I'v added a new version. Tested it on the subtitle you provided and on new movies and some episodes that came in on my Plex.

It also fixes a failure in the logic how I was removing the blocks so if any sentence within a block has a banned word it'll now properly remove said block.

Tested on a Mac so if you're on Windows then I just simple have my fingers crossed it'll work as intended now.

@batch08
Copy link
Author

batch08 commented Mar 5, 2018

I downloaded the zip and installed it; restarted PMS but the agent is not loading/displayed.

here's the log file:
com.plexapp.agents.subcleaner.log

@oskameDEV
Copy link
Owner

oskameDEV commented Mar 5, 2018

My bad, some spaces snuck in where there should have been a tab.. Python is anal about that.

DL it again and things should be fine

@batch08
Copy link
Author

batch08 commented Mar 5, 2018

same, but the newline issue has been resolved. it didn't get cleaned though.
com.plexapp.agents.subcleaner.log

[Arrow.S06E14.en.srt.log] just remove the log extension in this file.(https://github.com/kitsuneDEV/SubsCleaner.bundle/files/1782449/Arrow.S06E14.en.srt.log)

Issue/enhancement request:
Triggering "Refresh Metadata" for a specific episode executes the agent for all subtitles available in the location which could probably exponentially execute the agent repeatedly for each episode in a particular folder.

@oskameDEV
Copy link
Owner

oskameDEV commented Mar 5, 2018

I have '==' in my filterlist [LIST OF WORDS THAT WILL FORCE SENTENCE TO BE REMOVED] and it removed both that line and @ elder_man line (so that block of subs.) So not sure why it wont work for you.

For that error in the log, I'll add a proper filetype test (looking at the final extension) so it'll only process .srt files not .srt.old or .srt.zip etc..

I was wanting to look into making it more efficient like you suggest, by having it only scrub that episode's subtitle file(s)

Thanks for keeping on testing my changes, I'll do the above in a couple of hours, I'll monitor my own subtitle files too see if something doesn't get removed.

@batch08
Copy link
Author

batch08 commented Mar 5, 2018

ahh, ignore the error for the *old subtitle, I expected that to fail since I backed-up that subtitle. I did not change the filter list and kept it in default. other settings I set unchecked since sub-zero is already doing that.

image

@oskameDEV
Copy link
Owner

For the subtitle file you shared it might not have worked since none of the words match. I'v personally added '==' and 'sync' as i doubt the latter would ever be spoken in the normal dialogue.

@oskameDEV
Copy link
Owner

V0.982 available now. Now no longer process the entire folder but specifically a single or (say.. season/show.)

@oskameDEV
Copy link
Owner

Looks like there's still a major flaw in my code I'm fixing it in about 2 hours from now. Something to do with how I fixed but also created a new bug with how it processes a block of subtitles.

@batch08
Copy link
Author

batch08 commented Mar 7, 2018

Thanks for the update, will make a test as soon as i'm freed up. :)

@oskameDEV
Copy link
Owner

v.988 is now available.

Feeling confident this is now working correctly with all files. And that the blocks get removed in a better and more bullet-proof way. 🤞🏼

@batch08
Copy link
Author

batch08 commented Mar 8, 2018

Got the latest and ran a few test.

here's some of the setting I placed for TV:
image

I added '==' and 'sync' in the filter.

Test 1:

  • subtitle already existing
  • execute refresh metadata directly in a tv episode.
  • subtitle remained unchanged. nothing was scrubbed.

Test 2:

  • deleted existing subtitle
  • execute refresh metadata from the episode.
  • sub-zero downloaded the subtitle
  • subtitle remained unchanged. nothing was scrubbed.

image

Log
com.plexapp.agents.subcleaner.log

@oskameDEV
Copy link
Owner

Plex takes a while to accept any changes to the config file. I noticed that at least. Maybe by now it will remove the block as it refreshed the config file. (The log file for the plugin also shows the :: FILTERS :: it has loaded.)

I hope that's it/was it

@batch08
Copy link
Author

batch08 commented Mar 8, 2018

Ah, good to know. Will try that out again later.

@batch08
Copy link
Author

batch08 commented Mar 9, 2018

just tried it again tonight, same issue. here's the log.

com.plexapp.agents.subcleaner.log

@oskameDEV
Copy link
Owner

Hm, so a large amount of them can't even be opened..

Personally haven't run into that error, and I add a lot every day.

Can you send me some of those subtitle files by mail again.

Thanks for all your feedback so far

@batch08
Copy link
Author

batch08 commented Mar 9, 2018

Here you go:
Arrow_subtitles.zip

@oskameDEV
Copy link
Owner

oskameDEV commented Mar 10, 2018

Thanks, but it might also be that the files formatting is now so ruined in those files that it can't process them anymore (due to the previous versions having issues we've been trying to get rid of)

Could you remove those subtitle files and let subzero (or manually) get new subs then see if they're scrubbed correctly.

Right now with those files it can't split them into blocks because the formatting is all wrong.

@oskameDEV oskameDEV removed the bug Something isn't working label Mar 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants