def xbmc_proxy(version, label): """Proxy XBMC image to make it accessible from external networks.""" from maraschino.noneditable import server_address url = request.args['path'] if label != 'default': server = MediaServer.query.filter(MediaServer.label == label).first() xbmc_url = 'http://' if server.data["username"] and server.data["password"]: xbmc_url += '%s:%s@' % (server.data["username"], server.data["password"]) xbmc_url += '%s:%s' % (server.data["hostname"], server.data["port"]) else: xbmc_url = server_address() if version == 'eden': url = '%s/vfs/special://%s' % (xbmc_url, url) elif version == 'frodo': url = '%s/image/image://%s' % (xbmc_url, urllib.quote(url.encode('utf-8'), '')) elif version == 'plex': url = '%s%s' % (server_address(), url) img = StringIO.StringIO(urllib.urlopen(url).read()) return send_file(img, mimetype='image/jpeg')
def xbmc_proxy(version, url): from maraschino.noneditable import server_address if version == 'eden': url = '%s/vfs/special://%s' % (server_address(), url) elif version == 'frodo': url = '%s/image/image://%s' % (server_address(), urllib.quote(url.encode('utf-8'), '')) img = StringIO.StringIO(urllib.urlopen(url).read()) return send_file(img, mimetype='image/jpeg')
def xbmc_proxy(version, label): """Proxy XBMC image to make it accessible from external networks.""" from maraschino.noneditable import server_address url = request.args['path'] if label != 'default': server = XbmcServer.query.filter(XbmcServer.label == label).first() xbmc_url = 'http://' if server.username and server.password: xbmc_url += '%s:%s@' % (server.username, server.password) xbmc_url += '%s:%s' % (server.hostname, server.port) else: xbmc_url = server_address() if version == 'eden': url = '%s/vfs/special://%s' % (xbmc_url, url) elif version == 'frodo': url = '%s/image/image://%s' % (xbmc_url, urllib.quote(url.encode('utf-8'), '')) img = StringIO.StringIO(urllib.urlopen(url).read()) return send_file(img, mimetype='image/jpeg')
def xbmc_proxy(version, label): """Proxy XBMC image to make it accessible from external networks.""" from maraschino.noneditable import server_address url = request.args["path"] if label != "default": server = XbmcServer.query.filter(XbmcServer.label == label).first() xbmc_url = "http://" if server.username and server.password: xbmc_url += "%s:%s@" % (server.username, server.password) xbmc_url += "%s:%s" % (server.hostname, server.port) else: xbmc_url = server_address() if version == "eden": url = "%s/vfs/special://%s" % (xbmc_url, url) elif version == "frodo": url = "%s/image/image://%s" % (xbmc_url, urllib.quote(url.encode("utf-8"), "")) img = StringIO.StringIO(urllib.urlopen(url).read()) return send_file(img, mimetype="image/jpeg")