Remote json list
#1
Hi,

I have made a addons for kodi. But i want to get the list of the channels from a json(php) on the web.

default.py
PHP Code:
import sysosrexbmcxbmcguixbmcaddonxbmcpluginurllib2
import json

addon      
xbmcaddon.Addon(id='plugin.video.myplugin')
version    addon.getAddonInfo('version')
pluginpath addon.getAddonInfo('path')
imagepath  os.path.join(xbmc.translatePath(pluginpath),'resources','images')

def additem(channel_idtitle,streamurl):
    
listitem xbmcgui.ListItem(titlethumbnailImage os.path.join(imagepath,channel_id '.gif'))
    
xbmcplugin.addDirectoryItem(int(sys.argv[1]), streamurllistitemtotalItems=2)
                
            

additem('1''test channel','http://mydomain.com/master.m3u8')
additem('2''test channel','http://mydomain.com/master.m3u8')
xbmcplugin.endOfDirectory(int(sys.argv[1])) 

Json
PHP Code:
{"1":{"title":"test channel 1","link":"http:\/\/mydomain.com\/master.m3u8","img":"http:\/\/mydomain.com\/img\/logo.png"},"2":{"title":"test channel 2","link":"http:\/\/mydomain.com\/master2.m3u8","img":"http:\/\/mydomain.com\/img\/logo.png"}} 

Hope someone here can help me.
Reply

Logout Mark Read Team Forum Stats Members Help
Remote json list0