#############################################################################
# Al Jazeera HQ stream player
# 
# Requires good connection (~60kB/s)
#
# Stream used from
# http://english.aljazeera.net/watch_now/
#
# by stuart@linuxsecurity.co.nz
# 14/2/2009
# (not affiliated with Al Jazeera)

# some vars
URL="http://europarse.real.com/hurl/gratishurl.ram?pid=eu_aljazeera&file=al_jazeera_en_lo.rm"   ## This URL can be found embedded on http://english.aljazeera.net/watch_now/ it might change one day and break this

# code
import urllib
import xbmc, xbmcgui

request = urllib.urlopen(URL)
response = request.read().strip()
rtsp_url = response[:-41].replace("lo","hi")

listitem = xbmcgui.ListItem('Al Jazeera English')
listitem.setInfo('video', {'Title': 'Al Jazeera English', 'Genre': 'News'})

xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play( rtsp_url, listitem )

#xbmc.output(rtsp_url)

