def main(): show_about() kodi.add_menu_item({'mode': 'search_menu', 'type': "username", 'title': "Search by GitHub Username"}, {'title': "Search by GitHub Username"}, icon='username.png') kodi.add_menu_item({'mode': 'search_menu', 'type': "repository", 'title': "Search by GitHub Repository Title"}, {'title': "Search by GitHub Repository Title"}, icon='repository.png') kodi.add_menu_item({'mode': 'search_menu', 'type': "addonid",'title': "Search by Addon ID"}, {'title': "Search by Addon ID"}, icon='addonid.png') kodi.add_menu_item({'mode': 'update_addons'}, {'title': "Check for Updates"}, icon='update.png', visible=kodi.get_setting('enable_updates') == 'true') kodi.add_menu_item({'mode': 'about'}, {'title': "About GitHub Installer"}, icon='about.png') kodi.add_menu_item({'mode': 'addon_settings'}, {'title': "Tools and Settings"}, icon='settings.png') kodi.eod()
def search_menu(): from libs.database import DB kodi.add_menu_item({'mode': 'void'}, {'title': "[COLOR darkorange]%s[/COLOR]" % kodi.arg('title')}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type')}, {'title': "*** New Search ***"}, icon='null') results = DB.query_assoc("SELECT search_id, query FROM search_history WHERE search_type=? ORDER BY ts DESC LIMIT 10", [kodi.arg('type')], silent=True) if results is not None: for result in results: menu = kodi.ContextMenu() menu.add('Delete from search history', {"mode": "history_delete", "id": result['search_id']}) kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type'), 'query': result['query']}, {'title': result['query']}, menu=menu, icon='null') kodi.eod()
def search_menu(): from libs.database import DB kodi.add_menu_item({'mode': 'void'}, {'title': "[COLOR darkorange]%s[/COLOR]" % kodi.arg('title')}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type')}, {'title': "*** New Search ***"}, icon='null') results = DB.query_assoc("SELECT search_id, query FROM search_history WHERE search_type=? ORDER BY ts DESC LIMIT 10", [kodi.arg('type')], silent=True) if results is not None: for result in results: menu = kodi.ContextMenu() menu.add('Delete from search history', {"mode": "history_delete", "id": result['search_id']}) kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type'), 'query': result['query']}, {'title': result['query']}, menu=menu, icon='null') kodi.eod()
def addonuri(): kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'covenantkodi'}, {'title': '[COLOR darkorange]Covenant[/COLOR] - by covenantkodi'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'Iceballs'}, {'title': '[COLOR darkorange]IceFilms[/COLOR] - by Iceballs'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'kodibae'}, {'title': '[COLOR darkorange]Exodus[/COLOR] - by kodibae'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'OpenELEQ'}, {'title': '[COLOR darkorange]Elysium[/COLOR] - by OpenELEQ'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'teverz'}, {'title': '[COLOR darkorange]Placenta & Neptune[/COLOR] - by teverz'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'gaiaorigin'}, {'title': '[COLOR darkorange]Gaia[/COLOR] - by gaiaorigin'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'nixgates'}, {'title': '[COLOR darkorange]Incursion[/COLOR] - by nixgates'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'biglad'}, {'title': '[COLOR darkorange]SportsDevil[/COLOR] - by biglad'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'midraal'}, {'title': '[COLOR darkorange]Bob[/COLOR] - by midraal'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'trailerpark'}, {'title': '[COLOR darkorange]Bubbles[/COLOR] - by trailerpark'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'CypherMediaGIT'}, {'title': '[COLOR darkorange]Rebirth[/COLOR] - by CypherMediaGIT'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'xngsrs'}, {'title': '[COLOR darkorange]Sarsaila Repo[/COLOR] (RO)'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'addonid', 'query': 'plugin.video.streams'}, {'title': '[COLOR darkorange]Streams[/COLOR] - by moromete (RO)'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'addonid', 'query': 'plugin.video.digi-online'}, {'title': '[COLOR darkorange]Digi Online[/COLOR] - by dexterke (RO)'}, icon='null') kodi.eod()
def users(): kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'iwannabelikemike'}, {'title': 'iwannabelikemike'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'teverz'}, {'title': 'teverz'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'biglad'}, {'title': 'biglad'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'mullafabz'}, {'title': 'mullafabz'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'alkiber'}, {'title': 'alkiber'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'spinztv'}, {'title': 'spinztv'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'mhancoc7'}, {'title': 'mhancoc7'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'kodibae'}, {'title': 'kodibae'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'tvaddonsco'}, {'title': 'tvaddonsco'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'redhood36'}, {'title': 'redhood36'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'nemesis668'}, {'title': 'nemesis668'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'jsergio123'}, {'title': 'jsergio123'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'Andorth'}, {'title': 'Andorth'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'Dev-kong'}, {'title': 'Dev-kong'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'midraal'}, {'title': 'midraal'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'TheKnifeRepo'}, {'title': 'TheKnifeRepo'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'rvermaat'}, {'title': 'rvermaat'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'blackstar3000'}, {'title': 'blackstar3000'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'crazyxbmc'}, {'title': 'crazyxbmc'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'nixgates'}, {'title': 'nixgates'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'goliath-evolve'}, {'title': 'goliath-evolve'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'MrBlamo420'}, {'title': 'MrBlamo420'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'kayaaron13'}, {'title': 'kayaaron13'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'Shepo6'}, {'title': 'Shepo6'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'LReylist'}, {'title': 'LReylist'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'tkey3'}, {'title': 'tkey3'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'tony5856'}, {'title': 'tony5856'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'familyrep'}, {'title': 'familyrep'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'ttmediav1'}, {'title': 'ttmediav1'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'BludhavenGrayson'}, {'title': 'BludhavenGrayson'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'intrcomp'}, {'title': 'intrcomp'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'TheBeautifulMonkey'}, {'title': 'TheBeautifulMonkey'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'teamrepomonster'}, {'title': 'teamrepomonster'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'kodil'}, {'title': 'kodil'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'GandelfsRepo'}, {'title': 'GandelfsRepo'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'fluxustv'}, {'title': 'fluxustv'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'illuminatitemple'}, {'title': 'illuminatitemple'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'elgatito'}, {'title': 'elgatito'}, icon='null') kodi.add_menu_item({'mode': 'search', 'type': 'username', 'query': 'koying'}, {'title': 'koying'}, icon='null') kodi.eod()
def search(): from libs.database import DB from libs import github_api from libs.github_api import re_repository q = kodi.arg('query') if kodi.arg('query') else kodi.dialog_input('Search GitHub') if q in [None, False, '']: return False DB.execute('INSERT INTO search_history(search_type, query) VALUES(?,?)', [kodi.arg('type'), q]) DB.commit() if kodi.arg('type') == 'username': rtype = 'api' response = github_api.find_zips(q) if response is None: return for r in github_api.sort_results(response['items']): url = github_api.content_url % (r['repository']['full_name'], r['path']) menu = kodi.ContextMenu() if re_repository.search(r['name']): menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}) kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null') kodi.eod() elif kodi.arg('type') == 'repository': rtype = 'api' results = github_api.search(q, 'title') if results is None: return for i in results['items']: user = i['owner']['login'] response = github_api.find_zips(user) if response is None: continue for r in github_api.sort_results(response['items']): url = github_api.content_url % (r['repository']['full_name'], r['path']) menu = kodi.ContextMenu() if re_repository.search(r['name']): menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}) kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null') kodi.eod() elif kodi.arg('type') == 'addonid': rtype = 'web' results = github_api.web_search(q) if results is None: return for r in results['items']: kodi.add_menu_item({'mode': 'github_install', "user": r['owner']['login'], "repo": r['name'], "rtype": rtype}, {'title': "%s/%s" % (r['owner']['login'], r['name'])}, icon='null') kodi.eod()
def search(): from libs.database import DB from libs import github_api from libs.github_api import re_repository q = kodi.arg('query') if kodi.arg('query') else kodi.dialog_input('Search GitHub') if q in [None, False, '']: return False DB.execute('INSERT INTO search_history(search_type, query) VALUES(?,?)', [kodi.arg('type'), q]) DB.commit() if kodi.arg('type') == 'username': rtype = 'api' response = github_api.find_zips(q) if response is None: return for r in github_api.sort_results(response['items']): url = github_api.content_url % (r['repository']['full_name'], r['path']) menu = kodi.ContextMenu() if re_repository.search(r['name']): menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}) kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null') kodi.eod() elif kodi.arg('type') == 'repository': rtype = 'api' results = github_api.search(q, 'title') if results is None: return for i in results['items']: user = i['owner']['login'] response = github_api.find_zips(user) if response is None: continue for r in github_api.sort_results(response['items']): url = github_api.content_url % (r['repository']['full_name'], r['path']) menu = kodi.ContextMenu() if re_repository.search(r['name']): menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}) kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null') kodi.eod() elif kodi.arg('type') == 'addonid': rtype = 'web' results = github_api.web_search(q) if results is None: return for r in results['items']: kodi.add_menu_item({'mode': 'github_install', "user": r['owner']['login'], "repo": r['name'], "rtype": rtype}, {'title': "%s/%s" % (r['owner']['login'], r['name'])}, icon='null') kodi.eod()