How to make your own addon and repo?

Torontopaul

New member
Oct 11, 2017
52
0
0
Can someone give me some info on how to do this? I read it a couple of threads and looked at kodi website wiki but still understand how the fundamentals work.

Does an addon have to be hosted online on github? Or can you just have it on your own android box? Same with a repo.

Or can it just be installed as an apk? How?

I really wish I learned programming.

Im thinking of hiring somebody to help me figure this stuff out.

How do I copy code of an addon? Where?

Where do I paste it? What changes do I need to make?
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello Torontopaul

I suppose it depends on what you plan to use the addon for ?

At the moment I use a former members addon for watching my home movies through my TV box, but I plan to explore the idea of simply adding my own plugin for using, my setup don't need wifi so I should be able to add my own plugin into the program without to much problem (I hope).

Love Destiny
 

Torontopaul

New member
Oct 11, 2017
52
0
0
If i wanted to host a repo to just enter in the URL to download and install zip file? Can I use any online file host? Or personal website.

Or if i wanted to create my own personal addon. Do i need to host it somewhere to work or it can work right from pc or android box?

Also lets say i wanted to rename an addon. How do i copy and modify the code? I assume its python.

I just go to github and some how copy it? Just edit it on pc? Just use notepad+?
 

RavRob

Moderator
Staff member
Nov 21, 2012
6,589
59
48
The Halls of Valhalla
If it is your own addon, you don't need to host it anywhere unless you want to share it. You also don't need a repo. For other addons, you can go wherever they are hosted (normally github) and simply download the code. You need Python to edit or update most components of the addon.
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello Torontopaul

I'm just learning as I go along, the only differents is, I only need a former members dead addon for my needs, but lets put your idea to the test.

I run a test on your idea and added an addon to the Video section, as my own addon works this way I can't see how yours won't, only thing I noticed is it don't appear in the "Get More" so it will only be a "personal addon" like my own.

If you want to give it a try here's an example to start with.


First we need to get your addon onto your Kodi setup'

Step one:

Open a new WinRAR ZIP archive folder and call it something like this plugin.video.paul-1.1.1 I did try your full username but it wouldn't load (must have been over the max symbols allow).

Open a new folder and name it plugin.video.torontopaul

You'll need to make an xlm file and name it addon if you have trouble make an xml file just open any plugin.video from within your backup zip folder and drag any addon.xlm file to your desktop.

Open the file delete any info from within and add the info below (bold info only)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.paul"
name="Torontopaul"
version="1.1.1"
provider-name="Torontopaul">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.simple.downloader" version="0.9.1"/>
<import addon="script.module.simplejson" />
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Torontopaul</summary>
<description>
My first Addon
</description>
<platform>all</platform>
</extension>
</addon>


That is your addon.xml completed now place the file inside your plugin.video.torontopaul folder.

You'll notice a part of the code pointing to the default.py this is the heart of your addon.

So once again drag any py file and rename it default or another default.py that way you can open and study it for more knowledge.

Delete all info from within and place your new blank default.py into your plugin.video.torontopaul folder.

Once completed simply upload your addon just as you would with any other addon.

You should now have your own personnal plugin showing in the video section.

I'll work more on this and post updates as I progress, so let me know how you get on.

Hopefully I've explained everthing proper so far and it works, but at this stage your addon will do nothing on the system, until more info is added to the default.py file.

You'll notice 3 import addons within your code, if you open your backup folder it would do no harm to check down the list and update any version if deferent from above.

Just noticed RavRob post while perviewing my reply and see that Python might be needed to edit any addon, but I'll try and add my own htlm with links to my own movies to see if its possible.

Love Destiny
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello Torontopaul

I just done a full backup on my windows 7 kodi for the first time and after adding your addon (see earlier post on this subject) and when I looked inside the backup zip folder I found loads of log files ? but did find this:

10:36:57 T:3212 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.paul/
10:36:57 T:3212 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.paul/) failed


Did read your post on another thread about finding your log files, I havn't got the time at the moment to use this backup on my TV Box and do a backup on it from the box to see if the log files details work on the "old" box system, so I'll let you know late about my results.

The errors are expected with the blank file, CGUIMediaWindow might be worth looking into at this stage.

Mybe its just what happens when you click on the addon ?

Love Destiny
 

streamwatcher2013

Well-known member
Oct 24, 2013
811
332
63
USA
Hello Torontopaul

I just done a full backup on my windows 7 kodi for the first time and after adding your addon (see earlier post on this subject) and when I looked inside the backup zip folder I found loads of log files ? but did find this:

10:36:57 T:3212 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.paul/
10:36:57 T:3212 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.paul/) failed


Did read your post on another thread about finding your log files, I havn't got the time at the moment to use this backup on my TV Box and do a backup on it from the box to see if the log files details work on the "old" box system, so I'll let you know late about my results.

