Dreambox-TV & Dbox2-TV Control Interface

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #11
Cool
it is done! now dreambox streaming works on xbmc !!!

i had to do now write a little phyton script to get the channel switch and boost the stream!

i don't test it on dbox2, may sone one will test it after i released it....

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Clumsy Offline
Team-XBMC Forum Moderator
Posts: 617
Joined: Feb 2004
Reputation: 0
Post: #12
i have been waiting for this for ages. how far did you get with your plans, are you at a state where you can just watch the stream or have you made it further to a state where you can maybe even record something ? either way, great work !

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #13
check the above header!

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Mausman Offline
Junior Member
Posts: 33
Joined: Jun 2004
Reputation: 0
Post: #14
can you share the source with us, so we can help you to further develop the script?

keep up the work :thumbsup:
find quote
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #15
hi,

well i have no experience with python scripting.. and i could not find some one who have both, a dreambox and python scripting experience...
we need also one who can create a script with dbox2.. to list the channels an get the current vpid and apid to play [i could not test the dbox2 yet.. because i don't have one Wink]

i have began a simple script.. but there is lot things to do with python..

i also saw the py script for mytheatre, it ist great to see that's possible.. the script for dreambox and dbox2 should be the same..


here are the keys:
1. get the html source code from the ip like [192.168.0.110]
2. extract the channel information and gerate a link for them to swtich on it..
3. get the current vpid and apid from the swtiched channel.. and generate a stream string..

here is the simple script, you need just insert the current vpid and apid..
Quote:#zapto: 192.168.0.110/cgi-bin/zapto?path=1:0:1:6dca:44d:1:c00000:0:0:0:

import urllib, time, xbmc, xbmcgui
from htmlparser import htmlparser

action_previous_menu = 10
action_select_item = 7

url = 'http://192.168.0.110'
port = ':31339'
vpid = '6e'
apid = '78'

file = url+port+'/'+vpid+','+apid
xbmc.player().play(file)


regards
geminiserver

here are the strings to get the needed information from the dreambox:
Quote:http://192.168.0.110/cgi-bin/ls
http://192.168.0.110/cgi-bin/mkdir
http://192.168.0.110/cgi-bin/rmdir
http://192.168.0.110/cgi-bin/rm
http://192.168.0.110/cgi-bin/mv
http://192.168.0.110/cgi-bin/ln


http://192.168.0.110/cgi-bin/stop
http://192.168.0.110/cgi-bin/pause
http://192.168.0.110/cgi-bin/play
http://192.168.0.110/cgi-bin/record
http://192.168.0.110/cgi-bin/videocontrol

http://192.168.0.110/setvolume
http://192.168.0.110/setvideo
http://192.168.0.110/showtimerlist
http://192.168.0.110/addtimerevent
http://192.168.0.110/addtimerevent2
http://192.168.0.110/deletetimerevent
http://192.168.0.110/edittimerevent
http://192.168.0.110/showaddtimereventwindow
http://192.168.0.110/changetimerevent
http://192.168.0.110/cleanuptimerlist
http://192.168.0.110/cleartimerlist
http://192.168.0.110/epgdetails
http://192.168.0.110/msgwindow
http://192.168.0.110/tvmessagewindow
http://192.168.0.110/cgi-bin/status
http://192.168.0.110/cgi-bin/switchservice
http://192.168.0.110/cgi-bin/zapto
http://192.168.0.110/cgi-bin/admin
http://192.168.0.110/cgi-bin/audio
http://192.168.0.110/cgi-bin/selectaudio
http://192.168.0.110/cgi-bin/setaudio
http://192.168.0.110/cgi-bin/selectsubchannel
http://192.168.0.110/cgi-bin/setscreen
http://192.168.0.110
http://192.168.0.110/cgi-bin/setconfigusb
http://192.168.0.110/cgi-bin/setconfighdd
http://192.168.0.110/cgi-bin/getpmt
http://192.168.0.110/cgi-bin/geteit
http://192.168.0.110/cgi-bin/message
http://192.168.0.110/control/message
http://192.168.0.110/cgi-bin/xmessage

http://192.168.0.110/audio.m3u
http://192.168.0.110/version
http://192.168.0.110/header
http://192.168.0.110/body
http://192.168.0.110/blank
http://192.168.0.110/cgi-bin/getcurrentepg
http://192.168.0.110/getcurrentepg2
http://192.168.0.110/getmultiepg
http://192.168.0.110/cgi-bin/streaminfo
http://192.168.0.110/cgi-bin/channelinfo
http://192.168.0.110/channels/getcurrent
http://192.168.0.110/cgi-bin/reloadsettings
http://192.168.0.110/cgi-bin/reloadrecordings
http://192.168.0.110/cgi-bin/saverecordings
http://192.168.0.110/cgi-bin/deletemovie
http://192.168.0.110/cgi-bin/reloadplaylist
http://192.168.0.110/cgi-bin/saveplaylist
http://192.168.0.110/cgi-bin/reloaduserbouquets
http://192.168.0.110/cgi-bin/saveuserbouquets
http://192.168.0.110/cgi-bin/reloadtimerlist
http://192.168.0.110/cgi-bin/savetimerlist
http://192.168.0.110/cgi-bin/startplugin
http://192.168.0.110/cgi-bin/stopplugin
http://192.168.0.110/cgi-bin/osdshot
http://192.168.0.110/cgi-bin/currentservice
http://192.168.0.110/cgi-bin/currenttransponderservices
http://192.168.0.110/cgi-bin/setfakerecordingstate

http://192.168.0.110/control/zapto
http://192.168.0.110/control/getonidsid
http://192.168.0.110/control/channellist

the information for dbox2 neutrino webcontroll
Quote:http://dbox/control/channellist
http://dbox/control/epg
http://dbox/control/shutdown
http://dbox/control/standby
http://dbox/control/volume
http://dbox/control/zapto
http://dbox/control/setmode
http://dbox/control/getmode
http://dbox/control/getdate
http://dbox/control/gettime
http://dbox/control/info
http://dbox/control/getonidsid
http://dbox/control/getservicesxml
http://dbox/control/getbouquetsxml
http://dbox/control/getbouquets
http://dbox/control/getbouquet
http://dbox/control/message
http://dbox/control/timer

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #16
1. i send the changes for mplayer.cpp to cvs

script to switch [zap] to the channel and stream it..


Quote:############################################################
# xbmc dreambox-tv v0.1 [geminiserver]
#
# informations:
# zapto:
# 192.168.0.110/cgi-bin/zapto?path=1:0:1:6dca:44d:1:c00000:0:0:0:
############################################################

import urllib, time, xbmc, xbmcgui
from htmlparser import htmlparser

action_previous_menu = 10
action_select_item = 7

url = 'http://192.168.0.110' # this ist the ip adress from dreambox
port = ':31339' # this is the port to stream from
zapcod = '/cgi-bin/zapto?path=' # this si the url zap code to initialize the zap

zapch = '1:0:1:6d66:437:1:c00000:0:0:0:' # this is the channel to zap in
vpid = '6e' # this is the vpid from switched channel
apid = '78' # this is the apid from switched channel

#zap to the channel
urlzap = url+zapcod+zapch
fp = urllib.urlopen(urlzap)
data = fp.read()
fp.close()

# play the zapped channel
file = url+port+'/'+vpid+','+apid
xbmc.player().play(file)

py download: dreambox_playtest.py
for this script you need to edit the vpid, apid, the channel.. currently.. i will implement the rest.. after i study the python scripting tech Wink

here are some screen shot streaming from the dreambox
[Image: screenshot001.gif]

[Image: screenshot002.gif]

[Image: screenshot003.gif]



next todo:
1. get and build complete channel list

i need also one who can verifie this for dbox! so guys with dbox2.. send me am mail "melih@gmx.li" or pm me

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
kaisersose Offline
Member
Posts: 70
Joined: Apr 2004
Reputation: 0
Post: #17
great work geminiserver, it looks great.

with my router, the ip for the dreambox is 192.168.1.4 and i take it that the channel you are using is zdf from 19e and not 13e. so would the script just have to be changed to this for me or am i totally wrong and there is other stuff that has to be changed( anyways the script just runs and stops) :

here is the error that comes up when i press the white button after the script stops:
ioerror: [ermo(? cant make it out) socket error] (10061, " connection refused")

also theres no apid for zdf on 19e at the moment according to my dreambox, so what should i put in instead)


