def plugin_setup():
    global bible, book_to_index
    try:
        bible = json.loads(open(BIBLE_FILE, encoding='utf-8-sig').read())
        book_to_index = make_book_to_index(bible)
        return
    except BaseException as e:
        pass
    # We've tried nothing and we're all out of ideas, download a new bible.
    try:
        bible = json.loads(
            requests.get(BIBLE_URL).content.decode('utf-8-sig'))
    except BaseException as e:
        return "Error loading bible: " + str(e)
    book_to_index = make_book_to_index(bible)
    with open(BIBLE_FILE, 'w') as f:
        json.dump(bible, f)