Sponsored Links:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create Your First Addon
#11
(04-23-2015, 09:03 AM)whufclee Wrote: The guys at the official kodi.tv forum have created an excellent guide on how to create your very first basic addon, even if you already have previous coding experience this is a great place to start as it will guide you through the basics of how Kodi works and explains the dependencies that are needed when creating an addon.

The wiki guide is here.

There is an official forum thread on the kodi.tv website where you'll get the best support possible but of course you can ask questions in here if you prefer. You can visit the official support thread here.

WHUFCLEE,
I am trying to follow the NaN video guides for creating my first addon. I can not seem to get any of my code that I am following along with you on into kodi to be able to test run it. Please help me get my code into Kodi. Maybe we could do a tutorial on what we have to do to incorporate our add on into kodi?
Sponsored Links:
#12
I think I solved the problem of getting my addon into Kodi. Now the problem I have is an error in my code. Here is my code.

#Import Modules
#These import modules are required to run this addon

import xbmc,xbmcgui,xbmcplugin
import os,sys

# Global Variables
# Variables assign diffrent values to diffrent items.


player=xbmc.player()
video='https://archive.org/download/babies_and_breadwinners_2/babies_and_breadwinners_2_512kb.mp4'
trailer='https://archive.org/download/babies_and_breadwinners_2/babies_and_breadwinners_2_512kb.mp4'

##########################################
# Initialize Plugin directory structure
addon_handle = int(sys.argv[1])
##########################################

# xbmcplugin.setContent(addon_handle, 'movies')

li = xbmcgui.ListItem('Video', iconImage='DefaultVideo.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=video, listitem=li)

li = xbmcgui.ListItem('Trailer', iconImage='DefaultVideo.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=trailer, listitem=li)

#######################################
#Close directory structure
xbmcplugin.endOfDirectory(addon_handle)
#######################################

Do you see the error?
#13
Sorry I've been at a family party and had a few beers today so I'm not going to be at my finest at debugging, especially as you've not supplied a log to look at. That being said I can see straight off that you've got a typo in there...

this: player=xbmc.player()
should be: player=xbmc.Player()

All python code is case sensitive.

Also it looks like you're using the old guide from season 1 of Python Koding. I would highly recommend using the Python Koding framework instead (see the latest video released yesterday).

Basically we started the Python Koding videos and after season 1 I realised there's a whole lot of stuff that could be made so much easier so I spent the past few months creating this framework to help up and coming devs. For generic Python ideas season 1 will give you a good start but it's probably easier to just start with the new Python Koding framework as season 1 covers loads of stuff which is no longer needed as I've done it all for you in the framework so it's easy to call upon Smile

Season 2 will be starting soon but yesterdays video is definitely the one I'd recommend watching before anything else.
WANT TO SHOW YOUR APPRECIATION?
A thank you is really all that's needed but if you want to buy me a drink then who am I to argue!

[Image: 11i3ihd.jpg]
#14
(05-07-2017, 06:26 PM)whufclee Wrote: Sorry I've been at a family party and had a few beers today so I'm not going to be at my finest at debugging, especially as you've not supplied a log to look at. That being said I can see straight off that you've got a typo in there...

this: player=xbmc.player()
should be: player=xbmc.Player()

All python code is case sensitive.

Also it looks like you're using the old guide from season 1 of Python Koding. I would highly recommend using the Python Koding framework instead (see the latest video released yesterday).

Basically we started the Python Koding videos and after season 1 I realised there's a whole lot of stuff that could be made so much easier so I spent the past few months creating this framework to help up and coming devs. For generic Python ideas season 1 will give you a good start but it's probably easier to just start with the new Python Koding framework as season 1 covers loads of stuff which is no longer needed as I've done it all for you in the framework so it's easy to call upon Smile

Season 2 will be starting soon but yesterdays video is definitely the one I'd recommend watching before anything else.

Thanks for the answer and your support. I am using the videos that are within Kodi. Where are the framework vidoes?
#15
Below is the special one we done yesterday, season 2 will go into the Python Koding framework more and we'll create an add-on based on a popular website - this will be taking place in the coming weeks.





You can view the documentation, runcode examples and video guides for various functions from within the template add-on (details in that video above) but if you want you can view some of them on the YouTube playlist here: https://www.youtube.com/playlist?list=PL...Sp3bLvE_tW

Make sure you start by following the video above though before anything else.
WANT TO SHOW YOUR APPRECIATION?
A thank you is really all that's needed but if you want to buy me a drink then who am I to argue!

[Image: 11i3ihd.jpg]
#16
I'm having a problem with "invalid structure" 

I know it's related to using a mac but i can't figure out how to fix it....anyone have this issue?
#17
(05-07-2017, 08:59 PM)whufclee Wrote: Below is the special one we done yesterday, season 2 will go into the Python Koding framework more and we'll create an add-on based on a popular website - this will be taking place in the coming weeks.





You can view the documentation, runcode examples and video guides for various functions from within the template add-on (details in that video above) but if you want you can view some of them on the YouTube playlist here: https://www.youtube.com/playlist?list=PL...Sp3bLvE_tW

Make sure you start by following the video above though before anything else.

Thank you. A great help you have been and I do want you to know I appreciate it and I look forward to working with you as my skill set increase and I can actually call myself a dev. That is where I hope to be in the near future.
#18
I have now closed this thread, please use the new thread dedicated Python Koding support thread for any questions. Thank you.
WANT TO SHOW YOUR APPRECIATION?
A thank you is really all that's needed but if you want to buy me a drink then who am I to argue!

[Image: 11i3ihd.jpg]


Possibly Related Threads...
Thread Author Replies Views Last Post
  Create Your Own Repository whufclee 46 13,269 06-01-2017, 03:04 AM
Last Post: kodi2122
  Addon Dev. Youtube links Man Cave 2 201 05-07-2017, 06:30 PM
Last Post: Man Cave
  Video Addon Help!! TheGrid 9 354 05-07-2017, 10:23 AM
Last Post: TheGrid
  [Addon Dev help] need help with Scraper tdbnz 14 1,169 03-09-2017, 06:13 AM
Last Post: Kiwi_man82
  Addon DEV Help tdbnz 5 506 02-13-2017, 09:35 AM
Last Post: tdbnz
  How to get control back after running an addon bigoldboy 1 305 02-09-2017, 02:20 AM
Last Post: mydraal
  Delete remove addon kodiuser 6 779 02-09-2017, 12:58 AM
Last Post: Derrick Stanfield
  How to make Trakt read my addon movies? Shadrach 1 355 01-26-2017, 09:50 PM
Last Post: Ryan Isbell
  disable uninstall for my addon james739 10 1,203 01-21-2017, 07:39 PM
Last Post: james739
  activating external addon within my script james739 5 764 12-26-2016, 09:23 PM
Last Post: james739

Forum Jump:


Users browsing this thread: 1 Guest(s)