This commit is contained in:
Gustavo 2018-03-31 01:05:46 -03:00
parent 4d944396b8
commit 9acc47cc76
2 changed files with 11 additions and 6 deletions

View file

@ -18,8 +18,6 @@ addon = xbmcaddon.Addon()
addon_base_path = xbmc.translatePath(addon.getAddonInfo('profile')).decode('utf-8')
xbmcplugin.setContent(addon_handle, "files")
os.environ['LD_LIBRARY_PATH'] = "/usr/lib:/lib:" + addon.getAddonInfo("path") + "/lib"
def build_url(query):
return base_url + "?" + urllib.urlencode(query)

View file

@ -46,10 +46,17 @@ class _HTTP_DATA(ctypes.Structure):
_fields_ = [("memory", ctypes.POINTER(ctypes.c_ubyte)),
("size", ctypes.c_size_t)]
def findlib(name):
libdirs = os.environ['LD_LIBRARY_PATH'].split(':')
for dir in libdirs:
for file in os.listdir(dir):
if file.find(name) != -1:
return os.path.join(dir, file)
class LibGameStream:
def __init__(self, libpath = ""):
self.commonlib = ctypes.cdll.LoadLibrary(os.path.join(libpath, "libmoonlight-common.so.2"))
self.gslib = ctypes.cdll.LoadLibrary(os.path.join(libpath, "libgamestream.so.2"))
self.commonlib = ctypes.cdll.LoadLibrary(findlib("libmoonlight-common.so"))
self.gslib = ctypes.cdll.LoadLibrary(findlib("libgamestream.so"))
self.connected = False
self.address = ""
self.key_dir = ""