############################################################
# xbmc dreambox-tv v0.1 [geminiserver]
#
# informations:
# zapto: 192.168.1.4/cgi-bin/zapto?path=
#
# service reference: 1:0:1:6dca:44d:1:c00000:0:0:0:
# reftype:refflags:dvb_service_type:dvb_service_id:dvb_transportstream_id
# :dvb_original_network_id:dvb_namespace:unused:unused:unused
############################################################

import urllib, time, xbmc, xbmcgui
from htmlparser import htmlparser

action_previous_menu = 10
action_select_item = 7

url    = 'http://192.168.1.4' # this ist the ip adress from dreambox
port   = ':31339'   # this is the port to stream from
zapcod = '/cgi-bin/zapto?path=' # this si the url zap code to initialize the zap

zapch  = '1:0:1:6d66:437:1:c00000:0:0:0:' # this is the channel to zap in
vpid   = '6e' # this is the vpid from switched channel
apid   = '78'   # this is the apid from switched channel

#zap to the channel
urlzap = url+zapcod+zapch
fp = urllib.urlopen(urlzap)
data = fp.read()
fp.close()

# play the zapped channel
file = url+port+'/'+vpid+','+apid
xbmc.player().play(file)


any info on what i am doing wrong would be much appreciated.

ps: probably a stupid question but would it be ever possible to record the stream on to the xbox hardrive as i dont have a harddrive for my dreambox!
find quote
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #18
hi,
the mplayer change is on cvs, i have verified the last cvs build and it works! so everbody should able to stream from dreambox and dbox2!

