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:
        settings.openSettings()
    settings.setSetting('version', current_release)

# Gets the quality for videos from settings
try:
    quality = int(settings.getSetting('quality'))
except:
    settings.setSetting('quality', '2') # Sets the default quality to 480
    quality = 2 # Default value is bandwith conservative.
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)

# By default, both, the website and the add-on are setup to show only the best videos.
all_filter = '&quality=all' if settings.getSetting("show_best") == "false" else '&quality=best'
sort_param = '&sort=new' if settings.getSetting("views") == "false" else '&sort=views'

if all_filter == '&quality=all':
    p.log("ffa.main: 'all videos' filter is explicit setup.")

if sort_param == '&sort=views':
    p.log("ffa.main: sorted by views is explicit setup.")

def get_located_string(string_name):
    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():
    p.log("ffa.run")

    # Get params
    params = p.get_plugin_parms()
示例#3
0
        'Search'            : 30014,
        'Search result'     : 30015,
        }

p = Plugin(plugin_id)

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

debug_flag = settings.getSetting("debug") == "true"
all_programmes_flag = settings.getSetting("all_programmes") == "1"

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

p.log("rne %s flag is set" % {True : 'all_the_programmes', False : 'only_emission'}[all_programmes_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.
    """
    p.log("rne.run")

    # Get the params
示例#4
0
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)

# By default, both, the website and the add-on are setup to show only the best videos.
all_filter = '?c=all' if settings.getSetting("show_best") == "false" else ''

if all_filter:
    p.log("ffa.main: 'all videos' filter is explicit setup.")

def get_located_string(string_name):
    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():
    p.log("ffa.run")

    # Get params
    params = p.get_plugin_parms()

    if params.get("action") is None:
        create_index(params)
    else:
示例#5
0
    'Search result': 30015,
}

p = Plugin(plugin_id)

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

debug_flag = settings.getSetting("debug") == "true"
all_programmes_flag = settings.getSetting("all_programmes") == "1"

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

p.log("rne %s flag is set" % {
    True: 'all_the_programmes',
    False: 'only_emission'
}[all_programmes_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.
    """