Nick Reboot
17
Readme.md
|
|
@ -1,17 +0,0 @@
|
|||
# Simple example plugin for Kodi mediacenter
|
||||
|
||||
This is a simple yet fully functional example of a video plugin for [Kodi](http://kodi.tv) mediacenter.
|
||||
Please read the comments in the plugin code for more details.
|
||||
An installable .zip can be downloaded from "[Releases](https://github.com/romanvm/plugin.video.example/releases)" tab.
|
||||
Do **not** try to install a .zip generated by GitHub.
|
||||
|
||||
**Note**: the purpose of this example plugin is to show you how to organize and play your media content in Kodi.
|
||||
The methods of obtaining such content, for example parsing websites or working with various APIs,
|
||||
are beyond the scope of this example.
|
||||
|
||||
The plugin uses a pre-defined set of free sample videos from [www.vidsplay.com](http://www.vidsplay.com/).
|
||||
|
||||
**Warning**: the "master" branch is only compatible with Kody 19.0 ("Matrix") and above that uses Python 3
|
||||
runtime for addons. For older versions based on Python 2 see the "python2" branch.
|
||||
|
||||
License: [GPL v.3](http://www.gnu.org/copyleft/gpl.html)
|
||||
26
addon.xml
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<addon id="plugin.video.example"
|
||||
version="2.4.0"
|
||||
name="Example Kodi Video Plugin"
|
||||
provider-name="Roman_V_M">
|
||||
<addon id="plugin.video.nickreboot"
|
||||
version="1.0.0"
|
||||
name="Nick Reboot"
|
||||
provider-name="Spacefreak18">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="3.0.0"/>
|
||||
</requires>
|
||||
|
|
@ -10,16 +10,16 @@ provider-name="Roman_V_M">
|
|||
<provides>video</provides>
|
||||
</extension>
|
||||
<extension point="xbmc.addon.metadata">
|
||||
<summary lang="en">Example Kodi Video Plugin</summary>
|
||||
<description lang="en_GB">An example video plugin for Kodi mediacenter.</description>
|
||||
<disclaimer lang="en_GB">Free sample videos are provided by www.vidsplay.com.</disclaimer>
|
||||
<summary lang="en">Reboot Your Inner Child</summary>
|
||||
<description lang="en_GB">Reboot Your Inner Child</description>
|
||||
<disclaimer lang="en_GB">Reboot Your Inner Child</disclaimer>
|
||||
<assets>
|
||||
<icon>icon.png</icon>
|
||||
<fanart>fanart.jpg</fanart>
|
||||
<screenshot>resources\screenshot-01.jpg</screenshot>
|
||||
<screenshot>resources\screenshot-02.jpg</screenshot>
|
||||
<screenshot>resources\screenshot-03.jpg</screenshot>
|
||||
<icon>resources/icon.png</icon>
|
||||
<fanart>resources/bgimg.jpg</fanart>
|
||||
<screenshot>resources/screenshot0.png</screenshot>
|
||||
<screenshot>resources/screenshot1.png</screenshot>
|
||||
<screenshot>resources/screenshot2.jpg</screenshot>
|
||||
</assets>
|
||||
<news>Updated with latest artwork metadata</news>
|
||||
<news>Super secret Addon from Paul</news>
|
||||
</extension>
|
||||
</addon>
|
||||
|
|
|
|||
BIN
fanart.jpg
|
Before Width: | Height: | Size: 97 KiB |
60
main.py
|
|
@ -1,10 +1,8 @@
|
|||
# Module: main
|
||||
# Author: Roman V. M.
|
||||
# Created on: 28.11.2014
|
||||
# Author: Paul Dino Jones
|
||||
# Created on: 2022.05.03
|
||||
# License: GPL v.3 https://www.gnu.org/copyleft/gpl.html
|
||||
"""
|
||||
Example video plugin that is compatible with Kodi 19.x "Matrix" and above
|
||||
"""
|
||||
|
||||
import sys
|
||||
from urllib.parse import urlencode, parse_qsl
|
||||
import xbmcgui
|
||||
|
|
@ -15,49 +13,16 @@ _URL = sys.argv[0]
|
|||
# Get the plugin handle as an integer number.
|
||||
_HANDLE = int(sys.argv[1])
|
||||
|
||||
|
||||
# Free sample videos are provided by www.vidsplay.com
|
||||
# Here we use a fixed set of properties simply for demonstrating purposes
|
||||
# In a "real life" plugin you will need to get info and links to video files/streams
|
||||
# from some web-site or online service.
|
||||
VIDEOS = {'Animals': [{'name': 'Crab',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/04/crab-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/04/crab.mp4',
|
||||
'genre': 'Animals'},
|
||||
{'name': 'Alligator',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/04/alligator-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/04/alligator.mp4',
|
||||
'genre': 'Animals'},
|
||||
{'name': 'Turtle',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/04/turtle-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/04/turtle.mp4',
|
||||
'genre': 'Animals'}
|
||||
],
|
||||
'Cars': [{'name': 'Postal Truck',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/05/us_postal-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/05/us_postal.mp4',
|
||||
'genre': 'Cars'},
|
||||
{'name': 'Traffic',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/05/traffic1-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/05/traffic1.mp4',
|
||||
'genre': 'Cars'},
|
||||
{'name': 'Traffic Arrows',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/05/traffic_arrows-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/05/traffic_arrows.mp4',
|
||||
'genre': 'Cars'}
|
||||
],
|
||||
'Food': [{'name': 'Chicken',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/05/bbq_chicken-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/05/bbqchicken.mp4',
|
||||
'genre': 'Food'},
|
||||
{'name': 'Hamburger',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/05/hamburger-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/05/hamburger.mp4',
|
||||
'genre': 'Food'},
|
||||
{'name': 'Pizza',
|
||||
'thumb': 'http://www.vidsplay.com/wp-content/uploads/2017/05/pizza-screenshot.jpg',
|
||||
'video': 'http://www.vidsplay.com/wp-content/uploads/2017/05/pizza.mp4',
|
||||
'genre': 'Food'}
|
||||
]}
|
||||
VIDEOS = {'Live': [{'name': 'Nick Reboot',
|
||||
'thumb': 'https://res.cloudinary.com/crunchbase-production/image/upload/c_lpad,h_170,w_170,f_auto,b_white,q_auto:eco,dpr_1/v1412260035/rd4ity1ftukrlofrw3gw.png',
|
||||
'fanart': 'https://repo.brak.space/bgimg.jpg',
|
||||
'video': 'rtmp://nickreboot.brak.space/live/NickReboot',
|
||||
'genre': 'Live Stream'}]}
|
||||
|
||||
|
||||
def get_url(**kwargs):
|
||||
|
|
@ -173,11 +138,12 @@ def list_videos(category):
|
|||
# 'mediatype' is needed for skin to display info for this ListItem correctly.
|
||||
list_item.setInfo('video', {'title': video['name'],
|
||||
'genre': video['genre'],
|
||||
'fanart': video['fanart'],
|
||||
'mediatype': 'video'})
|
||||
# Set graphics (thumbnail, fanart, banner, poster, landscape etc.) for the list item.
|
||||
# Here we use the same image for all items for simplicity's sake.
|
||||
# In a real-life plugin you need to set each image accordingly.
|
||||
list_item.setArt({'thumb': video['thumb'], 'icon': video['thumb'], 'fanart': video['thumb']})
|
||||
list_item.setArt({'thumb': video['thumb'], 'icon': video['thumb'], 'fanart': video['fanart']})
|
||||
# Set 'IsPlayable' property to 'true'.
|
||||
# This is mandatory for playable items!
|
||||
list_item.setProperty('IsPlayable', 'true')
|
||||
|
|
@ -194,7 +160,6 @@ def list_videos(category):
|
|||
# Finish creating a virtual folder.
|
||||
xbmcplugin.endOfDirectory(_HANDLE)
|
||||
|
||||
|
||||
def play_video(path):
|
||||
"""
|
||||
Play a video by the provided path.
|
||||
|
|
@ -235,7 +200,8 @@ def router(paramstring):
|
|||
else:
|
||||
# If the plugin is called from Kodi UI without any parameters,
|
||||
# display the list of video categories
|
||||
list_categories()
|
||||
#list_categories()
|
||||
list_videos("Live")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 808 KiB |
|
After Width: | Height: | Size: 29 KiB |