Release - CleanSubs - (Clean subtitles from the ads and other rubbish)

  Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #181
It is loading the definitions. It did this before as well, but it didn't display the progress bar.
find quote
misa Offline
Fan
Posts: 330
Joined: Mar 2012
Reputation: 7
Post: #182
(2017-03-19 00:19)DaLanik Wrote:  It is loading the definitions. It did this before as well, but it didn't display the progress bar.

Aha, is it possible to enable / disable this?
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #183
Nope. I am working to make this faster... so probalby in the next version if will be gone or radically faster... it shouldn't interfere, you can still use Kodi it is doing in the background. But that was the reason sometimes when you start CleanSubs from the programs menu it took longer to start. It was loading/processing definitions. It shouldn't do that on every start anymore, so it is an improvement. But I'll keep working on it, don't worry Smile
find quote
HeresJohnny Online
Fan
Posts: 327
Joined: Mar 2011
Reputation: 2
Location: Germany
Post: #184
One more request regarding NFS. You've solved this nicely for the "standalone" cleaner but I still notice a problem on cleaning a downloaded sub while playing a video - let's call it "live cleaning". I think there might still be a path problem. When downloading a sub for a series that is accessed via SMB or a live stream, the subs download and clean correctly. If the video that is being played resides on an NFS path, the live cleaner doesn't kick in.
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #185
That is possible Smile Will take a look. For the time being, you can maybe set custom subtitles path to local disk?
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #186
v5.5
- Optimized logic and reading of definitions
- Definitions are now checked not only on Kodi start but every 100 minutes
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #187
(2017-03-14 11:11)HeresJohnny Wrote:  Thumbs up, Dalai Lanik :-)
CleanSubs just had a great run, cleaning a third of my subs until it errorred out. I think you're very close to perfection. Here's what I can glean from the normal log, will run some debug tests later to identify the subs which caused this.

Code:
File "C:\Users\JoScha\AppData\Roaming\Kodi\addons\service.cleansubs\default.py", line 414, in process_subs
                                                if not line.text[subsPos - 1].isalnum() or not line.text[subsPos + 1].isalnum():
                                            IndexError: string index out of range
                                            -->End of Python script error report<--

This should fix it, please give it a try:

v5.6
- Bug fix with heuristics
find quote
mgonzales Offline
Fan
Posts: 321
Joined: Oct 2014
Reputation: 2
Post: #188
Was bored so played around real quick with some alternative animation for the overlay.

one is a mod of existing, other is a variation - use / modify / ignore / etc as you like. Smile

http://www.filedropper.com/cs-mod

random example frame:

[Image: j20nc3D.png]

and

http://www.filedropper.com/cs-alt

random example frame:

[Image: XMl8kKf.png]

btw - Kodi 17 supports animated PNG files (need to use .apng file ext not .png) and I am not sure which version started support for animated GIF's but I know Jarvis does for sure (and those after).

have included frames as well as example in both apng and gif (animated) formats

Enjoy,

Mario
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #189
(2017-03-23 15:24)mgonzales Wrote:  Was bored so played around real quick with some alternative animation for the overlay.

one is a mod of existing, other is a variation - use / modify / ignore / etc as you like. Smile

http://www.filedropper.com/cs-mod

random example frame:

[Image: j20nc3D.png]

and

http://www.filedropper.com/cs-alt

random example frame:

[Image: XMl8kKf.png]

btw - Kodi 17 supports animated PNG files (need to use .apng file ext not .png) and I am not sure which version started support for animated GIF's but I know Jarvis does for sure (and those after).

have included frames as well as example in both apng and gif (animated) formats

Enjoy,

Mario
Cool, I can try to think of a way to make animation selectable and include these as optional Smile

Sent from my N7100
find quote
mgonzales Offline
Fan
Posts: 321
Joined: Oct 2014
Reputation: 2
Post: #190
(2017-03-24 17:57)DaLanik Wrote:  
(2017-03-23 15:24)mgonzales Wrote:  Was bored so played around real quick with some alternative animation for the overlay.

one is a mod of existing, other is a variation - use / modify / ignore / etc as you like. Smile

http://www.filedropper.com/cs-mod

random example frame:

[Image: j20nc3D.png]

and

http://www.filedropper.com/cs-alt

random example frame:

[Image: XMl8kKf.png]

btw - Kodi 17 supports animated PNG files (need to use .apng file ext not .png) and I am not sure which version started support for animated GIF's but I know Jarvis does for sure (and those after).

have included frames as well as example in both apng and gif (animated) formats

Enjoy,

Mario
Cool, I can try to think of a way to make animation selectable and include these as optional Smile

Sent from my N7100

Maybe consider just making the overlay portion of your script custom skinnable?

Lots of scripts include a "default" resources/skins/default/ under which is the media, custom skin xml, etc to use unless a skin includes a customized set of resources

See service.nextup.notification, trakt ratings dialog, etc for examples

One step further could be to look in userdata/addon_data/ for custom resources

Or even make the path a setting:

Code:
path_setting = addon.getSetting('xml_folder').decode('utf-8')
        addon_path = addon.getAddonInfo('path').decode('utf-8')
        # if a path is set, try to use it and fallback to the default if it fails
        if path_setting:
            try: self.dialog = ProgressDialog.Window(DIALOG_XML, path_setting)
            except: self.dialog = ProgressDialog.Window(DIALOG_XML, addon_path)
        # otherwise use the default
        else:
            self.dialog = ProgressDialog.Window(DIALOG_XML, addon_path)
        self.dialog.show()

