Beispiel #1
0
def play(url):

	iview_config = comm.get_config()
	auth = comm.get_auth(iview_config)
	p = classes.Program()
	p.parse_xbmc_url(url)

	try:
		# Playpath shoud look like this:
		# 	Akamai: mp4:flash/playback/_definst_/itcrowd_10_03_02
		playpath = auth['playpath_prefix'] + p.url
		if playpath.split('.')[-1] == 'mp4':
			playpath = 'mp4:' + playpath
	
		# Strip off the .flv or .mp4
		playpath = playpath.split('.')[0]
	
		# rtmp://cp53909.edgefcs.net/ondemand?auth=daEbjbeaCbGcgb6bedYacdWcsdXc7cWbDda-bmt0Pk-8-slp_zFtpL&aifp=v001 
		# playpath=mp4:flash/playback/_definst_/kids/astroboy_10_01_22 swfurl=http://www.abc.net.au/iview/images/iview.jpg swfvfy=true
		rtmp_url = "%s?auth=%s playpath=%s swfurl=%s swfvfy=true" % (auth['rtmp_url'], auth['token'], playpath, config.swf_url)
	
		listitem=xbmcgui.ListItem(label=p.get_list_title(), iconImage=p.thumbnail, thumbnailImage=p.thumbnail)
		listitem.setInfo('video', p.get_xbmc_list_item())
	
		xbmc.Player().play(rtmp_url, listitem)
	except:
		# user cancelled dialog or an error occurred
		d = xbmcgui.Dialog()
		d.ok('ABC iView Error', 'ABC iView encountered an error:', '  %s (%d) - %s' % (sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ]) )
		return None
		print "ERROR: %s (%d) - %s" % ( sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ], )
Beispiel #2
0
def fetch_program(url, execvp=False, dest_file=None):
	if dest_file is None:
		dest_file = get_filename(url)

	if dest_file is not '-':
		resume = os.path.isfile(dest_file)
	else:
		resume = False

	auth = comm.get_auth()

	ext = url.split('.')[-1]
	url = '.'.join(url.split('.')[:-1]) # strip the extension (.flv or .mp4)

	url = auth['playpath_prefix'] + url

	if ext == 'mp4':
		url = ''.join(('mp4:', url))

	return rtmpdump(
			auth['rtmp_url'],
			auth['rtmp_host'],
			auth['rtmp_app'] + '?auth=' + auth['token'],
			url,
			dest_file,
			resume,
			execvp
		)
Beispiel #3
0
def play(url):

	iview_config = comm.get_config()
	auth = comm.get_auth(iview_config)

	p = classes.Program()
	p.parse_xbmc_url(url)

	try:
		# Playpath shoud look like this:
		# 	Akamai: mp4:flash/playback/_definst_/itcrowd_10_03_02
		playpath = auth['playpath_prefix'] + p.url
		if playpath.split('.')[-1] == 'mp4':
			playpath = 'mp4:' + playpath
	
		# Strip off the .flv or .mp4
		playpath = playpath.split('.')[0]
	
		# rtmp://cp53909.edgefcs.net/ondemand?auth=daEbjbeaCbGcgb6bedYacdWcsdXc7cWbDda-bmt0Pk-8-slp_zFtpL&aifp=v001 
		# playpath=mp4:flash/playback/_definst_/kids/astroboy_10_01_22 swfurl=http://www.abc.net.au/iview/images/iview.jpg swfvfy=true
		rtmp_url = "%s?auth=%s playpath=%s swfurl=%s swfvfy=true" % (auth['rtmp_url'], auth['token'], playpath, config.swf_url)
	
		listitem=xbmcgui.ListItem(label=p.get_list_title(), iconImage=p.thumbnail, thumbnailImage=p.thumbnail)
		listitem.setInfo('video', p.get_xbmc_list_item())
	
		xbmc.Player().play(rtmp_url, listitem)
	except:
		# oops print error message
		d = xbmcgui.Dialog()
		message = utils.dialog_error("Unable to play video")
		d.ok(*message)
		utils.log_error();