The errors are expected with the blank file, CGUIMediaWindow might be worth looking into at this stage.

Mybe its just what happens when you click on the addon ?

Love Destiny
The error you got was point to the name of addons "plugin.video.torontopaul" not match with the line "addon id=" in addon.xml file which can edit with Notepad, Notepad+, Adobe Dreamweaver or any HTML Editor program

plugin.video.torontopaul must match with <addon id="plugin.video.torontopaul"

If you run addons on your own you don't need repo which is hosted anywhere you want as long as you can full access to it. The repo only allows you to upload the updates info and the addons will auto download the newer updates version which is changed in the line "version=" of addon.xml
 
Last edited:

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

Thanks for the heads-up never dawned on me to change the inner folder to plugin.video.paul from plugin.video.torontopaul to match the winwar file name, so everything typed Torontopaul has to be changed to paul :eek:

Love Destiny
 

streamwatcher2013

Well-known member
Oct 24, 2013
811
332
63
USA
Hello streamwatcher2013

Thanks for the heads-up never dawned on me to change the inner folder to plugin.video.paul from plugin.video.torontopaul to match the winwar file name, so everything typed Torontopaul has to be changed to paul :eek:

Love Destiny
Nope. Only that 3 parts: "folder name" + "nameofplugin.zip" & "addon id" must be match. The rest with "Torontopaul" is info on addon.xml file
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

Thanks again, rechecked all the codes and found the first plugin was mistyped with two . iinstead of one so I removed one of the dots and it worked, so it now looks like this:

winrar now called plugin.video.torontopaul
Inner folder called plugin.video.torontopaul

addon code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.Torontopaul"
name="Torontopaul"
version="1.1.2"
provider-name="Torontopaul">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.simple.downloader" version="0.9.1"/>
<import addon="script.module.simplejson" />
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Torontopaul</summary>
<description>
My first Addon
</description>
<platform>all</platform>
</extension>
</addon>


blank default.py file and a icon.png placed in the inner folder.

Each time I add something to the addon I change the version="1.1.2" by one (version="1.1.3" next) and after uninstalling and uploading the new update I can look inside the Addon-information to see the correct version.


My own addon uses a code mnt/sda1/Movies/Park/Swing.mp4 which is called from within a third party hardware device same for thumbnail (no need for wifi) but for Torontopaul I'm going to try and call them from within my own HTLM files (http address) on this addon.

Love Destiny
 

streamwatcher2013

Well-known member
Oct 24, 2013
811
332
63
USA
Hello streamwatcher2013

Thanks again, rechecked all the codes and found the first plugin was mistyped with two . iinstead of one so I removed one of the dots and it worked, so it now looks like this:

winrar now called plugin.video.torontopaul
Inner folder called plugin.video.torontopaul

addon code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.Torontopaul"
name="Torontopaul"
version="1.1.2"
provider-name="Torontopaul">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.simple.downloader" version="0.9.1"/>
<import addon="script.module.simplejson" />
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Torontopaul</summary>
<description>
My first Addon
</description>
<platform>all</platform>
</extension>
</addon>


blank default.py file and a icon.png placed in the inner folder.

Each time I add something to the addon I change the version="1.1.2" by one (version="1.1.3" next) and after uninstalling and uploading the new update I can look inside the Addon-information to see the correct version.


My own addon uses a code mnt/sda1/Movies/Park/Swing.mp4 which is called from within a third party hardware device same for thumbnail (no need for wifi) but for Torontopaul I'm going to try and call them from within my own HTLM files (http address) on this addon.

Love Destiny
I saw the dif. between 2 parts here. I believe It's case sensitive:
1/ addon id="plugin.video.Torontopaul" <<< with T upper character
2/ folder called "plugin.video.torontopaul" <<< with t lower character

Does the addon works for you? You need to put the python code inside default.py to get the mp4 playing because of this line:
<extension point="xbmc.python.pluginsource" library="default.py">
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

Everything works on my own addon as the video formats and images are all called from the third party 1tb hardware, the bigger the tb the more "home movies" I can play, but it won't help Torontopaul in his quest to work off his own HTLM format, I can do away with the third party and use my own Htlm files to call the videos but it would mean loading them on the internet first and using wifi on TV Box, or Ethernet on my computer.

Love Destiny
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

Correct, both sets need to be identically spelled (matching)

I've added a folder called resources to the inner folder and placed a settings.xml within this xml I used this code:

<settings>
<category label="What next"></category>
</settings>


In the default.py I placed this code: import resources

So now the addon has a configure window.

Can you explain how to take images of the addon, my Kodi take up the full screen on my monitor :mad:

Maybe images from within might make it easier to explain.

Because I've to switch between the Kodi and typing what is happening live it takes about 15 minutes to type a reply, so mistakes will occur so bear with me :)

