Esempio n. 1
0
def PLAY_RTE(name, url, iconimage):
    name = htmlcleaner.cleanUnicode(name)
    if 'feeds' in url:

        link = OPEN_URL(url)
        URL = re.compile('media:content url="(.+?)"').findall(link)[0]
        import F4MProxy
        player = F4MProxy.f4mProxyHelper()
        player.playF4mLink(URL, name, iconimage)

    else:
        if 'f4m' in url:
            import F4MProxy
            player = F4MProxy.f4mProxyHelper()
            player.playF4mLink(url, name, iconimage)
        else:
            select = []
            returned = []
            r = 'http://www.rte.ie/manifests/%s.f4m' % url
            html = OPEN_URL(r)
            match = re.compile('href=".+?-(.+?)\.f4m"').findall(html)
            for i in match:
                select.append(i + 'P')
                returned.append(i)

            link = (returned[xbmcgui.Dialog().select('Please Select', select)])
            stream = 'http://cdn.rasset.ie/hls-live/_definst_/%s/%s-%s.m3u8' % (
                url, url, link)
            liz = xbmcgui.ListItem(name,
                                   iconImage='DefaultVideo.png',
                                   thumbnailImage=iconimage)
            liz.setInfo(type='Video', infoLabels={'Title': name})
            liz.setProperty("IsPlayable", "true")
            liz.setPath(stream)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Esempio n. 2
0
def PLAY_RTE(name,url,iconimage):
   
    if 'feeds' in url:
        print url
        link=OPEN_URL(url)
        URL=re.compile('media:content url="(.+?)"').findall(link)[0]
        import F4MProxy
        player=F4MProxy.f4mProxyHelper()
        player.playF4mLink(URL, name)
                     

    else:
        if 'f4m' in url:
            import F4MProxy
            player=F4MProxy.f4mProxyHelper()
            player.playF4mLink(url, name)
        else:
            select=[]
            returned=[]
            r='http://www.rte.ie/manifests/%s.f4m'%url
            html=OPEN_URL(r)
            match=re.compile('href=".+?-(.+?)\.f4m"').findall(html)
            for i in match:
                select.append(i+'P')
                returned.append(i)
                
            link=(returned[xbmcgui.Dialog().select('Please Select', select)])
            stream='http://cdn.rasset.ie/hls-live/_definst_/%s/%s-%s.m3u8' %(url,url,link)
            liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage)
            liz.setInfo(type='Video', infoLabels={'Title':name})
            liz.setProperty("IsPlayable","true")
            liz.setPath(stream+'|User-Agent=Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4')
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Esempio n. 3
0
def PLAY_STREAM(name,url,iconimage):
  
    if '.f4m' in url:
        import F4MProxy
        player=F4MProxy.f4mProxyHelper()
        player.playF4mLink(url, name)
        
    else:    
        liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage)
        liz.setInfo(type='Video', infoLabels={'Title':name})
        liz.setProperty("IsPlayable","true")
        liz.setPath(url)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Esempio n. 4
0
def PLAY_STREAM(name, url, iconimage):

    if '.f4m' in url:
        import F4MProxy
        player = F4MProxy.f4mProxyHelper()
        player.playF4mLink(url, name)

    else:
        liz = xbmcgui.ListItem(name,
                               iconImage='DefaultVideo.png',
                               thumbnailImage=iconimage)
        liz.setInfo(type='Video', infoLabels={'Title': name})
        liz.setProperty("IsPlayable", "true")
        liz.setPath(url)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Esempio n. 5
0
def PLAY_STREAM(name, url, iconimage):
    if len(url) > 4:
        liz = xbmcgui.ListItem(name,
                               iconImage="DefaultVideo.png",
                               thumbnailImage=iconimage)
        liz.setInfo(type="Video",
                    infoLabels={"Title": name.replace('Live', '')})
        liz.setProperty("IsPlayable", "true")
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(url, liz)
        xbmc.Player(xbmc.PLAYER_CORE_MPLAYER).play(pl)
    else:
        SoapMessage = TEMPLATE(url, 'itv' + url.replace('sim', ''))
        headers = {
            'Content-Length':
            '%d' % len(SoapMessage),
            'Content-Type':
            'text/xml; charset=utf-8',
            'Host':
            'mercury.itv.com',
            'Origin':
            'http://www.itv.com',
            'Referer':
            'http://www.itv.com/Mercury/Mercury_VideoPlayer.swf?v=null',
            'SOAPAction':
            "http://tempuri.org/PlaylistService/GetPlaylist",
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'
        }
        res, response = http.request(
            "http://mercury.itv.com/PlaylistService.svc?wsdl",
            'POST',
            headers=headers,
            body=SoapMessage)
        #print response
        #try:
        rtmp = response.split('ManifestFile')[1]
        STREAM = re.compile('\[CDATA\[(.+?)]').findall(rtmp)[0]
        import F4MProxy
        player = F4MProxy.f4mProxyHelper()
        player.playF4mLink(STREAM, name)
Esempio n. 6
0
def PLAY_STREAM(name, url, iconimage):
    if len(url) > 4:
        liz = xbmcgui.ListItem(
            name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        liz.setInfo(
            type="Video", infoLabels={"Title": name.replace('Live', '')})
        liz.setProperty("IsPlayable", "true")
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(url, liz)
        xbmc.Player(xbmc.PLAYER_CORE_MPLAYER).play(pl)
    else:
        SoapMessage = TEMPLATE(url, 'itv' + url.replace('sim', ''))
        headers = {
            'Content-Length':
            '%d' % len(SoapMessage),
            'Content-Type':
            'text/xml; charset=utf-8',
            'Host':
            'mercury.itv.com',
            'Origin':
            'http://www.itv.com',
            'Referer':
            'http://www.itv.com/Mercury/Mercury_VideoPlayer.swf?v=null',
            'SOAPAction':
            "http://tempuri.org/PlaylistService/GetPlaylist",
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'
        }
        res, response = http.request(
            "http://mercury.itv.com/PlaylistService.svc?wsdl",
            'POST',
            headers=headers,
            body=SoapMessage)
        #print response
        #try:
        rtmp = response.split('ManifestFile')[1]
        STREAM = re.compile('\[CDATA\[(.+?)]').findall(rtmp)[0]
        import F4MProxy
        player = F4MProxy.f4mProxyHelper()
        player.playF4mLink(STREAM, name)