i have now write a little script, it only streams the current channle on dreambox, no ui no msg.. just stream to that zappen channel! this script does not zap to that channel, you need to do it manual over remote or web interface!

download here: dreambox-tv v0.23.py

here is the source:
Quote:################################################################
# xbmc geminiserver dreambox-tv v0.23
#
# informations:
# get the current stream info:
# http://192.168.0.110/cgi-bin/streaminfo?requester=webif
#
# set audiopid:
# http://192.168.0.110/cgi-bin/setaudio?audio="+audiopid
#
# zapto:
# 192.168.0.110/cgi-bin/zapto?path=1:0:1:6dca:44d:1:c00000:0:0:0:
#################################################################
# next to do:
# - is to make better vapid detection
# - receive all channels an bouquets
# - analyse an create the channel list..
# - create zapto
# - create ui
#
# comments:
# - this is my first python script guys..
# - if some one own a dreambox and good in python..
# he is welcome to help to create..
#
# installation:
# - copy this py to [xbmc]\scripts\dreambox-tv\*.*
# - 1. this script only stream the current running channel
# - 2. do not switch chnl on dreambox during streaming
# - 3. some chnls can't be stream [don't know why!! dream bug!]
#################################################################

import xbmc, xbmcgui, os, urllib, time, string, stringio, re
from htmlparser import htmlparser

# please add here your dreambox settings
ip = '192.168.0.110'
user = 'root'
password = 'dreambox'

# xbmc ui settings
action_previous_menu = 10
action_select_item = 7

#global settings
port = ':31339'
url = 'http://'+user+':'+password+'@'+ip
tmp_html = 'q:\\scripts\\dreambox-tv\\dreambox-tv.html'
#tmp_html = 'dreambox-tv.html'
tmp_line = 'q:\\scripts\\dreambox-tv\\new.txt'
#tmp_line = 'new.txt'
tmp_strm = 'q:\\scripts\\dreambox-tv\\dreambox-tv.strm'
#tmp_strm = 'dreambox-tv.strm'
flocvpid = 'vpid: 0x'
flocapid = 'apid: 0x'

