コード例 #1
0
def PLAY(payload, params):
    anime_url, episode = payload.rsplit("/", 1)
    sources = _BROWSER.get_episode_sources(anime_url, episode)

    serverChoice = filter(lambda x: control.getSetting(x[0]) == 'true',
                          SERVER_CHOICES.iteritems())
    serverChoice = map(lambda x: x[1], serverChoice)
    sources = filter(lambda x: x[0] in serverChoice, sources)

    autoplay = True if 'true' in control.getSetting('autoplay') else False

    s = SourcesList(
        sources, autoplay, sortResultsByRes, {
            'title': control.lang(30100),
            'processing': control.lang(30101),
            'choose': control.lang(30102),
            'notfound': control.lang(30103),
        })

    if isDirectoryStyle():
        if s._read_sources():
            items = sorted(s._sources.iteritems(), key=lambda x: x[0])
            items = [(title[5:], url) for title, url in items]
            items = map(
                lambda x: utils.allocate_item(x[0], 'playlink&url=/' + x[1],
                                              '', False, ''), items)
            return control.draw_items(items)
    else:
        res = control.play_source(s.get_video_link())
        bookmark_episode_playing(sources[0])
        return res
コード例 #2
0
def PLAY(payload, params):
    anime_url, episode = payload.rsplit("/", 1)
    sources = _BROWSER.get_episode_sources(anime_url, episode)

    serverChoice = filter(lambda x:
        control.getSetting(x[0]) == 'true', SERVER_CHOICES.iteritems())
    serverChoice = map(lambda x: x[1], serverChoice)
    sources = filter(lambda x: x[0] in serverChoice, sources)

    autoplay = True if 'true' in control.getSetting('autoplay') else False

    s = SourcesList(sources, autoplay, sortResultsByRes, {
        'title': control.lang(30100),
        'processing': control.lang(30101),
        'choose': control.lang(30102),
        'notfound': control.lang(30103),
    })

    if isDirectoryStyle():
        if s._read_sources():
            items = sorted(s._sources.iteritems(), key=lambda x: x[0])
            items = [(title[5:], url) for title, url in items]
            items = map(lambda x: utils.allocate_item(x[0], 'playlink&url=/'+x[1],'', False, ''), items)
            return control.draw_items(items)
    else:
        res = control.play_source(s.get_video_link())
        bookmark_episode_playing(sources[0])
        return res
コード例 #3
0
def LIST_MENU(payload, params):
    is_logged_in = _BROWSER.is_logged_in()
    menu_items = filter(lambda x: not x[2] or is_logged_in, MENU_ITEMS)

    return control.draw_items([
        utils.allocate_item(name, url, True, '')
        for name, url, logged_only in menu_items
    ])
コード例 #4
0
ファイル: default.py プロジェクト: C0nvert/plugin.video.kaito
def LIST_MENU(payload, params):
    return control.draw_items(
        [
            utils.allocate_item(name, url, True, image)
            for name, url, image in MENU_ITEMS
        ],
        contentType=control.getSetting("contenttype.menu"),
    )
コード例 #5
0
def TOOLS_MENU(payload, params):
    TOOLS_ITEMS = [
        (control.lang(30020), "settings", ''),
        (control.lang(30021), "clear_cache", ''),
        (control.lang(30022), "clear_torrent_cache", ''),
        (control.lang(30023), "clear_history", ''),
        (control.lang(30026), "rebuild_database", ''),
        (control.lang(30024), "wipe_addon_data", ''),
        ]

    return control.draw_items(
        [utils.allocate_item(name, url, True, image) for name, url, image in TOOLS_ITEMS],
        contentType=control.getSetting("contenttype.menu"),
    )        
コード例 #6
0
def LIST_MENU(payload):
    return control.draw_items(
        [utils.allocate_item(name, url, True) for name, url in MENU_ITEMS])
コード例 #7
0
def WATCHLIST_PAGE(payload, params):
    return control.draw_items([
        utils.allocate_item(name, url, True, '')
        for name, url in WATCHLIST_ITEMS
    ])
コード例 #8
0
def LIST_MENU(payload, params):
    is_logged_in = _BROWSER.is_logged_in()
    menu_items = filter(lambda x: not x[2] or is_logged_in, MENU_ITEMS)

    return control.draw_items([utils.allocate_item(name, url, True, '') for name, url, logged_only in menu_items])
コード例 #9
0
def WATCHLIST_PAGE(payload, params):
    return control.draw_items([utils.allocate_item(name, url, True, '') for name, url in WATCHLIST_ITEMS])
コード例 #10
0
def LIST_ALL_AB(payload, params):
    return control.draw_items([
        utils.allocate_item(AB_LIST_NAMING[i], "letter/%s/1" % x, True)
        for i, x in enumerate(AB_LIST)
    ])