You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ import os import hashlib from resolveurl.lib import log_utils from resolveurl.lib.net import Net, get_ua # @UnusedImport # NOQA from resolveurl.lib import cache # @UnusedImport # NOQA from resolveurl.lib import kodi from resolveurl.lib import pyaes from random import choice logger = log_utils.Logger.get_logger() addon_path = kodi.get_path() plugins_path = os.path.join(addon_path, 'lib', 'resolveurl', 'plugins') profile_path = kodi.translate_path(kodi.get_profile()) settings_file = os.path.join(addon_path, 'resources', 'settings.xml') settings_path = os.path.join(addon_path, 'resources') addon_version = kodi.get_version() get_setting = kodi.get_setting set_setting = kodi.set_setting open_settings = kodi.open_settings has_addon = kodi.has_addon i18n = kodi.i18n # Supported video formats VIDEO_FORMATS = [ '.aac', '.asf', '.avi', '.flv', '.m4a', '.m4v', '.mka', '.mkv', '.mp4', '.mpeg', '.nut', '.ogg' ]
along with this program. If not, see <http://www.gnu.org/licenses/>. """ import functools from resolveurl.lib import log_utils import time import pickle import hashlib import os import shutil import six from resolveurl.lib import kodi logger = log_utils.Logger.get_logger(__name__) try: cache_path = kodi.translate_path(os.path.join(kodi.get_profile(), 'cache')) if not os.path.exists(cache_path): os.makedirs(cache_path) except Exception as e: logger.log('Failed to create cache: %s: %s' % (cache_path, e), log_utils.LOGWARNING) cache_enabled = kodi.get_setting('use_cache') == 'true' def reset_cache(): try: shutil.rmtree(cache_path) return True except Exception as e: logger.log('Failed to Reset Cache: %s' % (e), log_utils.LOGWARNING)