コード例 #1
0
ファイル: base.py プロジェクト: OpenELEQ/meta4kodi
def search(search_func, term = None):
    """ Search wrapper """
    external = False
    if plugin.id == xbmc.getInfoLabel('Container.PluginName'):
        # Skip if search item isn't currently selected    
        label = xbmc.getInfoLabel('ListItem.label')
        if label and not equals(label, _("Search")):
            return
    else:
        external = True

    if term is None:
        # Get search keyword
        search_entered = plugin.keyboard(heading=_("search for"))
        if not search_entered:
            return

    else:
        search_entered = term
    # Perform search
    url = plugin.url_for(search_func, term=search_entered, page='1')
    if external:
        xbmc.executebuiltin('ActivateWindow(10025,"plugin://%s/",return)' % plugin.id)
        xbmc.executebuiltin('Container.Update("%s")' % url)
    else:
        plugin.redirect(url)
コード例 #2
0
ファイル: base.py プロジェクト: staycanuca/meta4kodi
def search(search_func, term=None):
    """ Search wrapper """
    external = False
    if plugin.id == xbmc.getInfoLabel('Container.PluginName'):
        # Skip if search item isn't currently selected
        label = xbmc.getInfoLabel('ListItem.label')
        if label and not equals(label, _("Search")):
            return
    else:
        external = True

    if term is None:
        # Get search keyword
        search_entered = plugin.keyboard(heading=_("search for"))
        if not search_entered:
            return

    else:
        search_entered = term
    # Perform search
    url = plugin.url_for(search_func, term=search_entered, page='1')
    if external:
        xbmc.executebuiltin('ActivateWindow(10025,"plugin://%s/",return)' %
                            plugin.id)
        xbmc.executebuiltin('Container.Update("%s")' % url)
    else:
        plugin.redirect(url)
コード例 #3
0
ファイル: updater.py プロジェクト: podgod/podgod
def update_players_remote(url):
    # Get username and password
    parsed = urlparse(url)
    username = parsed.username
    password = parsed.password
    if username is not None:
        if not password:
            password = plugin.keyboard(heading=_('Enter password'), hidden=True)
        if not password:
            return False        
        url = remove_auth(url)
        
    # Try without authentication            
    response = None
    try:
        response = urllib2.urlopen(url)
    except urllib2.HTTPError, e:
        if not username:
            return False
        url = e.geturl()
コード例 #4
0
def update_players_remote(url):
    # Get username and password
    parsed = urlparse(url)
    username = parsed.username
    password = parsed.password
    if username is not None:
        if not password:
            password = plugin.keyboard(heading=_('Enter password'), hidden=True)
        if not password:
            return False        
        url = remove_auth(url)
        
    # Try without authentication            
    response = None
    try:
        response = urllib2.urlopen(url)
    except urllib2.HTTPError, e:
        if not username:
            return False
        url = e.geturl()
コード例 #5
0
def tvdb_tv_search():
    """ Activate tv search """
    term = plugin.keyboard(heading=_("search for"))
    return tvdb_tv_search_term(term, 1)
コード例 #6
0
def music_search_track():
    term = plugin.keyboard(heading=_("Enter search string"))
    return music_search_track_term(term, 1)
コード例 #7
0
ファイル: default.py プロジェクト: vanhung1710/MyRepository
def root_search():
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return root_search_term(term)
    else: return
コード例 #8
0
def music_search_track():
    term = plugin.keyboard(heading=_("search for"))
    return music_search_track_term(term, 1)
コード例 #9
0
ファイル: music.py プロジェクト: vphuc81/MyRepository
def music_search_edit(term):
    term = plugin.keyboard(default=term, heading=_("Enter search string"))
    if term != None and term != "": return music_search_term(term, 1)
    else: return
コード例 #10
0
ファイル: music.py プロジェクト: noobsandnerds/noobsandnerds
def music_search_album():
    term = plugin.keyboard(heading=_("search for"))
    return music_search_album_term(term, 1)
コード例 #11
0
ファイル: lists.py プロジェクト: vphuc81/MyRepository
def lists_trakt_search_for_lists():
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return lists_search_for_lists_term(term, 1)
    else: return
