Kodi Community Forum

Full Version: CleanSubs - (Clean subtitles from the ads and other rubbish)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Great.
BTW is there any dirty trick to make CleanSubs think that it needs to clear all subtitles that we download? Maybe by setting your url in the hosts file and creating a fake heuristics/definitions that will catch any/all subs?
Cheers
I took a look at the code and even if I make mod to use "black bar" everytime, it would work only if subtitles are in SRT format - not if they're in SUB format.
That would work just fine by me. I mostly use srt subs and only use sub/ass/ssa subs once in a while.
So if you could tell me a way that I can workaround this right now, it would be great. I watch a lot of tv shows which don't have top/bottom black borders and you know that in the beginning of movies and tvshows they put a lot of text in the screen about directors, studios, main artists and it gets very difficult to being able to read the subs with those very bright and text cluttered images.
Thanks in advance.
Cheers
Not that simple, I'm afraid Smile I'll try posting a new version to the test repo over the weekend.
At the official website I can only find http://kodi.lanik.org/_repo/lanik.repo/l...-1.0.2.zip
This one is the regular repo, right?
So, where would I grab that test repo from?
Thanks in advance.
Cheers
When you install "normal" repo, you can than install test repo from it...
v6.21 in TEST REPO:
- Force black bar conversion for SRT subs, even if subs were not cleaned
This addon looks like it would be very useful for me.  One question though, I saw on the first page that this addon was designed primarily to serve people who use the KODI subtitle downloader addon.  I already have all my media with .srt files stored next to them in their respective folders.  Has this addon been extended to also clean those subtitles or does it still only clean subtitles that are downloaded with the subtitle downloader addon?
There is "clean library" function or "clear folder". So yes, it should be able to clean library.
Great work @"DaLanik"
Thanks a bunch for the Force black bar conversion for SRT subs, even if subs were not cleaned.
I will install the test repo and let you know how it goes for me.
Cheers
Hi @"DaLanik" .
First impressions with the test version.
It worked. I was watching a TV show:
- pressed the download sub button
- chose the sub
- Kodi downloaded the sub using LegendasDivx addon
- finally I watched the OSD stating that it had cleaned the sub
The sub had nothing to be cleaned but as expected cleansub did it's thing and gave me a black background with a yellow font sub.
So it was a success.
Unfortunately, I came across an issue that I had already told you some months ago. The Portuguese language uses some special characters like these:
Ç ç
Á á É é Í í Ó ó Ú ú
À à
 â Ê ê Ô ô
à ã Õ õ
ª
º
There might be more but these are the usual.
With this test version of cleansubs, when the subs should show some of these characters instead of that it shows characters like ] or {.
I was thinking about it and I recall that I made some tests on my own a few months ago and I was able to manually replicate what cleansubs does when it adds the black background.
And if my memory serves me well, I had to download the subs and then convert their contents into UTF-8 before doing anything else and that way the subs didn't show any weird characters when it uses Portuguese language special characters.
I posted it here in the forums, so I will search for that and I will add it to this message when I find it.
But we're definitely getting there. So thanks a bunch for what you've done so far.
Cheers

EDIT: here it is, the link to the topic where I talked about doing this manually.
Basically we're talking about making sure the download sub in UTF-8 and then use something like ffmpeg to convert from SRT into ASS.
In my case I would use a linux terminal command that would tell me what the file encoding(?) is:
Code:
file -bi sub1.srt
If it returned anything other than UTF-8, like for instance iso8859-1, I would then convert the file to UTF-8 using:
Code:
iconv.exe -f iso-8859-1 -t utf-8 sub1.srt > sub1-utf8.srt
IIRC the remaining work of converting the sub to ASS/SSA would be accomplished by ffmpeg.
Could you look at your code and check if you're converting to UTF-8 prior to converting the sub into ASS/SSA?
Thanks a bunch.
Cheers
I am paying attention to this and made sure it is read correctly - in NORMAL operation of cleaning. I admit I don't have a clue how the srt2ass convert works or what it does. My addon even corrects some subtitles which are saved in wrong coding (I also use codepage for serbian) and saves them as UTF8 after clean, but I don;t have influence on the srt2ass conversion... I'll have a look if I can find out something. In my tests subs looked OK.
(2018-02-25, 23:38)DaLanik Wrote: [ -> ]I am paying attention to this and made sure it is read correctly - in NORMAL operation of cleaning. I admit I don't have a clue how the srt2ass convert works or what it does. My addon even corrects some subtitles which are saved in wrong coding (I also use codepage for serbian) and saves them as UTF8 after clean, but I don;t have influence on the srt2ass conversion... I'll have a look if I can find out something. In my tests subs looked OK.
 Thanks, mate.
I'll see if I can figure it out on my end too. I'll try to install kodi on other devices to see if they show the same behaviour and I'll post here some screenshots so that you can see what I am talking about.
I'll even post here the name of the tv shows and the link to the legendasdivx sub so that you can download and test it on your end.
Many thanks in advance.
Cheers
The codepage problem is usually already introduced by the original uploader and the way they encode their file. Many still use their regional codepage instead of utf8. This leads to problems if the system that reads that codepage is running a different language / codepage. Unfortunately, there is no way to autodetect codepages, apart from utf8 encoding. This leaves you with the only option to manually convert the file by trial and error, guessing the original encoding. I find Akelpad to be most easy to use in this respect.
I beg to differ.
I have previously explained a command line method to assess the file encoding and how to convert it to UTF-8.
If Kodi has a built-in method to do that and it is available to the addon developers, that I am not aware of.
In case the previous assessment is false, if these aforementioned command line utilities are all available on any platform that Kodi can run on, that I am also not aware of.

A quick update to @"DaLanik": yesterday evening I tried the same tv show with the same sub addon provider (LegendasDivx) and I noticed that the sub that I had used before in fact shows these artifacts that I had mentioned before. I will now check the file encoding for that sub.
I also noticed that there is another sub available on addon provider OpenSubtitles.org which works just fine and does not show such artifacts.
Later today I will try to get those subs and post them here. Maybe we'll end up finding out that the sub which shows artifacts is already in a different encoding and the one that works fine is in UTF-8.
Thanks for your support.
Cheers
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24