Пример #1
0
def videos(url, video_type, offset, run_as_widget=False):
    if '' == offset:
        page = 0
    else:
        page = int(offset)

    loading_progress = show_loading_progress(run_as_widget)
    xbmcplugin.setContent(plugin_handle, 'movies')

    list_id = None
    genre_id = None
    if 'genre' in url:
        genre_id = url.split('?')[1]
    elif 'list?' in url:
        data = url.split('?')[1]
        if 'mylist' in data:
            root_list = lolomos.get_root_list()
            list_id = lolomos.get_mylist(root_list)[0]
        else:
            list_id = data

    video_metadata = None
    if list_id:
        video_metadata = get.videos_in_list(list_id, page)
    elif genre_id:
        video_metadata = get.videos_in_genre(genre_id, page)

    if video_metadata:
        add_videos_to_directory(loading_progress, run_as_widget, video_metadata, video_type, page, url)

    if generic_utility.get_setting('force_view') == 'true' and not run_as_widget:
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_videos') + ')')
    xbmcplugin.endOfDirectory(plugin_handle)
Пример #2
0
def main(video_type):
    add.directory(generic_utility.get_string(30105), '',
                  'list_viewing_activity', '', video_type)

    if video_type == 'show':
        add.directory(generic_utility.get_string(30107), 'genre?83',
                      'list_videos', '', video_type)
        add.directory(generic_utility.get_string(30108), '', 'list_genres', '',
                      video_type)

    elif video_type == 'movie':
        add.directory(generic_utility.get_string(30108), '', 'list_genres', '',
                      video_type)
    elif video_type == 'dynamic':
        add_dynamic_lists()

    if video_type != 'dynamic' and generic_utility.get_setting(
            'is_kid') == 'false':
        try:
            root_list = lolomos.get_root_list()
        except AttributeError:
            if connect.do_login():
                root_list = lolomos.get_root_list()
            else:
                raise Exception("Cannot login")
        mylist = lolomos.get_mylist(root_list)
        add.directory(child('displayName', mylist[1]), 'list?&mylist',
                      'list_videos', '', video_type)

    add.directory(generic_utility.get_string(30109), '', 'search', '',
                  video_type)
    xbmcplugin.endOfDirectory(plugin_handle, cacheToDisc=False)
Пример #3
0
def videos(url, video_type, offset, run_as_widget=False):
    if '' == offset:
        page = 0
    else:
        page = int(offset)

    loading_progress = show_loading_progress(run_as_widget)
    xbmcplugin.setContent(plugin_handle, 'movies')

    list_id = None
    genre_id = None
    if 'genre' in url:
        genre_id = url.split('?')[1]
    elif 'list?' in url:
        data = url.split('?')[1]
        if 'mylist' in data:
            root_list = lolomos.get_root_list()
            list_id = lolomos.get_mylist(root_list)[0]
        else:
            list_id = data

    video_metadata = None
    if list_id:
        video_metadata = get.videos_in_list(list_id, page)
    elif genre_id:
        video_metadata = get.videos_in_genre(genre_id, page)

    if video_metadata:
        add_videos_to_directory(loading_progress, run_as_widget, video_metadata, video_type, page, url)

    if generic_utility.get_setting('force_view') == 'true' and not run_as_widget:
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_videos') + ')')
    xbmcplugin.endOfDirectory(plugin_handle)
Пример #4
0
def add_or_remove(video_id, is_add):
    root_list = get_root_list()

    my_list = get_mylist(root_list)[0]
    auth = generic_utility.get_setting('authorization_url')
    track_id = get.track_id_list(my_list)

    if is_add:
        add_or_remove_str = 'addToList'
        add_or_remove_msg = 'added'
    else:
        add_or_remove_str = 'removeFromList'
        add_or_remove_msg = 'removed'

    post = ('{"callPath":["lolomos","%s","%s"],"params":["%s",2,["videos",%s],%s,null,null],' +
            '"authURL":"%s"}') % (root_list, add_or_remove_str, my_list, video_id, track_id, auth)

    content = connect.load_netflix_site(generic_utility.evaluator()+'&method=call', post, options=True)

    jsn = json.loads(content)

    generic_utility.log('mylist: '+my_list)
    generic_utility.log(str(jsn))
    if '"invalidated"' in content:
        generic_utility.notification('Successfully '+add_or_remove_msg)
    elif 'already exists' in content:
        generic_utility.notification('already exists')

    generic_utility.debug('add to mylist content: '+content)
Пример #5
0
def main(video_type):
    add.directory(generic_utility.get_string(30105), '',
                  'list_viewing_activity', '', video_type)

    if video_type == 'show':
        add.directory(generic_utility.get_string(30107), 'genre?83',
                      'list_videos', '', video_type)
        add.directory(generic_utility.get_string(30108), '', 'list_genres', '',
                      video_type)

    elif video_type == 'movie':
        add.directory(generic_utility.get_string(30108), '', 'list_genres', '',
                      video_type)
    elif video_type == 'dynamic':
        add_dynamic_lists()

    if video_type != 'dynamic':
        root_list = lolomos.get_root_list()
        mylist = lolomos.get_mylist(root_list)
        add.directory(child('displayName', mylist[1]), 'list?&mylist',
                      'list_videos', '', video_type)

    add.directory(generic_utility.get_string(30109), '', 'search', '',
                  video_type)
    xbmcplugin.endOfDirectory(plugin_handle, cacheToDisc=False)
Пример #6
0
def main(video_type):
    add.directory(generic_utility.get_string(30105), '', 'list_viewing_activity', '', video_type)

    if video_type == 'show':
        add.directory(generic_utility.get_string(30107), 'genre?83', 'list_videos', '', video_type)
        add.directory(generic_utility.get_string(30108), '', 'list_genres', '', video_type)

    elif video_type == 'movie':
        add.directory(generic_utility.get_string(30108), '', 'list_genres', '', video_type)
    elif video_type == 'dynamic':
        add_dynamic_lists()

    if video_type != 'dynamic':
        root_list = lolomos.get_root_list()
        mylist = lolomos.get_mylist(root_list)
        add.directory(child('displayName', mylist[1]), 'list?&mylist', 'list_videos', '', video_type)

    add.directory(generic_utility.get_string(30109), '', 'search', '', video_type)
    xbmcplugin.endOfDirectory(plugin_handle, cacheToDisc=False)