Kodi Community Forum
XBMC Tuxbox Enigma Stream Client (Enigma / Enigma2 Based Dreambox & Dbox2) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: XBMC Tuxbox Enigma Stream Client (Enigma / Enigma2 Based Dreambox & Dbox2) (/showthread.php?tid=23834)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47


- slain - 2011-09-19

realjobe Wrote:I have NewNigma2 v3.2 and some Experimental 05/2011 Xbmc image: bouquets are retreived properly and channels are streamed great. Works! TuxBox protocoll.


HTTPApi for Enigma2 is here. http://dream.reichholf.net/e2web/
some python can be done I suppose..

I'll take a look at this during the week. I've been using plugin.video.dreambox (http://www.dream-multimedia-tv.de/board/index.php?page=Thread&threadID=14215) for the past couple of days after making some changes to support authentication to the Dreambox. That part works great and I can browse the bouquets with ease.

Unfortunately on my AppleTV2 I have the same problem as I do with Tuxbox on that device... when attempting to stream, XBMC says it receives no data (http://forum.xbmc.org/showthread.php?tid=110409). Never the less I'm going to try the modified plugin on my Ubuntu netbook XBMC install tonight and see if I can stream from that. I imagine it'll work fine.

Once I've proved it working I'll stick it on Github and begin working on getting now & next working nicely.


- slain - 2011-09-23

slain Wrote:I'll take a look at this during the week. I've been using plugin.video.dreambox (http://www.dream-multimedia-tv.de/board/index.php?page=Thread&threadID=14215) for the past couple of days after making some changes to support authentication to the Dreambox. That part works great and I can browse the bouquets with ease.

Unfortunately on my AppleTV2 I have the same problem as I do with Tuxbox on that device... when attempting to stream, XBMC says it receives no data (http://forum.xbmc.org/showthread.php?tid=110409). Never the less I'm going to try the modified plugin on my Ubuntu netbook XBMC install tonight and see if I can stream from that. I imagine it'll work fine.

Once I've proved it working I'll stick it on Github and begin working on getting now & next working nicely.

I fixed the plugin and even though Tuxbox is broken for me (with the URL encoding not working for renamed channels within bouquets with whitespace), the modifications I made to the plugin have now enabled it to work. I've submitted a bug for the Tuxbox issue at http://trac.xbmc.org/ticket/11974

Modified plugin being uploaded to Github tomorrow evening.


- FoxForceFive - 2011-09-27

slain Wrote:I fixed the plugin and even though Tuxbox is broken for me (with the URL encoding not working for renamed channels within bouquets with whitespace), the modifications I made to the plugin have now enabled it to work. I've submitted a bug for the Tuxbox issue at http://trac.xbmc.org/ticket/11974

Modified plugin being uploaded to Github tomorrow evening.

I believe I am having this issue, can you let us know the details where have uploaded the modified plugin? I have searched github but to no avial.

Cheers for all your help on this matter.


- slain - 2011-09-27

FoxForceFive Wrote:I believe I am having this issue, can you let us know the details where have uploaded the modified plugin? I have searched github but to no avial.

Cheers for all your help on this matter.

Apologies, I've been lazy and not got around to it yet.

This version supports authentication, white-space in renamed channels, and has preliminary support for browsing satellites by position. Names for satellites etc don't currently function but I'm working on that, but at the moment it's rather useless as you don't know what satellite you're looking at. Wink

plugin.video.dreambox v1.0.2 by Flatman/slain
http://www.hardc0re.org.uk/xbmc-plugin_video_dreambox-1.0.2.tar.gz


- Dullie - 2011-09-28

slain Wrote:Apologies, I've been lazy and not got around to it yet.

This version supports authentication, white-space in renamed channels, and has preliminary support for browsing satellites by position. Names for satellites etc don't currently function but I'm working on that, but at the moment it's rather useless as you don't know what satellite you're looking at. Wink

plugin.video.dreambox v1.0.2 by Flatman/slain
http://www.hardc0re.org.uk/xbmc-plugin_video_dreambox-1.0.2.tar.gz

Works perfect! Thanks a lot. I also have access to recordings as well. It would be nice if it could load picons.


- slain - 2011-09-28

Dullie Wrote:Works perfect! Thanks a lot. I also have access to recordings as well. It would be nice if it could load picons.

You'll probably find it to be very similar to Tuxbox, bar the fact it can show satellites and providers too, whilst seemingly handling larger bouquets better (without hanging).

I'll be working on now & next first, along with the satellite naming listing working correctly.


- FoxForceFive - 2011-09-28

Wow, brilliant work mate, thanks for getting back to us with the modified plugin!

A now & next & other improvements would be a definite bonus, but regardless, thanks a lot for your work so far!


- adriankoooo - 2011-09-29

Guys please help: how to install the plugin?

plugin.video.dreambox v1.0.2 by Flatman/slain


- FoxForceFive - 2011-09-29

adriankoooo Wrote:Guys please help: how to install the plugin?

plugin.video.dreambox v1.0.2 by Flatman/slain

I just extracted it so I was left with a folder, then compressed it to a zip file.

Then install as any other zip add on.


- realjobe - 2011-09-30

GREAT! Thanx, will test today.. :=)


- xayide - 2011-10-04

Would be nice if the script was modified to have Events visible in the channellist like...

ChannelName (CurrentEvent)

In such case one will know whats playing....


Problem - MacFever - 2011-10-08

I managed to install the plugin, it seems to work but When trying to retrieve channels I am getting an error : script failed
What I am doing wrong ?
Question : dont I have to put the ip address of the Dreambox somewhere ?
Thanks for your help
Eric


- Vultures - 2011-10-08

The plugin works — it loads the list of channels, and opens streams from this list. But I wasn't able to make it do anything else. No switching between channels (without returning to channel list), no current/next events, no epg, etc. Is it supposed to do any of this? If yes, what am I doing wrong?


- dutchmatrix - 2011-10-13

Is this already on Github?

I am integrating events at the moment, at least that is shows what is playing.


event now showing in the channel list - dutchmatrix - 2011-10-14

I have the current event now showing in the channel list.
Only if that data is available.

Could someone of you test it.

Replace the code from Dreambox.py with this code (backup first)
Based on 1.0.2

Code:
import xbmc, xbmcplugin, xbmcgui, urllib, urllib2, sys, xml.dom.minidom

def getText(nodelist):
    rc = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)

class Dreambox(object):
    __settings__ = sys.modules[ "__main__" ].__settings__
    __language__ = sys.modules[ "__main__" ].__language__
    __plugin__ = sys.modules[ "__main__" ].__plugin__

    def __init__(self, handle):
        self.handle = handle
        self.ipaddress = self.__settings__.getSetting("ipaddress")
        self.username = self.__settings__.getSetting("username")
        self.password = self.__settings__.getSetting("password")
        
        password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
        dreambox_url = "http://" + self.ipaddress
        password_mgr.add_password(None, dreambox_url, self.username, self.password)
        handler = urllib2.HTTPBasicAuthHandler(password_mgr)
        opener = urllib2.build_opener(handler)
        urllib2.install_opener(opener)

    def rootmenu(self):
        menu = [
            { "name":self.__language__( 1 ), "mode": "tv" },
            { "name":self.__language__( 2 ), "mode": "radio" },
            { "name":self.__language__( 3 ), "mode": "movies" },
        ]

        for item in menu:
            li = xbmcgui.ListItem(item["name"])
            url = sys.argv[0] + '?' + urllib.urlencode({"mode":item["mode"]})
            xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=True, totalItems=len(menu) )

        xbmcplugin.endOfDirectory(handle=self.handle, succeeded=True)

    def readradioservicelist(self):
        # Get Bouquet list
        data = urllib2.urlopen("http://" + self.ipaddress + "/web/getservices?" + urllib.urlencode({"sRef": '1:7:2:0:0:0:0:0:0:0:(type == 2)FROM BOUQUET "bouquets.radio" ORDER BY bouquet'}))
        e2servicelist = xml.dom.minidom.parse(data)
        data.close()

        servicelist = e2servicelist.getElementsByTagName("e2service")
        for service in servicelist:
            data = {}
            for element in service.childNodes:
                data[element.localName] = getText(element.childNodes)

            cmd = {}
            cmd["mode"] ="readservice"
            cmd["e2servicename"] = data["e2servicename"].encode("utf-8")
            cmd["e2servicereference"] = data["e2servicereference"].encode("utf-8")

            li = xbmcgui.ListItem(data["e2servicename"])
            url = sys.argv[0] + '?' + urllib.urlencode(cmd)
            xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=True, totalItems=len(servicelist))

        # Get provider list
        data = {
            "mode":"readservice",
            "e2servicename":"Provider",
            "e2servicereference":"1:7:2:0:0:0:0:0:0:0:(type == 2) FROM PROVIDERS ORDER BY name"
        }
        li = xbmcgui.ListItem(data["e2servicename"])
        url = sys.argv[0] + '?' + urllib.urlencode(data)
        xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=True, totalItems=len(servicelist))

        xbmcplugin.endOfDirectory(handle=self.handle, succeeded=True)

    def readtvservicelist(self):
        # Get Bouquet list
        data = urllib2.urlopen("http://" + self.ipaddress + "/web/getservices?" + urllib.urlencode({"sRef": '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25)FROM BOUQUET "bouquets.tv" ORDER BY bouquet'}))
        e2servicelist = xml.dom.minidom.parse(data)
        data.close()

        servicelist = e2servicelist.getElementsByTagName("e2service")
        for service in servicelist:
            data = {}
            for element in service.childNodes:
                data[element.localName] = getText(element.childNodes)

            cmd = {}
            cmd["mode"] ="readservice"
            cmd["e2servicename"] = data["e2servicename"].encode("utf-8")
            cmd["e2servicereference"] = data["e2servicereference"].encode("utf-8")

            li = xbmcgui.ListItem(data["e2servicename"])
            url = sys.argv[0] + '?' + urllib.urlencode(cmd)
            xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=True, totalItems=len(servicelist))

        # Get provider list
        data = {
            "mode":"readservice",
            "e2servicename":"Provider",
            "e2servicereference":"1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25) FROM PROVIDERS ORDER BY name"
        }
        li = xbmcgui.ListItem(data["e2servicename"])
        url = sys.argv[0] + '?' + urllib.urlencode(data)
        xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=True, totalItems=len(servicelist))

        # Get satellite list
        data = {
            "mode":"readservice",
            "e2servicename":"Satellite",
            "e2servicereference":"1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25) FROM SATELLITES ORDER BY name"
        }
        li = xbmcgui.ListItem(data["e2servicename"])
        url = sys.argv[0] + '?' + urllib.urlencode(data)
        xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=True, totalItems=len(servicelist))

        xbmcplugin.endOfDirectory(handle=self.handle, succeeded=True)

    def readservice(self, data):
        servicereference = data["e2servicereference"][0].decode("utf-8")
        data = urllib2.urlopen("http://" + self.ipaddress + "/web/getservices?" + urllib.urlencode({"sRef": servicereference.encode("utf-8")}))
        e2servicelist = xml.dom.minidom.parse(data)
        data.close()
        currentEvent1 = "http://" + self.ipaddress + "/web/epgnow?" + urllib.urlencode({"bRef": servicereference})
        dataEpg = urllib2.urlopen("http://" + self.ipaddress + "/web/epgnow?" + urllib.urlencode({"bRef": servicereference.encode("utf-8")}))
        e2epglist = xml.dom.minidom.parse(dataEpg)
        dataEpg.close()
        servicelist = e2servicelist.getElementsByTagName("e2service")
        epglist = e2epglist.getElementsByTagName("e2event")
        epgArray = {}
        theTitle = ""
        theName = ""
        for epg in epglist:
            tempData = {}
            for element in epg.childNodes:
                tempData[element.localName] = getText(element.childNodes)
                if element.localName == "e2eventtitle" :
                    theTitle = getText(element.childNodes)
                if element.localName == "e2eventservicename" :
                    theName = getText(element.childNodes)
                if theName and theTitle:
                    epgArray[theName] = theTitle
                    theName=""
                    theTitle=""
            
            

            
    
        for service in servicelist:
            data = {}
            for element in service.childNodes:
                data[element.localName] = getText(element.childNodes)
            servicereference = data["e2servicereference"].split(":")
            attr = int(servicereference[1])
            mode = int(servicereference[2])
            cmd = {}
            if attr & 4:
                cmd["mode"] ="readservice"
                isFolder = True
                currentEvent = ""
            else:
                cmd["mode"] ="stream"
                isFolder = False
                
                currentEvent = " (" + epgArray[data["e2servicename"]]  + ")"
                
            cmd["e2servicename"] = data["e2servicename"].encode("utf-8")
            cmd["e2servicereference"] = data["e2servicereference"].encode("utf-8")
            extraInfo = " (" + epgArray[data["e2servicename"]]  + ")"
            li = xbmcgui.ListItem(data["e2servicename"] + extraInfo)
            mediatype = ""
            if mode == 1:
                mediatype = "video"
            elif mode == 2:
                mediatype = "music"
            if mediatype:
                li.setInfo(mediatype, {'Title': data["e2servicename"] })
            url = sys.argv[0] + '?' + urllib.urlencode(cmd)
            xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=isFolder, totalItems=len(servicelist))
        xbmcplugin.endOfDirectory(handle=self.handle, succeeded=True)

    def readmovies(self):
        data = urllib2.urlopen("http://" + self.ipaddress + "/web/movielist")
        e2movielist = xml.dom.minidom.parse(data)
        data.close()

        movieList = e2movielist.getElementsByTagName("e2movie")
        for movie in movieList:
            data = {}
            for element in movie.childNodes:
                data[element.localName] = getText(element.childNodes)

            li = xbmcgui.ListItem(data["e2title"], data["e2description"])
            labels = {
                "size":int(data["e2filesize"]),
                "plot":data["e2description"],
                "title":data["e2title"]
            }
            li.setInfo("video", labels)
            url = sys.argv[0] + '?' + urllib.urlencode({"mode":"ts", "e2servicename":data["e2title"].encode("utf-8"), "e2filename":data["e2filename"].encode("utf-8"), "e2servicereference":data["e2servicereference"].encode("utf-8")})
            xbmcplugin.addDirectoryItem(handle=self.handle, url=url, listitem=li, isFolder=False, totalItems=len(movieList))
        xbmcplugin.endOfDirectory(handle=self.handle, succeeded=True)

    def stream(self, data):
        servicename = data["e2servicename"][0].decode("utf-8")
        servicereference = data["e2servicereference"][0].decode("utf-8")
        reference = servicereference.split(":")
        mode = int(reference[2])

        data = urllib2.urlopen("http://" + self.ipaddress + "/web/stream.m3u?" + urllib.urlencode({"ref": servicereference.encode("utf-8")}))
        playlist = data.readlines()
        playlist[-1] = playlist[-1].replace(" ", "%20")
        data.close()

        li = xbmcgui.ListItem(servicename)
        mediatype = ""
        if mode == 1:
            mediatype = "video"
        elif mode == 2:
            mediatype = "music"
        if mediatype:
            li.setInfo(mediatype, {'Title': servicename })
        xbmc.Player().play(playlist[-1], li)
        
    def ts(self, data):
        servicename = data["e2servicename"][0].decode("utf-8")
        filename = data["e2filename"][0].decode("utf-8")
        servicereference = data["e2servicereference"][0].decode("utf-8")
        reference = servicereference.split(":")
        mode = int(reference[2])
        
        url = "http://" + self.ipaddress + "/file?file=" + filename.replace("/", "%2F").replace(" ", "%20")

        li = xbmcgui.ListItem(servicename)
        mediatype = ""
        if mode == 1:
            mediatype = "video"

        elif mode == 2:
            mediatype = "music"
        if mediatype:
            li.setInfo(mediatype, {'Title': servicename })
        xbmc.Player().play(url, li)