def main(argv=None): if sys.argv: argv = sys.argv queries = kodi.parse_query(sys.argv[2]) logger.log('Version: |%s| Queries: |%s|' % (kodi.get_version(), queries)) logger.log('Args: |%s|' % (argv)) # don't process params that don't match our url exactly. (e.g. plugin://plugin.video.1channel/extrafanart) plugin_url = 'plugin://%s/' % (kodi.get_id()) if argv[0] != plugin_url: return mode = queries.get('mode', None) url_dispatcher.dispatch(mode, queries)
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' ] # 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'