コード例 #12
0
ファイル: addon.py プロジェクト: noobsandnerds/noobsandnerds
def root_search_term(term, page):
    if term == "None":
        # Get search keyword
        search_entered = plugin.keyboard(heading=_("search for"))
        if not search_entered:
            return
    else:
        search_entered = term
    items = [
        {
            "label": "All" + ": " + search_entered,
            "path": plugin.url_for(root_search_term, term=search_entered, page="1"),
            "icon": get_icon_path("search"),
        },
        {
            "label": _("Movies") + " - " + _("Search (Trakt)") + ": " + search_entered,
            "path": plugin.url_for("trakt_movies_search_term", term=search_entered, page="1"),
            "icon": get_icon_path("movies"),
        },
        {
            "label": _("Movies") + " - " + _("Search (TMDb)") + ": " + search_entered,
            "path": plugin.url_for("tmdb_movies_search_term", term=search_entered, page="1"),
            "icon": get_icon_path("movies"),
        },
        {
            "label": _("TV shows") + " - " + _("Search (Trakt)") + ": " + search_entered,
            "path": plugin.url_for("trakt_tv_search_term", term=search_entered, page="1"),
            "icon": get_icon_path("tv"),
        },
        {
            "label": _("TV shows") + " - " + _("Search (TMDb)") + ": " + search_entered,
            "path": plugin.url_for("tmdb_tv_search_term", term=search_entered, page="1"),
            "icon": get_icon_path("tv"),
        },
        {
            "label": _("TV shows") + " - " + _("Search (TVDb)") + ": " + search_entered,
            "path": plugin.url_for("tvdb_tv_search_term", term=search_entered, page="1"),
            "icon": get_icon_path("tv"),
        },
        {
            "label": _("Music") + " - " + _("Search artist") + ": " + search_entered,
            "path": plugin.url_for("music_search_artist_term", term=search_entered, page="1"),
            "icon": get_icon_path("music"),
        },
        {
            "label": _("Music") + " - " + _("Search album") + ": " + search_entered,
            "path": plugin.url_for("music_search_album_term", term=search_entered, page="1"),
            "icon": get_icon_path("music"),
        },
        {
            "label": _("Music") + " - " + _("Search track") + ": " + search_entered,
            "path": plugin.url_for("music_search_track_term", term=search_entered, page="1"),
            "icon": get_icon_path("music"),
        },
        {
            "label": _("Live") + " - " + _("Search") + ": " + search_entered,
            "path": plugin.url_for("live_search_term", term=search_entered),
            "icon": get_icon_path("live"),
        },
        {
            "label": _("Lists") + " - " + _("Search") + ": " + search_entered,
            "path": plugin.url_for("lists_search_for_lists_term", term=search_entered, page="1"),
            "icon": get_icon_path("lists"),
        },
    ]
    fanart = plugin.addon.getAddonInfo("fanart")
    for item in items:
        item["properties"] = {"fanart_image": get_background_path()}
    return items
コード例 #13
0
def tmdb_movies_search():
    """ Activate movie search """
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return tmdb_movies_search_term(term, 1)
    else: return
コード例 #14
0
def trakt_movies_search():
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return trakt_movies_search_term(term, 1)
    else: return
コード例 #15
0
ファイル: movies.py プロジェクト: noobsandnerds/noobsandnerds
def trakt_movies_search():
    term = plugin.keyboard(heading=_("search for"))
    return trakt_movies_search_term(term, 1)
コード例 #16
0
ファイル: music.py プロジェクト: vphuc81/MyRepository
def music_search_track():
    term = plugin.keyboard(heading=_("Enter search string"))
    return music_search_track_term(term, 1)
コード例 #17
0
ファイル: music.py プロジェクト: noobsandnerds/noobsandnerds
def music_search_track():
    term = plugin.keyboard(heading=_("search for"))
    return music_search_track_term(term, 1)
コード例 #18
0
def lists_trakt_search_for_lists():
    term = plugin.keyboard(heading=_("search for"))
    return lists_search_for_lists_term(term, 1)
コード例 #19
0
ファイル: default.py プロジェクト: vphuc81/MyRepository
def root_search():
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return root_search_term(term)
    else: return
コード例 #20
0
def music_search_album():
    term = plugin.keyboard(heading=_("search for"))
    return music_search_album_term(term, 1)
コード例 #21
0
ファイル: live.py プロジェクト: vphuc81/MyRepository
def live_search():
    """ Activate channel search """
    term = plugin.keyboard(heading=_("Enter search string"))
    return live_search_term(term)
