def get_local_db_path(db_filename): # First ensure database folder exists from resources.lib.common import folder_exists db_folder = xbmcvfs.translatePath(os.path.join(G.DATA_PATH, 'database')) if not folder_exists(db_folder): xbmcvfs.mkdirs(db_folder) return os.path.join(db_folder, db_filename)
def get_local_db_path(db_filename): # First ensure database folder exists db_folder = G.py2_decode( xbmc.translatePath(os.path.join(G.DATA_PATH, 'database'))) if not folder_exists(db_folder): xbmcvfs.mkdirs(db_folder) return os.path.join(db_folder, db_filename)
def _get_cdm_file_path(): if common.get_system_platform() == 'linux': lib_filename = 'libwidevinecdm.so' elif common.get_system_platform() in ['windows', 'uwp']: lib_filename = 'widevinecdm.dll' elif common.get_system_platform() == 'osx': lib_filename = 'libwidevinecdm.dylib' # import ctypes.util # lib_filename = util.find_library('libwidevinecdm.dylib') else: lib_filename = None if not lib_filename: raise Exception( 'Widevine library filename not mapped for this operative system') # Get the CDM path from inputstream.adaptive (such as: ../.kodi/cdm) from xbmcaddon import Addon addon = Addon('inputstream.adaptive') cdm_path = xbmcvfs.translatePath(addon.getSetting('DECRYPTERPATH')) if not common.folder_exists(cdm_path): raise Exception(f'The CDM path {cdm_path} not exists') return common.join_folders_paths(cdm_path, lib_filename)
def _create_destination_folder(destination_folder): """Create destination folder, ignore error if it already exists""" if not common.folder_exists(destination_folder): xbmcvfs.mkdirs(destination_folder)