def play(url, pathId=""): xbmc.log("Playing...") if pathId != "": xbmc.log("PathID: " + pathId) raiplay = RaiPlay() url = raiplay.getVideoUrl(pathId) # Handle RAI relinker if url[:53] == "http://mediapolis.rai.it/relinker/relinkerServlet.htm" or \ url[:56] == "http://mediapolisvod.rai.it/relinker/relinkerServlet.htm" or \ url[:58] == "http://mediapolisevent.rai.it/relinker/relinkerServlet.htm": xbmc.log("Relinker URL: " + url) relinker = Relinker() url = relinker.getURL(url) # Add the server to the URL if missing if url !="" and url.find("://") == -1: url = raiplay.baseUrl + url xbmc.log("Media URL: " + url) # It seems that all .ram files I found are not working # because upstream file is no longer present if url[-4:].lower() == ".ram": dialog = xbmcgui.Dialog() dialog.ok("Errore", "I file RealAudio (.ram) non sono supportati.") return # Play the item item=xbmcgui.ListItem(path=url + '|User-Agent=' + urllib.quote_plus(Relinker.UserAgent)) xbmcplugin.setResolvedUrl(handle=handle, succeeded=True, listitem=item)
def play(url, pathId=""): xbmc.log("Playing...") if pathId != "": xbmc.log("PathID: " + pathId) raiplay = RaiPlay() url = raiplay.getVideoUrl(pathId) # Handle RAI relinker if url[:53] == "http://mediapolis.rai.it/relinker/relinkerServlet.htm" or \ url[:56] == "http://mediapolisvod.rai.it/relinker/relinkerServlet.htm" or \ url[:58] == "http://mediapolisevent.rai.it/relinker/relinkerServlet.htm": xbmc.log("Relinker URL: " + url) relinker = Relinker() url = relinker.getURL(url) # Add the server to the URL if missing if url !="" and url.find("://") == -1: url = raiplay.baseUrl + url xbmc.log("Media URL: " + url) # It seems that all .ram files I found are not working # because upstream file is no longer present if url[-4:].lower() == ".ram": dialog = xbmcgui.Dialog() dialog.ok("Errore", "I file RealAudio (.ram) non sono supportati.") return # Play the item item=xbmcgui.ListItem(path=url) xbmcplugin.setResolvedUrl(handle=handle, succeeded=True, listitem=item)