Plugin tutorial

misty

Developer
Aug 28, 2013
95
0
0
Here's a link to my first post to the hub. It was a request to review my plugin code which was based on the voinage tutorial. Through the suggestions and help of a couple of the devs here it morphed from a voinage based template to a plugin which uses the t0mm0 common addons method.

Download the voinage tutorial and do a good read through of it. The site the tutorial is based on does not exist anymore, but you will get a good base to work from. If you do read my code review thread, it might be helpful as well. I tried to add code documentation sprinkled throughout the code and if you read the code through you will see the transformation of voinage template based code to t0mm0 common based code and the website I used to experiment with still exists and may be a good starting point for you. I've actually been thinking about revisiting that site and releasing a plugin for it. Anyway, that's something on my backburner...

Hope that's helpful.
 

misty

Developer
Aug 28, 2013
95
0
0
Here's a blog about creating an xbmc video plugin. I actually went through the tutorial at the blog and learned quite a bit and gained some understanding of programming in python and for xbmc. If you work through the tutorial at the blog, you'll definitely learn something, but be aware that it's not complete and the plugin you create from their examples may not work or have errors. But to me that's not the main point, the main point is to be exposed to the process and explanations provided which will be helpful in creating your own plugin.

Beyond the basics, you really need to get a good handle on python programming. Visit https://www.python.org/ and dig into the docs for python 2.7. At this point I'm not sure if xbmc has transitioned to python 3 yet, so better to concentrate on python 2.7.

You can find free python books online as well. 6 free python books. Another one I found is 20 of the Best Free Python books. These are excellent references and free to boot.

If you're not already a programmer, guaranteed your brain will hurt as you take in all this info, but you will get to a point where you have an "Ah ha" moment and things will start to make sense. I've had those ah ha moments, but I've got a lot to still learn.
 

nothere

Banned
Nov 25, 2012
1,036
0
0
Woah this is crazy. So much reading....but I'll get the better of it or die trying.
Lol. You'll be fine mate. Python is the easy bit. There are so many resources to learn basic python.
The New Boston python videos are brilliant (get the addon from my repo). They are structured in to different areas of python coding and they guy doing the videos explains it really well.
I used vinnys tutorial when I started as it was the only thing around. I think most devs started by using his templates and tutorial. Some if it is slightly outdated (as it was written years ago) but it still works well as a learning tool.
Like I said basic python is quite easy to get to grips with. It's using it in an xbmc environment using the xbmc python modules which takes the time as it's only documented on xbmc.org and that is not the best reDing for a beginner.
Don't worry, just take your time. There are so many good devs here which are great when it comes to helping out. I found that out when I started.
 

RavRob

Moderator
Staff member
Nov 21, 2012
6,590
60
48
The Halls of Valhalla
Thanks MK, I have your addon and Vinny's tut. But I know I will be looking for help when it comes to creating an addon.

For now I am reading and doing basic stuff flowing tuts.
 

khmer

New member
May 4, 2015
4
0
0
Also get Metalkettle's New Boston Python Tutorial Add-on HERE has some great python tuts... I still use it from time to time to brush up on python... OK OK I forget alot :)
I would like to learn how to create video plugin for these site
thekhmervcd.com/khmer-vcd-production
7khmer.com
thailakornvideos.com

I notice that DKnlght hasn't been around for awhile, probably personal reason and I truly understand all Dev have a life beside in here.

Could you please point me to link for Metalkettle's New Boston Python Tutorial or link that can help me in creating an addon. The link in here are mostly dead.

Thank you.
 

MetalKettle

Banned
Oct 5, 2015
48
0
0
I would like to learn how to create video plugin for these site



I notice that DKnlght hasn't been around for awhile, probably personal reason and I truly understand all Dev have a life beside in here.

Could you please point me to link for Metalkettle's New Boston Python Tutorial or link that can help me in creating an addon. The link in here are mostly dead.

Thank you.
The addon is available from my repo. But there are a number of useful sites for getting into python.
 

khmer

New member
May 4, 2015
4
0
0
I was able to get index(url) and page number to show and working but I can't get episode to show. Please guide me? Below is a screenshot using Inspect Element. I'm trying to show all links in "li"

site: hxxp://dramaskhmer.com/index.php/mega_movie/details/3438-part-1

Code:
def EPISODE_drama(url,name):
link = OpenURL(url)
        addLink(name,url,3,'')
        match=re.compile('<div style="width:100%;overflow-x: scroll;overflow-y: hidden;white-space: nowrap;display: inline-block;vertical-align: middle;"></div>').findall(link)    
          match=re.compile('<li><a href="(.+?)"><img src="(.+?)">(.+?)</img></a></li>').findall(link)
        for vLink, vLinkName in match:
            addLink(vLinkName,vLink,3,'')
        xbmcplugin.endOfDirectory(pluginhandle)
I even try this and still episode not showing.

Code:
def EPISODE_drama(url,name):
         html = OpenSoup(url)
         addLink(name,url,3,'')
         try:
             html = html.encode("UTF-8")
         except: pass
         soup = BeautifulSoup(html.decode("utf-8"))
         epis = soup('ul',{"class":"related_items"})
         for link in epis:	 
             vLink = BeautifulSoup(str(link))('a')[0]['href']
             print vLink
             vTitle = BeautifulSoup(str(link))('a')[0].contents[2]
             vImage = BeautifulSoup(str(link))('img')[0]['src']
             print vImage
             addLink(vTitle,vLink,3,'')
It doesn't show episode 2 to 6
 
Last edited: