def do_GET(s):
		"""Respond to a GET request."""
		s.send_response(200)
		#s.send_header("Server", "Enigma2 Livestreamer")
		#s.send_header("Content-type", "text/html")
		s.end_headers()

		if KodiPlayer:
			url = resolver.resolveUrl(unquote(s.path[6:]).replace('&', '?', 1))
			listitem = xbmcgui.ListItem(path=url)
			listitem.setInfo(type="Video", infoLabels={"mediatype": "movie", "title": "LiveTV"})
			xbmc.Player().play(url, listitem)
			return
			
		quality = "best"
		try: 
			url, quality = player.GetStreamUrl(unquote(s.path[1:]))
		except Exception as ex:
			url = None
			xbmc.log("{0}".format(ex), 3)
			return

		try:
			Streamer(s.wfile, url, quality)
		except Exception as ex:
			xbmc.log("{0}".format(ex), 3)
			pass
Example #2
0
    def do_GET(s):
        """Respond to a GET request."""
        s.send_response(200)
        #s.send_header("Server", "Enigma2 Livestreamer")
        #s.send_header("Content-type", "text/html")
        s.end_headers()

        if KodiPlayer:
            url = resolver.resolveUrl(unquote(s.path[6:]).replace('&', '?', 1))
            listitem = xbmcgui.ListItem(path=url)
            listitem.setInfo(type="Video",
                             infoLabels={
                                 "mediatype": "movie",
                                 "title": "LiveTV"
                             })
            xbmc.Player().play(url, listitem)
            return

        quality = "best"
        try:
            url, quality = player.GetStreamUrl(unquote(s.path[1:]))
        except Exception as ex:
            url = None
            xbmc.log("{0}".format(ex), 3)
            return

        try:
            Streamer(s.wfile, url, quality)
        except Exception as ex:
            xbmc.log("{0}".format(ex), 3)
            pass
Example #3
0
def PlayChannel(url, name, iconimage, description, categoryID):
	url = resolver.resolveUrl(url)
	if url is None:
		xbmc.log("Cannot resolve stream URL for channel '{0}'".format(urllib.unquote_plus(name)), 3)
		xbmc.executebuiltin("Notification({0}, Cannot resolve stream URL for channel '[COLOR {1}][B]{2}[/B][/COLOR]', {3}, {4})".format(AddonName, Addon.getSetting("chColor"), urllib.unquote_plus(name), 5000, __icon2__))
		return False
	
	channelName, programmeName = GetPlayingDetails(urllib.unquote_plus(name), categoryID)

	listItem = xbmcgui.ListItem(path=url)
	listItem.setInfo(type="Video", infoLabels={"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": "0", "season": "0"})
	if iconimage is not None:
		try:
			listItem.setArt({'thumb' : iconimage})
		except:
			listItem.setThumbnailImage(iconimage)
	
	xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=listItem)
	return True
Example #4
0
def PlayChannel(url, name, iconimage, categoryID):
    url = resolver.resolveUrl(url)
    if url is None:
        xbmc.log(
            "Cannot resolve stream URL for channel '{0}'".format(
                urllib.unquote_plus(name)), 3)
        xbmc.executebuiltin(
            "Notification({0}, Cannot resolve stream URL for channel '[COLOR {1}][B]{2}[/B][/COLOR]', {3}, {4})"
            .format(AddonName, Addon.getSetting("chColor"),
                    urllib.unquote_plus(name), 5000, __icon2__))
        return False

    channelName, programmeName, description = GetPlayingDetails(
        urllib.unquote_plus(name), categoryID)

    listItem = xbmcgui.ListItem(path=url)
    listItem.setInfo(type="Video",
                     infoLabels={
                         "mediatype": "movie",
                         "studio": channelName,
                         "title": programmeName,
                         "plot": description,
                         "tvshowtitle": channelName,
                         "episode": "0",
                         "season": "0"
                     })
    if iconimage is not None:
        try:
            listItem.setArt({'thumb': iconimage})
        except:
            listItem.setThumbnailImage(iconimage)

    xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]),
                              succeeded=True,
                              listitem=listItem)
    return True