Esempio n. 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
Esempio n. 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
def PLAY(payload):
    anime_url, episode = payload.rsplit("/", 1)
    s = SourcesList(
        NineAnimeBrowser().get_episode_sources(anime_url, int(episode)), {
            'title': control.lang(30100),
            'processing': control.lang(30101),
            'choose': control.lang(30102),
            'notfound': control.lang(30103),
        })
    return control.play_source(s.get_video_link())
Esempio n. 4
0
def GOGO_PLAY(payload, params):
    sources = GogoAnimeBrowser().get_episode_sources(payload)
    autoplay = True if 'true' in control.getSetting('autoplay') else False

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

    control.play_source(s.get_video_link())
Esempio n. 5
0
def PLAY(payload, params):
    ep_id = payload
    sources = _BROWSER.get_episode_sources(ep_id, params['session'])
    autoplay = True if 'true' in control.getSetting('autoplay') else False

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

    control.play_source(s.get_video_link())
def PLAY(payload, params):
    anime_url, kitsu_id = payload.rsplit("/", 1)
    anime_url, episode = anime_url.rsplit("/", 1)
    anime_url, season = anime_url.rsplit("/", 1)
    anime_url, flavor = anime_url.rsplit("/", 1)
    is_dubbed = True if "dub" == flavor else False
    name, image = _BROWSER.get_anime_metadata(anime_url, is_dubbed)
    sources = _BROWSER.get_episode_sources(anime_url, is_dubbed, season,
                                           episode)
    autoplay = True if 'true' in control.getSetting('autoplay') else False

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

    __set_last_watched(anime_url, is_dubbed, name, image)
    control.play_source(s.get_video_link(),
                        watchlist_update(episode, kitsu_id), on_stopped)