'Next page': 30010,
    'Type not suported': 30011,
    'Video not located': 30012,
    'Previous page': 30013,
    'All videos': 30014,
    'Search': 30015,
}

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag)


def get_located_string(string_name):
    """This function returns the localized string if it is available."""
    return translation(localized_strings.get(string_name)).encode(
        'utf-8'
    ) or string_name if string_name in localized_strings else string_name


# Entry point
def run():
    """This function is the entry point to the add-on.
    It gets the add-on parameters and call the 'action' function.
    """
        'Next page'         : 30010,
        'Type not suported' : 30011,
        'Video not located' : 30012,
        'Previous page'     : 30013,
        'All videos'        : 30014,
        'Search'            : 30015,
        }

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag, p.log)

st_release = settings.getSetting('version')
current_release = settings.getAddonInfo('version')
update_settings = False

# This is to make it sure that settings are correctly setup on every addon
# update if required or on first time of update settings either.
if not st_release:
    p.log("ltl Warning: First run of update settings.")
    settings.openSettings()
    settings.setSetting('version', current_release)
elif st_release != current_release:
    p.log("ltl Warning: updated release. Check for update settings.")
    if update_settings: