run script
#1
How can I install this script ?
I tried Basic Steps but i can't see the step 6.

XBMC 10.1
Default skin

Code:
import os #Used to access host file system
import os.path
import xbmcplugin #Used to interface with XBMC
import xbmcgui #Used for XBMC gui
import urllib #Used for URL handling
import urllib2
import re


ACTION_PARENT_DIR = 9
ACTION_PREVIOUS_MENU = 10

BOUQUETNAMESPATTERN = re.compile('<e2servicename>(.*?)</e2servicename>')
BOUQUETIDSPATTERN = re.compile('<e2servicereference>(.*?)</e2servicereference>')
CHANNELNAMESPATTERN = re.compile('<e2eventservicename>(.*?)</e2eventservicename>')
CHANNELIDSPATTERN = re.compile('<e2eventservicereference>(.*?)</e2eventservicereference>')
EVENTNAMESPATTERN = re.compile('<e2eventtitle>(.*?)</e2eventtitle>')
STREAMURLSPATTERN = re.compile('(http://.*?)\n')

SPACECLEANER = re.compile(' ')
QUOTECLEANER = re.compile('&quot;')

DREAMBOXURL = "http://10.0.0.12"
BOUQUETLISTURL = DREAMBOXURL+"/web/getservices"
CHANNELLISTURL = DREAMBOXURL+"/web/epgnow?bRef="
M3USTREAMURL = DREAMBOXURL+"/web/stream.m3u?ref="
CHANNELSWITCH = DREAMBOXURL+"/web/zap?sRef="

BOUQUETNAMES = []
BOUQUETNAME = ''
BOUQUETIDS = []
BOUQUETID = ''
CHANNELNAMES = []
CHANNELNAME = ''
CHANNELIDS = []
CHANNELID = ''
EVENTNAMES = []
EVENTNAME = ''
BOUQUETSLOADED = 0
CHANNELSLOADED = 0
MENULEVEL = 0


def ShowBouquetList():
global BOUQUETIDS, BOUQUETNAMES, MENULEVEL, BOUQUETSLOADED, CHANNELSLOADED
request = urllib2.Request(BOUQUETLISTURL)
socket = urllib2.urlopen(request)
xml = socket.read()
socket.close()
BOUQUETNAMES = re.findall(BOUQUETNAMESPATTERN,xml)
BOUQUETIDS = re.findall(BOUQUETIDSPATTERN,xml)
i = 0
for BOUQUETNAME in BOUQUETNAMES:
liz=xbmcgui.ListItem(BOUQUETNAME,'')
url = sys.argv[0] + "?boqu=" + BOUQUETIDS[i]
xbmcplugin.addDirectoryItem(int(sys.argv[1]),url,liz,1)
i = i + 1
xbmcplugin.endOfDirectory(int(sys.argv[1]), 1)
return(0)

def ShowChannelList(BOUQUETID):
dialog = xbmcgui.Dialog()
global MENULEVEL, CHANNELIDS, CHANNELNAMES, EVENTNAMES, CHANNELSLOADED
request = urllib2.Request(CHANNELLISTURL+'1:7:1:0:0:0:0:0:0: 0:FROM%20BOUQUET%20%22userbouquet.favourites.tv%22 %20ORDER%20BY%20bouquet%20Favoriter%20(TV)')
socket = urllib2.urlopen(request)
xml = socket.read()
socket.close()
CHANNELIDS = re.findall(CHANNELIDSPATTERN, xml)
CHANNELNAMES = re.findall(CHANNELNAMESPATTERN, xml)
EVENTNAMES = re.findall(EVENTNAMESPATTERN, xml)
i = 0
for CHANNELNAME in CHANNELNAMES:
CHANNELNAME = CHANNELNAME + " ("
CHANNELNAME = CHANNELNAME + EVENTNAMES[i]
CHANNELNAME = CHANNELNAME + ")"
liz=xbmcgui.ListItem(CHANNELNAME,'')
url = sys.argv[0] + "?play=" + CHANNELIDS[i]
xbmcplugin.addDirectoryItem(int(sys.argv[1]),url,liz,1)
i = i + 1
xbmcplugin.endOfDirectory(int(sys.argv[1]), 1)
return(0)

def PlayChannel(CHANNELID):
request = urllib2.Request(CHANNELSWITCH+CHANNELID)
socket = urllib2.urlopen(request)
socket.close();
request = urllib2.Request(M3USTREAMURL+CHANNELID)
socket = urllib2.urlopen(request)
m3u = socket.read()
socket.close()
STREAMURLS = re.findall(STREAMURLSPATTERN,m3u)
xbmc.Player().play(STREAMURLS[0])
return (0)

if cmp (sys.argv[2][0:6],"?play=") == 0:
PlayChannel(sys.argv[2][6:])
elif cmp (sys.argv[2][0:6],"?boqu=") == 0:
ShowChannelList(sys.argv[2][6:])
else:
ShowBouquetList()
Reply
#2
esxbr Wrote:How can I install this script ?
I tried Basic Steps but i can't see the step 6.

XBMC 10.1
Default skin

That documentation is quite outdated.. Here is a link to more upto date documentation: http://xbmc-gpodder-integration.googleco...%20-R7.pdf
Reply
#3
thanks !!!!
Reply
#4
Now I'm able to execute the script but I've got the error "msg: 'import site' failed; use -v for traceback"

http://pastebin.com/kpv9Bnu0
Reply
#5
esxbr Wrote:Now I'm able to execute the script but I've got the error "msg: 'import site' failed; use -v for traceback"

http://pastebin.com/kpv9Bnu0

That seems to happen on windows systems, though I'm not sure what it means, it seems to be harmless.
Reply

Logout Mark Read Team Forum Stats Members Help
run script0