2014-12-14, 14:41
The Code is:
So How can i link a video with the item "Folder Three video" ?
I thought it has something to do with the url but changeing the url has no reaction.
PHP Code:
import sys
import urllib
import urlparse
import xbmcgui
import xbmcplugin
import urllib2
import socket
import xbmcaddon
import datetime
import re
import os
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
args = urlparse.parse_qs(sys.argv[2][1:])
line1 = ''
line2 = "We can write anything we want here"
line3 = "Using Python"
xbmcplugin.setContent(addon_handle, 'movies')
def build_url(query):
return base_url + '?' + urllib.urlencode(query)
mode = args.get('mode', None)
if mode is None:
url = build_url({'mode': 'folder', 'foldername': 'Folder One'})
li = xbmcgui.ListItem('Folder One', iconImage='DefaultFolder.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
listitem=li, isFolder=True)
url = build_url({'mode': 'folder', 'foldername': 'Folder Two'})
li = xbmcgui.ListItem('Folder Two', iconImage='DefaultFolder.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
listitem=li, isFolder=True)
url = build_url({'mode': 'folder', 'foldername': 'Folder Three'})
li = xbmcgui.ListItem('Folder Three', iconImage='DefaultFolder.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
listitem=li, isFolder=True)
url = build_url({'mode': 'folder', 'foldername': 'Folder Four'})
li = xbmcgui.ListItem('Folder Four', iconImage='DefaultFolder.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
listitem=li, isFolder=True)
xbmcplugin.endOfDirectory(addon_handle)
elif mode[0] == 'folder':
foldername = args['foldername'][0]
url = 'http://localhost/some_video.mkv'
li = xbmcgui.ListItem(foldername + ' Video', iconImage='DefaultVideo.png')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
xbmcgui.Dialog().ok(addonname, line1, line2, line3)
xbmcplugin.endOfDirectory(addon_handle)
So How can i link a video with the item "Folder Three video" ?
I thought it has something to do with the url but changeing the url has no reaction.