KBlixt / subcleaner

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

Not removing ads? #26

Closed argonan0 closed 1 year ago

argonan0 commented 1 year ago

Ran on a sub but nothing was processed and these lines were not removed:

Support us and become VIP member to remove all ads from www.OpenSubtitles.org

Please rate this subtitle at www.osdb.link/xyz Help other users choose the best subtitles.

KBlixt commented 1 year ago

Could you send me the log? And which file you experienced this for?

Those lines should definitely be removed.

argonan0 commented 1 year ago

Looked into it some more. It appears to be a permissions issue where the files Bazarr grabs are missing the write permissions. Running the command after adding those permissions (0666) works to remove those lines.

Issue remains with Bazarr that it is apparently ignoring the Permission (chmod) setting and not setting everything it grabs to 0666 as set.

Maybe the subcleaner can also 'clean' the permissions? :)

KBlixt commented 1 year ago

While I could change permissions on a file with python its not possible to do so without the correct permissions in the first place.

Sorry.

argonan0 commented 1 year ago

I added a hacky routine to the start of the script which is working so far.

if '-h' not in sys.argv[1]:
    os.chmod(sys.argv[1], 0o666)

Since the Bazarr docker is already root it has all the permissions necessary in this case.

KBlixt commented 1 year ago

Errr, OK. Strange root doesn't have write permissions.

But if it works, it works 👍

argonan0 commented 1 year ago

Yeah good point... makes less sense to me now.

So root can write any permissions but still honors them...? Something definitely doesn't add up there.