Your 2nd Add-On: Online Videos!
#1
Discussion topic for the Online Video Add-on wiki tutorial

HOW-TO:Video_addon (wiki)

Image

Special thanks to Roman_V_M for writing the original source.

https://github.com/romanvm/plugin.video.example

This wiki guide is a work in progress!
Reply
#2
As with all these guides, please feel free to discuss in this topic but keep it ON TOPIC to do with this tutorial.

It is not a generic support thread for every python question under the sun Wink

I'd particularly like to hear about people extending this code to scrape a website, play a youtube clip or do other cool things.
Reply
#3
Really great example, covers all the main points.
One small comment: there seems to be a push to stop using __xxxx__ labels in the code (I'm guessing that the format is used for internal var labels in python, so possible conflicts). See this post: http://forum.kodi.tv/showthread.php?tid=...pid2138390
Reply
#4
Thanks for the tutorial. I been looking for something like this.

Now, being a total noob to addon development. I do have some questions and I have searched for the answers. Some which I found.

The first is I would like to use a separate fan art image. the current code:
Code:
# Set a fanart image for the list item.
        # Here we use the same image as the thumbnail for simplicity's sake.
        list_item.setProperty('fanart_image', VIDEOS[category][0]['thumb'])
Uses the thumbnail and everything I tired breaks the code.

Also, can someone point out how to make give the main directory(ie animals, food, cars) there own image rather than use an image from in the directory?
which I know the code is here:
Code:
# Create a list item with a text label and a thumbnail image.
        list_item = xbmcgui.ListItem(label=category, thumbnailImage=VIDEOS[category][0]['thumb'])
        # Set a fanart image for the list item.
        # Here we use the same image as the thumbnail for simplicity's sake.
        list_item.setProperty('fanart_image', VIDEOS[category][0]['thumb'])

but having the same issue as before.


Is this plugin possible to pull the sources thumb, video and the genre, etc from an external website. say a sitemap.

Thanks.


Edit oops forgot one question.
Reply
#5
Seems used code is outdated although it still works.
Should now be done with
.setArt({ 'thumb': iconimage, 'banner' : os.path.join(artfolder,'banner.png'), 'fanart': os.path.join(addonfolder,'fanart.jpg') }) liz.setPath(u)

Code above is sample snippet and needs to be adjusted for use
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
(2015-11-21, 23:56)Martijn Wrote: Seems used code is outdated although it still works.
Should now be done with
.setArt({ 'thumb': iconimage, 'banner' : os.path.join(artfolder,'banner.png'), 'fanart': os.path.join(addonfolder,'fanart.jpg') }) liz.setPath(u)

Code above is sample snippet and needs to be adjusted for use

Alright thanks.. Ill see what I can make out of it.
Reply
#7
I used Roman's example for my (very hacky) netflix addon
Reply
#8
(2015-11-21, 23:56)Martijn Wrote: Seems used code is outdated although it still works.
Should now be done with
.setArt({ 'thumb': iconimage, 'banner' : os.path.join(artfolder,'banner.png'), 'fanart': os.path.join(addonfolder,'fanart.jpg') }) liz.setPath(u)

Code above is sample snippet and needs to be adjusted for use

What is outdated in it? Yes, setArt now provides an alternative way to set item's fanart along with other graphics, but unless there are some serious plans to depreciate setProperty('fanart_image', '/path/to/fanart.jpg') method, using setProperty for fanart is totally legit IMO.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#9
BTW, Since zag created this topic, I started to receive suggestions to implement this or that feature in plugin.video.example. Honestly, I have my doubts about adding new features beyond what has already been added. I intended this example to be as simple as possible and to provide only enough info to get you started. Kodi plugin development is an immense topic, and we cannot cover all possible scenarios in one small example.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#10
Yes please keep it simple.

I hope people add to the code, suggest improvements and comment in this thread so it benefits everyone. But there is no need to add that to Github.

The default example should stay as simple as possible, using the best coding practices. Remember a lot of Add-ons may base themselves off this in the future

EDIT: I removed the link to your forum profile so hopefully people stop direct messaging you Big Grin
Reply
#11
Hi,
I am trying to create a personal video collection addon with the link to various videos on internet. I have modified this addon to add link to mp4/mkv files around the internet, Kodi has no problem playing these videos. How do I add video link from youtube or random online streaming sites ?

Any help would be much appreciated, thank you
Reply
#12
(2015-12-01, 00:18)bickyz Wrote: How do I add video link from youtube or random online streaming sites ?

Actually, this is a separate and complex topic, and there is no simple reply on "how". Some sites, like Youtube, offer API that allows to get playable links to your program, which is a relatively easy case. As for Youtube, you can see the respective Kodi plugin. Other sites require parsing their html/js/flash code to pick playable links from there which can be a very complicated task because some sites don't want their content to be obtained that easy.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#13
For youtube, take a look at how the kord cutters add-on does it.

That will give you a good basis for a youtube subscription channel browser.

https://github.com/enen92/plugin.video.kordkutters
Reply
#14
i would like to get involved with kodi have html but would like some guidance if possible on the programming dev of addons plz
Reply
#15
(2015-12-03, 12:42)orlaithshusband Wrote: i would like to get involved with kodi have html but would like some guidance if possible on the programming dev of addons plz


I started with bucky's python tutorials
https://www.thenewboston.com/videos.php?cat=36
Reply
 
Thread Rating:
  • 2 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
Your 2nd Add-On: Online Videos!52