# lets try to connect to the dreambox!
def tryopenurl(url):
try:
fp = urllib.urlopen(url)
data = fp.read()
fp.close()
start_stream(data)
except:
#message('unable to connect to the dreambox!')
print '\nunable to connect to the dreambox!'
print 'or there is another problem...'
return ''

def start_stream(data):
print '1.opening the dreambox url:'+url
# write the start page to the local file
fpx = open(tmp_html,'w')
fpx.write(data)
fpx.close()

print '2.created the tmp file: dreambox-tv.html'
# extract the information to a new file
f = open(tmp_html,'r')
o = open(tmp_line,'w')
newlines = []
for line in f:
while 'vpid' in line:
#print "gefunden \n"
newlines.append(line)
x = line
#print x
o.writelines(line)
break
f.close()
o.close()

print '3.finding the apid and vpid line'
# extract the vpid and apid locations
o = open(tmp_line,'r')
a1 = o.readline()
cc = a1
locvpid = str(re.search(flocvpid, cc).span())
locapid = str(re.search(flocapid, cc).span())
o.seek(0)
a2 = o.readline()
o.close()

print '4.define the apid and vpid location'
# define the vpid and apid locations
locvpid_x = locvpid[1:4]
locvpid_y = locvpid[6:9]
locapid_x = locapid[1:4]
locapid_y = locapid[6:9]

print '5.define exact apid and vpid value'
# define the ecaxt vapid loc value
locvpid_y = int(locvpid_y)
locapid_y = int(locapid_y)

boost_dreambox_tv(a2,a2,locvpid_y,locapid_y)


# find and set the ecaxt vpid&apid value
def boost_dreambox_tv(f_vpid,f_apid,lvpid,lapid):
# this is for the latest dreambox web interface
lvpidy = int(lvpid) + 3
lvpidx = int(lvpid) + 2
if f_vpid[lvpidy] == '&':
fok_vpid = f_vpid[lvpid:lvpidy]
elif f_vpid[lvpidx] == '&':
fok_vpid = f_vpid[lvpid:lvpidx]
#this is for the older dreambox web interface!
elif f_vpid[lvpidy] == '<':
fok_vpid = f_vpid[lvpid:lvpidy]
elif f_vpid[lvpidx] == '<':
fok_vpid = f_vpid[lvpid:lvpidx]

lapidy = int(lapid) + 3
lapidx = int(lapid) + 2
if f_apid[lapidy] == '<':
fok_apid = f_apid[lapid:lapidy]
elif f_apid[lapidx] == '<':
fok_apid = f_apid[lapid:lapidx]

file = url+port+'/'+fok_vpid+','+fok_apid
print '6.got the vpid:'+fok_vpid
print '7.got the apid:'+fok_apid
print '\n\ncreated the play string \n-->'+file+'\nok! then lets try to stream!'
xbmc.player().play(file)

# just write the strm file.. only for testing!
print '\n\nwell the stream works.. \nthen lets write a sample stream file!'
print '\nregards\ngeminiserver;)'
strm = open(tmp_strm,'w')
strm.write(file)
strm.close()

# main!
tryopenurl(url)

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
kaisersose Offline
Member
Posts: 70
Joined: Apr 2004
Reputation: 0
Post: #19
im gettin this error:
('unable to connect to the dreambox!')
or there is another problem...'

any idea what the problem might be, i have the right ip settings for the dreambox anyways but im havent a clue what to do to get it workin now. is there some program i gotta have running on the dreambox first or something?
find quote
Mausman Offline
Junior Member
Posts: 33
Joined: Jun 2004
Reputation: 0
Post: #20
looks great and commplete, but..........
i ran the script and filled in the right ip and port and nothing!
it says for a second running but nothing.

does anyone know why ? i do have a cvs build 8-7-04

:kickass:
find quote
Post Reply