Hopefully with the help of yourself the addon is doing as posted. (touch wood)

Love Destiny
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

Spoilsport :( The path you sent me on works great, downloaded the first "example" 1.0.1 as later ones only seem to work on 16+ Kodi, I was hoping to take a couple of weeks to make it work from scratch.

I just had to add the http path from one of my videos preloaded into my website, and image path into the main.py

'thumb': 'h..p://address/jack-o10.jpg',
'video': 'h..p://address/Puppy.mkv'},

I still need to link it to my third party device for Box to see if it also works, but don't anticipate any problems :rolleyes: (famous last words).

So now Torontopaul can gain more knowledge about programming his own addon.

I'll see if I can improve the "example" version.

Thanks Destiny
 

streamwatcher2013

Well-known member
Oct 24, 2013
811
332
63
USA
@destiny

On the How to, it use a main.py for default.py. You can name it whatever you want as long as you call it out from addon.xml via xbmc.python.pluginsource.
This will help if you want to play the data from your external HD

http://kodi.wiki/view/HOW-TO:Change_data_location_for_Android

For the file hosting on the web, you may consider to use the data link .m3u and call it out from main.py, default.py or whatevet-name.py to play your video also display title and thumbnail.
 
Last edited:

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

Changing the name to default.py don't effect it working ok on the system, I just use the old "Notepad" method to edit things, so I simply open the files and used "Find" and type main, so it easy to change any main.py to default.py.

I suspect that some command files I'll need later on to upgrade the Addon are preloaded with the default.py, so I won't need to find and change.

I'll setup my HD format on my Box in an hour or two and see if it works from within the HD.

For some reason my xpwins downloads at a faster speed then my win7 (about 7 times faster) so I switch between systems, the store where I got the hardware told me its only competable with windows 7 upwards, but I cleared out the stuff they had preloaded within it done a "Format" and how it works on my xpwins as well. I just use it just like a big USB stick to load my home videos and images needed to work from within my addon, 4tb for Christmas :cool:

Thanks again Destiny
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello streamwatcher2013

That was quick, just add my path to the external system to the new default.py file: (see bold below)

'thumb': 'https://address/jack-o10.jpg',
'video': 'http://address/Puppy.mkv'},
{'name': 'Alli',
'thumb': 'https://address/swing.jpg',
'video': 'mnt/sda1/Movies/swing.mkv'},

Installed the new updated "example" addon onto my Box and both formats work, the images work as fanart and icon.

Love Destiny
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello Everyone

I just done another test on an old TV Box which still has its 14.2 TVMC installed and the new addon works in it also.

If anyone wants to try it themselves follow the path from streamwatcher2013 link to the original addon (master won't work) I downloaded the 2015 version (1.0.1).

If you have access to a movie file link on the internet just place it in the main.py (see below in bold) you can add an image link if desired or better still follow streamwatcher2013 guide and convert the main.py to default.py (instructions posted eariler in thread).

VIDEOS = {'Animals': [{'name': 'Crab',
'thumb': 'any image path here',
'video': 'any video path here'},

For anyone wanting to play videos from computer or 3rd party simply add the path of the source.

Example:

On my TV Box setup I connect the external device using the USB port, I have the device preloaded with all my home movies and images, for each one to work (path added to default.py) I use my "File browser" Folder and trace back the path to each video source, you can use Install from zip file from within your Kodi's System - Add-on window.

On my Box the path to each folder starts /mt/ I found you can remove the first / and it works as mt/, but the path to my image folder won't work unless the full path is added /mt/.


So it looks like this:

'thumb': '/mnt/sda1/Pictures/Park/swing.jpg',
'video': 'mnt/sda1/Movies/swing.mkv'}

Never needed to check if the video path would work by adding the first / but if anyone needs me to change the code to test just ask.

Love Destiny
 

DE5T1NY

New member
Nov 28, 2017
34
0
0
Belfast
Hello Everyone

Just a quick update for anyone trying this addon using their Kodi from windows 7:

I've been running tests on this addon and the previous one on my computer, each time I have to upload the addon through the install zip file format to check its progress then uninstall it and close down Kodi until the next test, but a short while ago I decided to try a new method by placing the "plugin.video.example" in my computers "Program files" file within the Kodi folder, I had previously looked in this folder and spotted something strange, there is no plugin.video folders within the addon folder :confused: but I just added the addon any how and surprice surprice it worked, no more uninstalling and uploading again I can change the codes from within the Kodi folder. :cool:

To test this out close your Kodi if still running in the back ground, follow the path above in this message and then open the addon.xml file from within the Kodi folder and simply change the version number, save and close the window. Open your Kodi and check the addon in your "Video" section and see if the number is the changed one.

No way of knowing if this would work on any upgrades of windows :eek:

Love Destiny
 
Last edited: