Exemplo n.º 1
0
def index():
    try:
        providers_count = len(PROVIDERS['movie'])
        if not providers_count > 0:
            raise AnErrorOccurred(30315)

        if providers_count == 1:
            sys_kwargs = _get_kwargs()[1]
            item = call_provider(PROVIDERS['movie'][0]).catalogs(**sys_kwargs)
            plugin.redirect(
                plugin.url_for(
                    item.pop('endpoint'),
                    **_build_kwargs(item.pop("kwargs", {}), sys_kwargs,
                                    **{'provider': PROVIDERS['movie'][0]})))
        # If we have more end one provider we createt a provider index
        else:
            sys_kwargs = _get_kwargs()[1]
            for provider in PROVIDERS['movie']:
                item = call_provider(provider).catalogs(**sys_kwargs)
                item["path"] = plugin.url_for(
                    item.pop('endpoint'),
                    **_build_kwargs(item.pop("kwargs", {}), sys_kwargs,
                                    **{'provider': provider}))
                yield item
    except AnErrorOccurred as e:
        errorNotify(e.errno)
    except:
        errorNotify(30308)
Exemplo n.º 2
0
def search():
    try:
        query = plugin.keyboard("", __addon__.getLocalizedString(30001))
        if query:
            plugin.redirect(plugin.url_for("search_query", **_get_kwargs({'query': query, 'page': 1})[0]))
    except:
        errorNotify(30308)
Exemplo n.º 3
0
def search():
    try:
        query = plugin.keyboard("", __addon__.getLocalizedString(30001))
        if query:
            plugin.redirect(
                plugin.url_for("search_query",
                               **_get_kwargs({
                                   'query': query,
                                   'page': 1
                               })[0]))
    except:
        errorNotify(30308)
Exemplo n.º 4
0
def index():
    try:
        providers_count = len(PROVIDERS['movie'])
        if not providers_count > 0:
            raise AnErrorOccurred(30315)

        if providers_count == 1:
            sys_kwargs = _get_kwargs()[1]
            item = call_provider(PROVIDERS['movie'][0]).catalogs(**sys_kwargs)
            plugin.redirect(plugin.url_for(item.pop('endpoint'), **_build_kwargs(item.pop("kwargs", {}), sys_kwargs, **{'provider': PROVIDERS['movie'][0]})))
        # If we have more end one provider we createt a provider index
        else:
            sys_kwargs = _get_kwargs()[1]
            for provider in PROVIDERS['movie']:
                item = call_provider(provider).catalogs(**sys_kwargs)
                item["path"] = plugin.url_for(item.pop('endpoint'), **_build_kwargs(item.pop("kwargs", {}), sys_kwargs, **{'provider': provider}))
                yield item
    except AnErrorOccurred as e:
        errorNotify(e.errno)
    except:
        errorNotify(30308)