But to just give users options over images to display look at:

http://forum.kodi.tv/showthread.php?tid=239558

Anyway... hehe sorry for writing a book Smile

Just found your script the other day and like it so thanks - works well so far.

Tend to use subs late at night so I can keep volume down for rest of the folks who can sleep

My playing around with the animation images was primarily just a mix of boredom and insomnia.

Honesty keeping that as is - is fine by me.. you focus on the more useful requests, etc

Hehe

Thanks again!

M
find quote
alexei Offline
Junior Member
Posts: 20
Joined: Dec 2012
Reputation: 0
Post: #191
I'm trying your script, and works fine so far. Thanks a lot!
I have a couple of suggestions for you to consider:
-I want to scan my library to clean the subtitles that I have downloaded so far, but I don't want to keep the original files (_ORIGINAL renamed). Would it be possible to add a "keep originals/delete originals" switch?.
-Also, maybe it would be a good idea to add an option to remove colors from subtitles, sometimes the colours can be annoying...
Thanks!
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #192
Sure, will take a look.
find quote
MB1968 Offline
Member
Posts: 60
Joined: Dec 2016
Reputation: 0
Post: #193
Hi DaLanik here's a part of the logfile. I'm using Kodi Jarvis on Android.

20:25:55 T:18446744073055811888 NOTICE: CLEANSUBS >> DEFINITIONS >> NO NEW DEFINITIONS (L:22386 == R:22386)
20:25:55 T:18446744073055811888 NOTICE: CLEANSUBS >> DELETED AND CREATED NEW DEF DB
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> WROTE TOTAL DEFINITIONS TO DB: 898 elements
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING ON >> True
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING INFO >> True
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING LOGO >> True
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING FOLDER >>
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING CUSTOM DEF >> True
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING REMOVE CC >> False
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING METHOD >> 0
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING HEURISTICS LINES NR >> 2
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING SUBFIRST >> False
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING CHARSET >> DEFAULT
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING SUB LANGUAGES: >>DUTCH<<
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING SUB LANGUAGES: >>ENGLISH<<
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> SETTING SUB LANGUAGES: >>GENERIC<<
20:25:56 T:18446744073055811888 NOTICE: CLEANSUBS >> USING TOTAL DEFINITIONS: 537 elements
20:25:57 T:18446744073055811888 NOTICE: CLEANSUBS >> UUID is 84e9d986-ffb9-44bc-ab88-d5a47ddbe9bf
20:25:57 T:18446744073055811888 NOTICE: CLEANSUBS >> SQLITE ERROR IN MAIN
20:25:57 T:18446744073055811888 NOTICE: CLEANSUBS >> NO RECORDS IN LOCAL DB
20:25:57 T:18446744073055811888 NOTICE: CLEANSUBS >> REMOVED PYO
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS STANDALONE >> STARTED VERSION 5.6
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/001 Films/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/002 Series/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/003 Docu's Overig/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/004 Docu's Natuur/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/005 Cabaret/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/006 Concerten/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/007 Hengelsport/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/008 Overige Video's/
20:26:00 T:18446744072857581872 NOTICE: CLEANSUBS >> VIDEO PATHS >> smb://MIJNPC/
20:26:17 T:18446744072857581872 NOTICE: CLEANSUBS STANDALONE >> FINISHED
20:26:21 T:18446744072924166448 ERROR: static bool XFILE::CDirectory::GetDirectory(const CURL&, CFileItemList&, const XFILE::CDirectory::CHints&, bool) - Error getting
20:26:46 T:18446744073167182128 ERROR: Previous line repeats 1 times.
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS STANDALONE >> STARTED VERSION 5.6
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/001 Films/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/002 Series/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/003 Docu's Overig/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/004 Docu's Natuur/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/005 Cabaret/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/006 Concerten/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/007 Hengelsport/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> /mnt/media_rw/28D07E9FD07E7344/001 Video/008 Overige Video's/
20:26:46 T:18446744073167182128 NOTICE: CLEANSUBS >> VIDEO PATHS >> smb://MIJNPC/
20:26:51 T:18446744073167182128 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.cleansubs/standalone.py", line 248, in <module>
intCancel = scanPaths(path, g, pathsNr, 3)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.cleansubs/standalone.py", line 144, in scanPaths
for root, subdirs, files in os.walk(path):
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-17/lib/python2.6/os.py", line 284, in walk
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-17/lib/python2.6/posixpath.py", line 68, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)
-->End of Python script error report<--
find quote
DaLanik Offline
Posting Freak
Posts: 847
Joined: Apr 2016
Reputation: 31
Location: Prague, CZ
Post: #194
What are you scanning, libraries or path?
find quote
MB1968 Offline
Member
Posts: 60
Joined: Dec 2016
Reputation: 0
Post: #195
Libraries. But the addon recognizes 9 (!l libraries. That number sounds a bit strange to me. I have only 2 libraries in Kodi. One for movies and one for series. In the other 7 folders I have other video shit stored.
(This post was last modified: 2017-03-27 18:14 by MB1968.)
find quote
Post Reply