def main(argv=None): if sys.argv: argv = sys.argv log_utils.log('Version: |%s|' % (kodi.get_version())) log_utils.log('Args: |%s|' % (argv)) path = xbmc.getInfoLabel('ListItem.FileNameAndPath') if not path: path = xbmc.getInfoLabel('ListItem.Path') if __is_salts_listitem(path): dialog = xbmcgui.Dialog() tools = __get_tools(path) ret = dialog.select('SALTS Tools', [i[0] for i in tools]) if ret > -1: tools[ret][1](*tools[ret][2]) else: kodi.notify(msg='Not a SALTS Library Item')
""" import os import hashlib from lib import log_utils from lib.net import Net, get_ua # @UnusedImport from lib import cache # @UnusedImport from lib import kodi from 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', '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 # Supported video formats VIDEO_FORMATS = [ '.aac', '.asf', '.avi', '.flv', '.m4a', '.m4v', '.mka', '.mkv', '.mp4', '.mpeg', '.nut', '.ogg' ] # RAND_UA = get_ua() IE_USER_AGENT = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' FF_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0'
along with this program. If not, see <http://www.gnu.org/licenses/>. """ import os import hashlib from lib import log_utils from lib.net import Net, get_ua # @UnusedImport from lib import cache # @UnusedImport 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):