Kodi Community Forum

Full Version: Can i add multiple subtitles providers within same addon module ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm developing my own subtitle service addon. My goal is to enable it for various providers (opensubtitles, subscene etc.)
I've already developed my script for 1 provider, how can i add different provider within the same package ? So when I'm in video subtitle OSD, I can select which of my providers to use.

My addon structure looks like this:

service.subtitles.cyril
  addon.xml
  provider1.py
  resources folder (contains my lib scripts)

I want to add provider2.py, provider3.py etc.
But in the addon.xml, I only know how to add 1 subtitle service:

xml:
<addon id="service.subtitles.cyril"
       name="Cyril"
       version="1.1.0"
       provider-name="cyriltra">
  <extension point="xbmc.subtitle.module" library="provider1.py" />
</addon>

I don't want to have multiple addon module because it will duplicate my code and will be hard to maintain (ex: service.subtitles.cyril, service.subtitles.cyril2, service.subtitles.cyril3 etc.)

Thank you
Here is the solution for those interested:

i've created another addon extending script.module.python.
This addon contains a folder lib with all my dependency scripts.

Then I import this addon in each of my subtitles addons
Hi there!
Please let us know if there will be a test version!

I am looking forward testing it!
(2019-05-03, 13:26)pcextreme Wrote: [ -> ]Hi there!
Please let us know if there will be a test version!

I am looking forward testing it!

Hi, 
my scripts actually target Chinese subtitles and is a fork from original Taxigps's scripts (still regularly updated): https://github.com/taxigps/xbmc-addons-chinese
Thanks for the info.