Release script.module.sublib - Subtitle library to create subtitle addons easily
#1
Introduction

Sublib is a KODI / XBMC library that significantly reduces the effort on developing subtitle addons, it has built in features for

- Automatic parsing of media information
- Automatic parsing of filename information
- Automatic navigation for kodi call
- Ability to use subtitles in archives (zip/rar)
- Automatically match media with the packed subtitles using regexes
- It has an internal archive browser if no match is possible, and lets the user select the file inside the archive. (This is different than dialog.browse().)
- Automatically priotrize the subtitles according to users language settings.
- Allows the service also to priotrize its own matching
- Automatic integration for, listitem language icons, cc, and sync infolabels
- It is written in OOP fashion an expects sublib.service to be inherited.
[13.03.2017 UPDATE]
- Allow for iso639-2, -3 languages, those languages will be on the list regardless KODI settings, since kodi does not support the selection of them (ie: hawaian)
[20.03.2017 UPDATE]
- Fix for HTMLParser module throws exception on narrow python builds on unescape method
- Finetune string parser


Quickstart

To use it in your subtitle addon first you have make it depend on script.module.sublib. Then you have to write your own service in total composed from 2 methods as show in below simple example.
PHP Code:
import sublib
    import os

    
class mysubtitlesite(sublib.service):

        
def search(self):
            print 
self.item
            sub 
self.sub("Test Subtitle""en")
            
sub.download("http://a.com/b/c.srt")
            
self.addsub(sub)

        
def download(selflink)
            
fname os.path.join(self.path"test.srt")
            
with open(fname"w") as f:
                
f.write(self.download(link))
            
self.addfile(fname
to see it in action simply initialize your class in the module that your "lib" attribute points in your addon.xml

PHP Code:
import myservice

myservice
.mysubtitlesite() 
Thats all.

You can see api documentation on
https://github.com/hbiyik/script.module.sublib
Reply
#2
Love to see this in https://github.com/opensubtitles/service...nsubtitles
Reply
#3
if original devs go green i can support the dev, but in the first phase lets see how it will work on subscene, planetdp, turkcealtyazi.

On the otherhand problem with opensubtitles is kodi users are overloading their service, the addon itself works quite smooth. So having a working subscene addon would help the share the subtitle load from opensubtitles to subscene
Reply
#4
(2017-03-19, 23:30)boogiepop Wrote: if original devs go green i can support the dev, but in the first phase lets see how it will work on subscene, planetdp, turkcealtyazi.

On the otherhand problem with opensubtitles is kodi users are overloading their service, the addon itself works quite smooth. So having a working subscene addon would help the share the subtitle load from opensubtitles to subscene

I agree yes, the one I mentioned is the one without registration Wink I am from The Netherlands and it's quit difficult to find a good subtitle addon. There is one subtitle called NLondertitels (official addon) but it'st in some way not working and I have seen on the Subscene website that there are Dutch subtitles but they nearly pop up in the addon.
Reply
#5
Scraping opensubtitles on theother habd would create more bandwidth load on the server, it is a bad idea to implement without opensubtitles api.

Try subscene with sublib (not sure site support nl, language parsing is done automatically), addob has a very complicated match algo in backgroound, if there is a sub in website, addon should find it. About nlondertitels, same goesas well, if there are source on thee site, a re-write with sublib will mostlikley match your need.
Reply
#6
any idea why i get this error : 
The dependency on script.module.sublib version 0.1.2 could not be satisfied.

i am trying to develop my own subtitle plugin.
Reply
#7
i get this error also: 
 requires script.module.sublib version 0.1.2 which is not available
Reply

Logout Mark Read Team Forum Stats Members Help
script.module.sublib - Subtitle library to create subtitle addons easily0