Beispiel #4
0
def play(url):

    try:
        iview_config = comm.get_config()
        auth = comm.get_auth(iview_config)

        # We don't support Adobe HDS yet, Fallback to RTMP streaming server
        if auth['rtmp_url'].startswith('http://'):
            auth['rtmp_url'] = iview_config[
                'rtmp_url'] or config.akamai_fallback_server
            auth['playpath_prefix'] = config.akamai_playpath_prefix
            utils.log("Adobe HDS Not Supported, using fallback server %s" %
                      auth['rtmp_url'])

        p = classes.Program()
        p.parse_xbmc_url(url)

        # Playpath shoud look like this:
        # 	Akamai: mp4:flash/playback/_definst_/itcrowd_10_03_02
        playpath = auth['playpath_prefix'] + p.url
        if playpath.split('.')[-1] == 'mp4':
            playpath = 'mp4:' + playpath

        # Strip off the .flv or .mp4
        playpath = playpath.split('.')[0]

        # rtmp://cp53909.edgefcs.net/ondemand?auth=daEbjbeaCbGcgb6bedYacdWcsdXc7cWbDda-bmt0Pk-8-slp_zFtpL&aifp=v001
        # playpath=mp4:flash/playback/_definst_/kids/astroboy_10_01_22 swfurl=http://www.abc.net.au/iview/images/iview.jpg swfvfy=true
        rtmp_url = "%s?auth=%s playpath=%s swfurl=%s swfvfy=true" % (
            auth['rtmp_url'], auth['token'], playpath, config.swf_url)

        listitem = xbmcgui.ListItem(label=p.get_list_title(),
                                    iconImage=p.thumbnail,
                                    thumbnailImage=p.thumbnail)
        listitem.setInfo('video', p.get_xbmc_list_item())

        if hasattr(listitem, 'addStreamInfo'):
            listitem.addStreamInfo('audio', p.get_xbmc_audio_stream_info())
            listitem.addStreamInfo('video', p.get_xbmc_video_stream_info())

        xbmc.Player().play(rtmp_url, listitem)
    except:
        # oops print error message
        d = xbmcgui.Dialog()
        message = utils.dialog_error("Unable to play video")
        d.ok(*message)
        utils.log_error()
def play(url):

	try:
		iview_config = comm.get_config()
		auth = comm.get_auth(iview_config)

		# We don't support Adobe HDS yet, Fallback to RTMP streaming server
		if auth['rtmp_url'].startswith('http://'):
			auth['rtmp_url'] = iview_config['rtmp_url'] or config.akamai_fallback_server
			auth['playpath_prefix'] = config.akamai_playpath_prefix
			utils.log("Adobe HDS Not Supported, using fallback server %s" % auth['rtmp_url'])

		p = classes.Program()
		p.parse_xbmc_url(url)

		# Playpath shoud look like this:
		# 	Akamai: mp4:flash/playback/_definst_/itcrowd_10_03_02
		playpath = auth['playpath_prefix'] + p.url
		if playpath.split('.')[-1] == 'mp4':
			playpath = 'mp4:' + playpath
	
		# Strip off the .flv or .mp4
		playpath = playpath.split('.')[0]
	
		# rtmp://cp53909.edgefcs.net/ondemand?auth=daEbjbeaCbGcgb6bedYacdWcsdXc7cWbDda-bmt0Pk-8-slp_zFtpL&aifp=v001 
		# playpath=mp4:flash/playback/_definst_/kids/astroboy_10_01_22 swfurl=http://www.abc.net.au/iview/images/iview.jpg swfvfy=true
		rtmp_url = "%s?auth=%s playpath=%s swfurl=%s swfvfy=true" % (auth['rtmp_url'], auth['token'], playpath, config.swf_url)
	
		listitem=xbmcgui.ListItem(label=p.get_list_title(), iconImage=p.thumbnail, thumbnailImage=p.thumbnail)
		listitem.setInfo('video', p.get_xbmc_list_item())

		if hasattr(listitem, 'addStreamInfo'):
			listitem.addStreamInfo('audio', p.get_xbmc_audio_stream_info())
			listitem.addStreamInfo('video', p.get_xbmc_video_stream_info())
	
		xbmc.Player().play(rtmp_url, listitem)
	except:
		# oops print error message
		d = xbmcgui.Dialog()
		message = utils.dialog_error("Unable to play video")
		d.ok(*message)
		utils.log_error();
Beispiel #6
0
def fetch_program(url, execvp=False, dest_file=None):
    if dest_file is None:
        dest_file = get_filename(url)

    if dest_file is not '-':
        resume = os.path.isfile(dest_file)
    else:
        resume = False

    auth = comm.get_auth()

    ext = url.split('.')[-1]
    url = '.'.join(url.split('.')[:-1])  # strip the extension (.flv or .mp4)

    url = auth['playpath_prefix'] + url

    if ext == 'mp4':
        url = ''.join(('mp4:', url))

    return rtmpdump(auth['rtmp_url'], auth['rtmp_host'],
                    auth['rtmp_app'] + '?auth=' + auth['token'], url,
                    dest_file, resume, execvp)