Пример #1
0
def browse_repository():
	from libs import github
	xml = github.browse_repository(kodi.arg('url'))
	heading = "%s/%s" % (kodi.arg('full_name'), kodi.arg('file'))
	options = []
	if xml:
		for addon in xml.findAll('addon'):
			options.append("%s (%s)" % (addon['name'], addon['version']))

		kodi.dialog_select(heading, sorted(options))


@kodi.register('history_delete')
def history_delete():
	if not kodi.arg('id'): return
	from libs.database import DB
	DB.execute("DELETE FROM search_history WHERE search_id=?", [kodi.arg('id')])
	DB.commit()	
	kodi.refresh()

@kodi.register('update_addons')
def update_addons():
	from libs import github_installer
	quiet = True if kodi.arg('quiet') == 'quiet' else False
	if not quiet:
		c = kodi.dialog_confirm("Confirm Update", "Check for updates", yes="Update", no="Cancel")
		if not c: return
	github_installer.update_addons(quiet)
	
if __name__ == '__main__': kodi.run()
Пример #2
0
    for r in scrapecore.get_installed_resources():
        kodi.add_menu_item({
            'mode': 'void',
        }, {'title': r['name']}, icon='')
    kodi.eod()


@kodi.register('rebuild_settings')
def rebuild_settings():
    scrapecore.write_settings_file()
    kodi.notify('Success', 'Settings File Written')


@kodi.register('auth_realdebrid')
def auth_realdebrid():
    from commoncore import realdebrid
    realdebrid.authorize()


@kodi.register('toggle_scraper')
def toggle_scraper():
    if kodi.get_setting(kodi.arg('service') + '_enable') == 'true':
        kodi.set_setting(kodi.arg('service') + '_enable', 'false')
    else:
        kodi.set_setting(kodi.arg('service') + '_enable', 'true')
    kodi.refresh()


if __name__ == '__main__':
    kodi.run()
Пример #3
0
def browse_repository():
	from libs import github
	xml = github.browse_repository(kodi.arg('url'))
	heading = "%s/%s" % (kodi.arg('full_name'), kodi.arg('file'))
	options = []
	if xml:
		for addon in xml.findAll('addon'):
			options.append("%s (%s)" % (addon['name'], addon['version']))

		kodi.dialog_select(heading, sorted(options))


@kodi.register('history_delete')
def history_delete():
	if not kodi.arg('id'): return
	from libs.database import DB
	DB.execute("DELETE FROM search_history WHERE search_id=?", [kodi.arg('id')])
	DB.commit()	
	kodi.refresh()

@kodi.register('update_addons')
def update_addons():
	from libs import github_installer
	quiet = True if kodi.arg('quiet') == 'quiet' else False
	if not quiet:
		c = kodi.dialog_confirm("Confirm Update", "Check for updates", yes="Update", no="Cancel")
		if not c: return
	github_installer.update_addons(quiet)
	
if __name__ == '__main__': kodi.run()