コード例 #22
0
def root_search_term(term, page):
    if term == "None":
        # Get search keyword
        search_entered = plugin.keyboard(heading=_("search for"))
        if not search_entered:
            return
    else:
        search_entered = term
    items = [{
        'label':
        "All" + ": " + search_entered,
        'path':
        plugin.url_for(root_search_term, term=search_entered, page='1'),
        'icon':
        get_icon_path("search"),
    }, {
        'label':
        _("Movies") + " - " + _("Search (Trakt)") + ": " + search_entered,
        'path':
        plugin.url_for("trakt_movies_search_term",
                       term=search_entered,
                       page='1'),
        'icon':
        get_icon_path("movies"),
    }, {
        'label':
        _("Movies") + " - " + _("Search (TMDb)") + ": " + search_entered,
        'path':
        plugin.url_for("tmdb_movies_search_term",
                       term=search_entered,
                       page='1'),
        'icon':
        get_icon_path("movies"),
    }, {
        'label':
        _("TV shows") + " - " + _("Search (Trakt)") + ": " + search_entered,
        'path':
        plugin.url_for("trakt_tv_search_term", term=search_entered, page='1'),
        'icon':
        get_icon_path("tv"),
    }, {
        'label':
        _("TV shows") + " - " + _("Search (TMDb)") + ": " + search_entered,
        'path':
        plugin.url_for("tmdb_tv_search_term", term=search_entered, page='1'),
        'icon':
        get_icon_path("tv"),
    }, {
        'label':
        _("TV shows") + " - " + _("Search (TVDb)") + ": " + search_entered,
        'path':
        plugin.url_for("tvdb_tv_search_term", term=search_entered, page='1'),
        'icon':
        get_icon_path("tv"),
    }, {
        'label':
        _("Music") + " - " + _("Search artist") + ": " + search_entered,
        'path':
        plugin.url_for("music_search_artist_term",
                       term=search_entered,
                       page='1'),
        'icon':
        get_icon_path("music"),
    }, {
        'label':
        _("Music") + " - " + _("Search album") + ": " + search_entered,
        'path':
        plugin.url_for("music_search_album_term",
                       term=search_entered,
                       page='1'),
        'icon':
        get_icon_path("music"),
    }, {
        'label':
        _("Music") + " - " + _("Search track") + ": " + search_entered,
        'path':
        plugin.url_for("music_search_track_term",
                       term=search_entered,
                       page='1'),
        'icon':
        get_icon_path("music"),
    }, {
        'label': _("Live") + " - " + _("Search") + ": " + search_entered,
        'path': plugin.url_for("live_search_term", term=search_entered),
        'icon': get_icon_path("live"),
    }, {
        'label':
        _("Lists") + " - " + _("Search") + ": " + search_entered,
        'path':
        plugin.url_for("lists_search_for_lists_term",
                       term=search_entered,
                       page='1'),
        'icon':
        get_icon_path("lists"),
    }]
    fanart = plugin.addon.getAddonInfo('fanart')
    for item in items:
        item['properties'] = {'fanart_image': get_background_path()}
    return items
コード例 #23
0
ファイル: movies.py プロジェクト: vphuc81/MyRepository
def trakt_movies_search():
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return trakt_movies_search_term(term, 1)
    else: return
コード例 #24
0
ファイル: lists.py プロジェクト: KingPug75/repo
def lists_trakt_search_for_lists():
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return lists_search_for_lists_term(term, 1)
    else: return
コード例 #25
0
ファイル: movies.py プロジェクト: vphuc81/MyRepository
def tmdb_movies_search():
    """ Activate movie search """
    term = plugin.keyboard(heading=_("Enter search string"))
    if term != None and term != "": return tmdb_movies_search_term(term, 1)
    else: return
コード例 #26
0
def music_search_edit(term):
    term = plugin.keyboard(default=term, heading=_("Enter search string"))
    if term != None and term != "": return music_search_term(term, 1)
    else: return
コード例 #27
0
ファイル: movies.py プロジェクト: noobsandnerds/noobsandnerds
def tmdb_movies_search():
    """ Activate movie search """
    term = plugin.keyboard(heading=_("search for"))
    return tmdb_movies_search_term(term, 1)
コード例 #28
0
def live_search():
    """ Activate channel search """
    term = plugin.keyboard(heading=_("Enter search string"))
    return live_search_term(term)
コード例 #29
0
def trakt_tv_search():
    term = plugin.keyboard(heading=_("search for"))
    return trakt_tv_search_term(term, 1)