from lib import kodi #from lib import pyaes import pyaes addon_path = kodi.get_path() plugins_path = os.path.join(addon_path, 'lib', 'urlresolver', 'plugins') profile_path = kodi.translate_path(kodi.get_profile()) settings_file = os.path.join(addon_path, 'resources', 'settings.xml') 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 RAND_UA = get_ua() IE_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko' FF_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0' OPERA_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36 OPR/34.0.2036.50' IOS_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25' ANDROID_USER_AGENT = 'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36' SMU_USER_AGENT = 'URLResolver for Kodi/%s' % (addon_version) def log_file_hash(path): try: with open(path, 'r') as f: py_data = f.read() except: py_data = ''
from lib import kodi from lib import pyaes logger = log_utils.Logger.get_logger() addon_path = kodi.get_path() plugins_path = os.path.join(addon_path, 'lib', 'urlresolver', 'plugins') profile_path = kodi.translate_path(kodi.get_profile()) settings_file = os.path.join(addon_path, 'resources', 'settings.xml') 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 RAND_UA = get_ua() IE_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko' FF_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' OPERA_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36 OPR/34.0.2036.50' IOS_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25' ANDROID_USER_AGENT = 'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36' SMU_USER_AGENT = 'URLResolver for Kodi/%s' % (addon_version) def log_file_hash(path): try: with open(path, 'r') as f: py_data = f.read() except: py_data = '' logger.log('%s hash: %s' % (os.path.basename(path), hashlib.md5(py_data).hexdigest()))