예제 #1
0
def github_install(url):
    import re
    import json
    from libs.github_installer import kodi as _kodi
    from libs import github_installer
    from libs.github_installer import github_api
    args = json.loads(url)
    if 'file' in args:
        #viewsetter.set_view("list")
        c = _kodi.dialog_confirm("Confirm Install", args['file'])
        if not c: return
        addon_id = re.sub("-[\d\.]+zip$", "", args['file'])
        github_installer.GitHub_Installer(addon_id, args['url'], args['full_name'], _kodi.vfs.join("special://home", "addons"))
        if not dialog.yesno(siteTitle, '                     Click Continue to install more addons or',
                            '                    Restart button to finalize addon installation',
                            "                          Brought To You By %s " % siteTitle,
                            nolabel='Restart', yeslabel='Continue'):
            xbmc.executebuiltin('ShutDown')
        #viewsetter.set_view("list")
    else:
        pass
예제 #2
0
def github_results(url):
    import json
    from libs import github_installer
    from libs.github_installer import github_api
    from libs.github_installer import kodi as _kodi
    args = json.loads(url)
    #viewsetter.set_view("list")
    if args['rtype'] == 'web':
        from libs.github_installer import kodi as _kodi
        full_name = "%s/%s" % (args['user'], args['repo'])
        c = _kodi.dialog_confirm("Confirm Install", full_name, yes="Install", no="Cancel")
        if not c: return
        url = "https://github.com/%s/%s/archive/master.zip" % (args['user'], args['repo'])
        Ins = github_installer.GitHub_Installer(args['repo'], url, full_name, _kodi.vfs.join("special://home", "addons"), True)
        return
    results = github_api.find_zips(args['user'], args['repo'])
    if results is None: return
    for r in results['items']:
        if r['repository']['name'] != args['repo']: continue
        url = github_api.content_url % (r['repository']['full_name'], r['path'])
        kodi.addItem(r['name'], json.dumps({'file': r['name'], "url": url, "full_name": r['repository']['full_name']}), 'github_install', '', description="")
예제 #3
0
def github_update():
    from libs import github_installer
    from libs.github_installer import kodi as _kodi
    c = _kodi.dialog_confirm("Confirm Update", "Search for updates?")
    if c : github_installer.update_addons()