Ejemplo n.º 1
0
    def list_terms(self, extras):
        """
        List all saved searches.

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        # Add listitem for adding new search terms
        search_item = Listitem()
        search_item.label = u"[B]%s[/B]" % self.localize(SEARCH)
        search_item.set_callback(self, search=True, **extras)
        search_item.art.global_thumb("search_new.png")
        yield search_item

        # Set the callback function to the route that was given
        callback_params = extras.copy()
        callback = dispatcher[callback_params.pop("route")].callback

        # Prefetch the localized string for the context menu lable
        str_remove = self.localize(REMOVE)

        # List all saved searches
        for search_term in self.search_db:
            item = Listitem()
            item.label = search_term.title()

            # Creatre Context Menu item for removing search term
            item.context.container(str_remove, self, remove=search_term, **extras)

            # Update params with full url and set the callback
            item.params.update(callback_params, search_query=search_term)
            item.set_callback(callback)
            yield item

        self.search_db.close()
 def route_list(plugin):
     plugin.add_sort_methods(SORT_DATE)
     yield Listitem.from_dict("season one",
                              "test.mkv",
                              info={"genre": "test"})
     item = Listitem.from_dict("season one", "test.mkv")
     item.info.date("june 27, 2017", "%B %d, %Y")
     yield item
 def route_list():
     yield Listitem.from_dict(callback_test,
                              "test item one",
                              info={"mediatype": "video"})
     yield Listitem.from_dict(callback_test,
                              "test item two",
                              info={"mediatype": "movie"})
     yield Listitem.from_dict(callback_test,
                              "test item three",
                              info={"mediatype": "video"})
Ejemplo n.º 4
0
def playlist(plugin,
             contentid,
             pagetoken=None,
             enable_playlists=True,
             loop=False):
    """
    List all videos within youtube playlist

    :param Route plugin: Tools related to Route callbacks.
    :param str contentid: Channel id or playlist id to list videos for.
    :param str pagetoken: [opt] The page token representing the next page of content.
    :param bool enable_playlists: [opt] Set to True to enable linking to channel playlists. (default => False)
    :param bool loop: [opt] Return all the videos within playlist. (Default => False)

    :returns: A generator of listitems.
    :rtype: :class:`types.GeneratorType`
    """
    gdata = APIControl()

    # Fetch channel uploads uuid
    playlist_id = gdata.valid_playlistid(contentid)

    # Request data feed
    feed = gdata.api.playlist_items(playlist_id, pagetoken, loop)
    channel_list = set()
    video_list = []

    # Fetch video ids for all public videos
    for item in feed[u"items"]:
        if u"status" in item and item[u"status"][
                u"privacyStatus"] in EXCEPTED_STATUS:  # pragma: no branch
            channel_list.add(item[u"snippet"][u"channelId"])
            video_list.append(item[u"snippet"][u"resourceId"][u"videoId"])
        else:  # pragma: no cover
            logger.debug("Skipping non plublic video: '%s'",
                         item[u"snippet"][u"resourceId"][u"videoId"])

    # Return the list of video listitems
    results = list(
        gdata.videos(video_list, multi_channel=len(channel_list) > 1))
    if u"nextPageToken" in feed:
        next_item = Listitem.next_page(contentid=contentid,
                                       pagetoken=feed[u"nextPageToken"])
        results.append(next_item)

    # Add playlists item to results
    if enable_playlists and contentid.startswith("UC") and pagetoken is None:
        item = Listitem()
        item.label = u"[B]%s[/B]" % plugin.localize(PLAYLISTS)
        item.info["plot"] = plugin.localize(PLAYLISTS_PLOT)
        item.art["icon"] = "DefaultVideoPlaylists.png"
        item.art.global_thumb("playlist.png")
        item.set_callback(playlists, channel_id=contentid, show_all=False)
        results.append(item)

    # Close db
    gdata.close()
    return results
Ejemplo n.º 5
0
    def run(self, video_id, pagetoken=None):
        """
        Search for all videos related to a giving video id.

        :param video_id: Id of the video the fetch related video for.
        :type video_id: unicode

        :param pagetoken: [opt] The page token representing the next page of content.
        :type pagetoken: unicode

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        self.category = "Related"
        self.update_listing = bool(pagetoken)
        feed = self.api.search(pageToken=pagetoken, relatedToVideoId=video_id)
        video_list = [item[u"id"][u"videoId"]
                      for item in feed[u"items"]]  # pragma: no branch

        # List all the related videos
        results = list(self.videos(video_list, multi_channel=True))
        if u"nextPageToken" in feed:  # pragma: no branch
            next_item = Listitem.next_page(video_id=video_id,
                                           pagetoken=feed[u"nextPageToken"])
            results.append(next_item)
        return results
Ejemplo n.º 6
0
def related(plugin, video_id, pagetoken=None):
    """
    Search for all videos related to a giving video id.

    :param Route plugin: Tools related to Route callbacks.
    :param str video_id: Id of the video the fetch related video for.
    :param str pagetoken: [opt] The page token representing the next page of content.

    :returns: A generator of listitems.
    :rtype: :class:`types.GeneratorType`
    """
    gdata = APIControl()
    plugin.category = "Related"
    plugin.update_listing = bool(pagetoken)
    feed = gdata.api.search(pageToken=pagetoken, relatedToVideoId=video_id)
    video_list = [item[u"id"][u"videoId"]
                  for item in feed[u"items"]]  # pragma: no branch

    # List all the related videos
    results = list(gdata.videos(video_list, multi_channel=True))
    if u"nextPageToken" in feed:  # pragma: no branch
        next_item = Listitem.next_page(video_id=video_id,
                                       pagetoken=feed[u"nextPageToken"])
        results.append(next_item)

    # Close db
    gdata.close()
    return results
Ejemplo n.º 7
0
    def run(self, contentid, pagetoken=None, enable_playlists=True, loop=False):
        """
        List all video within youtube playlist

        :param contentid: Channel id or playlist id to list videos for.
        :type contentid: unicode

        :param pagetoken: [opt] The page token representing the next page of content.
        :type pagetoken: unicode

        :param enable_playlists: [opt] Set to True to enable linking to channel playlists. (default => False)
        :type enable_playlists: bool

        :param loop: [opt] Return all the videos within playlist. (Default => False)
        :type loop: bool

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        # Fetch channel uploads uuid
        playlist_id = self.valid_playlistid(contentid)

        # Request data feed
        feed = self.api.playlist_items(playlist_id, pagetoken, loop)
        channel_list = set()
        video_list = []

        # Fetch video ids for all public videos
        for item in feed[u"items"]:
            if item[u"status"][u"privacyStatus"] == u"public":
                channel_list.add(item[u"snippet"][u"channelId"])
                video_list.append(item[u"snippet"][u"resourceId"][u"videoId"])
            else:
                logger.debug("Skipping non plublic video: '%s'", item[u"snippet"][u"resourceId"][u"videoId"])

        # Return the list of video listitems
        results = list(self.videos(video_list, multi_channel=len(channel_list) > 1))
        if u"nextPageToken" in feed:
            next_item = Listitem.next_page(contentid=contentid, pagetoken=feed[u"nextPageToken"])
            results.append(next_item)

        # Add playlists item to results
        if enable_playlists and contentid.startswith("UC") and pagetoken is None:
            item = Listitem()
            item.label = u"[B]%s[/B]" % self.localize(PLAYLISTS)
            item.info["plot"] = "Show all channel playlists."
            item.art["icon"] = "DefaultVideoPlaylists.png"
            item.art.global_thumb("playlist.png")
            item.set_callback(Playlists, channel_id=contentid, show_all=False)
            results.append(item)

        return results
Ejemplo n.º 8
0
def list_terms(plugin, searchdb, extras):
    """
    List all saved searches.

    :param Route plugin: Tools related to Route callbacks.
    :param Search searchdb: Search DB
    :param dict extras: Extra parameters that will be farwarded on to the context.container.

    :returns: A generator of listitems.
    :rtype: :class:`types.GeneratorType`
    """
    # Add listitem for adding new search terms
    search_item = Listitem()
    search_item.label = u"[B]%s[/B]" % plugin.localize(SEARCH)
    search_item.set_callback(saved_searches, search=True, **extras)
    search_item.art.global_thumb("search_new.png")
    yield search_item

    # Set the callback function to the route that was given
    callback_params = extras.copy()
    route = callback_params.pop("_route")
    callback = dispatcher.get_route(route).callback

    # Prefetch the localized string for the context menu lable
    str_remove = plugin.localize(REMOVE)

    # List all saved searches
    for search_term in searchdb:
        item = Listitem()
        item.label = search_term.title()

        # Creatre Context Menu item for removing search term
        item.context.container(saved_searches,
                               str_remove,
                               remove_entry=search_term,
                               **extras)

        # Update params with full url and set the callback
        item.params.update(callback_params, search_query=search_term)
        item.set_callback(callback)
        yield item
Ejemplo n.º 9
0
    def run(self, contentid, pagetoken=None, enable_playlists=True, loop=False):
        """
        List all video within youtube playlist

        :param str contentid: Channel id or playlist id to list videos for.
        :param str pagetoken: [opt] The page token representing the next page of content.
        :param bool enable_playlists: [opt] Set to True to enable linking to channel playlists. (default => False)
        :param bool loop: [opt] Return all the videos within playlist. (Default => False)

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        # Fetch channel uploads uuid
        playlist_id = self.valid_playlistid(contentid)

        # Request data feed
        feed = self.api.playlist_items(playlist_id, pagetoken, loop)
        channel_list = set()
        video_list = []

        # Fetch video ids for all public videos
        for item in feed[u"items"]:
            if u"status" in item and item[u"status"][u"privacyStatus"] in EXCEPTED_STATUS:  # pragma: no branch
                channel_list.add(item[u"snippet"][u"channelId"])
                video_list.append(item[u"snippet"][u"resourceId"][u"videoId"])
            else:  # pragma: no cover
                logger.debug("Skipping non plublic video: '%s'", item[u"snippet"][u"resourceId"][u"videoId"])

        # Return the list of video listitems
        results = list(self.videos(video_list, multi_channel=len(channel_list) > 1))
        if u"nextPageToken" in feed:
            next_item = Listitem.next_page(contentid=contentid, pagetoken=feed[u"nextPageToken"])
            results.append(next_item)

        # Add playlists item to results
        if enable_playlists and contentid.startswith("UC") and pagetoken is None:
            item = Listitem()
            item.label = u"[B]%s[/B]" % self.localize(PLAYLISTS)
            item.info["plot"] = self.localize(PLAYLISTS_PLOT)
            item.art["icon"] = "DefaultVideoPlaylists.png"
            item.art.global_thumb("playlist.png")
            item.set_callback(Playlists, channel_id=contentid, show_all=False)
            results.append(item)

        return results
Ejemplo n.º 10
0
    def run(self, video_id, pagetoken=None):
        """
        Search for all videos related to a giving video id.

        :param str video_id: Id of the video the fetch related video for.
        :param str pagetoken: [opt] The page token representing the next page of content.

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        self.category = "Related"
        self.update_listing = bool(pagetoken)
        feed = self.api.search(pageToken=pagetoken, relatedToVideoId=video_id)
        video_list = [item[u"id"][u"videoId"] for item in feed[u"items"]]  # pragma: no branch

        # List all the related videos
        results = list(self.videos(video_list, multi_channel=True))
        if u"nextPageToken" in feed:  # pragma: no branch
            next_item = Listitem.next_page(video_id=video_id, pagetoken=feed[u"nextPageToken"])
            results.append(next_item)
        return results
 def session_two(_, search_query):
     self.assertEqual(search_query, "Pop")
     yield Listitem.from_dict(session_two, "listitem one")
     yield Listitem.from_dict(session_two, "listitem two")
 def session_two(_, search_query):
     self.assertEqual(search_query, "Pop")
     yield Listitem.from_dict(session_two, "listitem one")
     yield Listitem.from_dict(session_two, "listitem two")
 def route_list():
     yield Listitem.from_dict("season one", "test.mkv")
Ejemplo n.º 14
0
    def run(self, channel_id, show_all=True, pagetoken=None, loop=False):
        """
        List all playlist for giving channel

        :param str channel_id: Channel id to list playlists for.
        :param bool show_all: [opt] Add link to all of the channels videos if True. (default => True)
        :param str pagetoken: [opt] The token for the next page of results.
        :param bool loop: [opt] Return all the playlist for channel. (Default => False)

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        # Make sure that we have a valid channel id
        if not channel_id.startswith("UC"):
            raise ValueError("channel_id is not valid: %s" % channel_id)

        # Fetch fanart image for channel
        fanart = self.db.cur.execute("SELECT fanart FROM channels WHERE channel_id = ?", (channel_id,)).fetchone()
        if fanart:  # pragma: no branch
            fanart = fanart[0]

        # Fetch channel playlists feed
        feed = self.api.playlists(channel_id, pagetoken, loop)

        # Add next Page entry if pagetoken is found
        if u"nextPageToken" in feed:  # pragma: no branch
            yield Listitem.next_page(channel_id=channel_id, show_all=False, pagetoken=feed[u"nextPageToken"])

        # Display a link for listing all channel videos
        # This is usefull when the root of a addon is the playlist directory
        if show_all:
            title = bold(self.localize(ALLVIDEOS))
            yield Listitem.youtube(channel_id, title, enable_playlists=False)

        # Loop Entries
        for playlist_item in feed[u"items"]:
            # Create listitem object
            item = Listitem()

            # Check if there is actualy items in the playlist before listing
            item_count = playlist_item[u"contentDetails"][u"itemCount"]
            if item_count == 0:  # pragma: no cover
                continue

            # Fetch video snippet
            snippet = playlist_item[u"snippet"]

            # Set label
            item.label = u"%s (%s)" % (snippet[u"localized"][u"title"], item_count)

            # Fetch Image Url
            item.art["thumb"] = snippet[u"thumbnails"][u"medium"][u"url"]

            # Set Fanart
            item.art["fanart"] = fanart

            # Fetch Possible Plot and Check if Available
            item.info["plot"] = snippet[u"localized"][u"description"]

            # Add InfoLabels and Data to Processed List
            item.set_callback(Playlist, contentid=playlist_item[u"id"], enable_playlists=False)
            yield item
 def results(_, search_query):
     self.assertEqual(search_query, "Rock")
     yield Listitem.from_dict(results, "listitem one")
     yield Listitem.from_dict(results, "listitem two")
 def route_list():
     yield Listitem.from_dict(callback_test, "test item")
Ejemplo n.º 17
0
 def route_list(_):
     yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 18
0
 def route_list(plugin):
     plugin.add_sort_methods(3, disable_autosort=True)
     yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
 def route_list(plugin):
     plugin.autosort = False
     yield Listitem.from_dict("season one", "test.mkv")
Ejemplo n.º 20
0
 def route_list(_):
     yield Listitem.from_dict("http://season one", "test.mkv")
Ejemplo n.º 21
0
 def route_list():
     yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 22
0
 def route_list():
     item = Listitem.from_dict("season one", "test.mkv")
     item.info.date("june 27, 2017", "%B %d, %Y")
     yield item
 def route_list(plugin):
     plugin.autosort = False
     plugin.add_sort_methods(3)
     yield Listitem.from_dict("season one",
                              "test.mkv",
                              info={"genre": "test"})
Ejemplo n.º 24
0
    def videos(self, video_ids, multi_channel=False):
        """
        Process VideoIDs and return listitems in a generator

        :param video_ids: List of all the videos to show.
        :param bool multi_channel: [opt] Set to True to enable linking to channel playlists. (default => False)

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        # Check that the quality setting is set to HD or greater
        try:
            ishd = self.setting.get_int("video_quality",
                                        addon_id="script.module.youtube.dl")
        except RuntimeError:  # pragma: no cover
            ishd = True

        # Process videos
        for video_data in self.request_videos(video_ids):
            # Create listitem object
            item = Listitem()

            # Fetch Title
            item.label = video_data["title"]

            # Add channel Fanart
            item.art["fanart"] = video_data["fanart"]

            # Fetch video Image url
            item.art["thumb"] = video_data["thumb"]

            # Fetch Description
            item.info["plot"] = u"[B]%s[/B]\n\n%s" % (
                video_data["channel_title"], video_data["description"])

            # Fetch Studio
            item.info["studio"] = video_data["channel_title"]

            # Fetch Viewcount
            if video_data["count"]:
                item.info["count"] = video_data["count"]

            # Fetch Possible Date
            date = video_data["date"]
            item.info.date(date[:date.find(u"T")], "%Y-%m-%d")

            # Fetch Category
            item.info["genre"] = video_data["genre"]

            # Set Quality and Audio Overlays
            item.stream.hd(bool(ishd and video_data["hd"]))

            # Set duration
            item.info["duration"] = video_data["duration"]

            # Add Context item to link to related videos
            item.context.related(related, video_id=video_data["video_id"])

            # Add Context item for youtube channel if videos from more than one channel are ben listed
            if multi_channel:
                item.context.container(playlist,
                                       u"Go to: %s" %
                                       video_data["channel_title"],
                                       contentid=video_data["channel_id"])

            # Return the listitem
            item.set_callback(play_video, video_id=video_data["video_id"])
            yield item
Ejemplo n.º 25
0
 def route_gen(_):
     yield Listitem.from_dict(callback_test, "test item")
Ejemplo n.º 26
0
def playlists(plugin, channel_id, show_all=True, pagetoken=None, loop=False):
    """
    List all playlist for giving channel

    :param Route plugin: Tools related to Route callbacks.
    :param str channel_id: Channel id to list playlists for.
    :param bool show_all: [opt] Add link to all of the channels videos if True. (default => True)
    :param str pagetoken: [opt] The token for the next page of results.
    :param bool loop: [opt] Return all the playlist for channel. (Default => False)

    :returns: A generator of listitems.
    :rtype: :class:`types.GeneratorType`
    """
    gdata = APIControl()

    # Make sure that we have a valid channel id
    if not channel_id.startswith("UC"):
        raise ValueError("channel_id is not valid: %s" % channel_id)

    # Fetch fanart image for channel
    fanart = gdata.db.cur.execute(
        "SELECT fanart FROM channels WHERE channel_id = ?",
        (channel_id, )).fetchone()
    if fanart:  # pragma: no branch
        fanart = fanart[0]

    # Fetch channel playlists feed
    feed = gdata.api.playlists(channel_id, pagetoken, loop)

    # Add next Page entry if pagetoken is found
    if u"nextPageToken" in feed:  # pragma: no branch
        yield Listitem.next_page(channel_id=channel_id,
                                 show_all=False,
                                 pagetoken=feed[u"nextPageToken"])

    # Display a link for listing all channel videos
    # This is usefull when the root of a addon is the playlist directory
    if show_all:
        title = bold(plugin.localize(ALLVIDEOS))
        yield Listitem.youtube(channel_id, title, enable_playlists=False)

    # Loop Entries
    for playlist_item in feed[u"items"]:
        # Create listitem object
        item = Listitem()

        # Check if there is actualy items in the playlist before listing
        item_count = playlist_item[u"contentDetails"][u"itemCount"]
        if item_count == 0:  # pragma: no cover
            continue

        # Fetch video snippet
        snippet = playlist_item[u"snippet"]

        # Set label
        item.label = u"%s (%s)" % (snippet[u"localized"][u"title"], item_count)

        # Fetch Image Url
        item.art["thumb"] = snippet[u"thumbnails"][u"medium"][u"url"]

        # Set Fanart
        item.art["fanart"] = fanart

        # Fetch Possible Plot and Check if Available
        item.info["plot"] = snippet[u"localized"][u"description"]

        # Add InfoLabels and Data to Processed List
        item.set_callback(playlist,
                          contentid=playlist_item[u"id"],
                          enable_playlists=False)
        yield item

    # Close db
    gdata.close()
Ejemplo n.º 27
0
 def route_list(_):
     yield Listitem.from_dict(callback_test, "test item", info={"mediatype": "video"})
Ejemplo n.º 28
0
 def route_list(plugin):
     plugin.autosort = False
     yield Listitem.from_dict("season one", "test.mkv")
 def test_list(self):
     self.route._process_results(
         [Listitem.from_dict(callback_test, "test item")])
     self.assertTrue(plugin_data["succeeded"])
Ejemplo n.º 30
0
 def route_list(_):
     yield Listitem.from_dict(callback_test, "season one")
Ejemplo n.º 31
0
 def route_list(plugin):
     plugin.autosort = False
     yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 32
0
 def route_list(_):
     item = Listitem.from_dict("http://season one", "test.mkv")
     item.info.date("june 27, 2017", "%B %d, %Y")
     yield item
Ejemplo n.º 33
0
 def route_list(plugin):
     plugin.add_sort_methods(3, disable_autosort=True)
     yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 34
0
 def route_list(plugin):
     plugin.autosort = False
     yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 35
0
 def route_list(plugin):
     plugin.add_sort_methods(SORT_DATE)
     yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 36
0
 def route_list(plugin):
     plugin.add_sort_methods(SORT_DATE)
     yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
Ejemplo n.º 37
0
 def route_list(plugin):
     plugin.add_sort_methods(SORT_DATE)
     yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
     item = Listitem.from_dict("season one", "test.mkv")
     item.info.date("june 27, 2017", "%B %d, %Y")
     yield item
Ejemplo n.º 38
0
 def route_list(_):
     return [Listitem.from_dict(callback_test, "test item")]
Ejemplo n.º 39
0
 def route_gen():
     yield Listitem.from_dict(callback_test, "test item")
Ejemplo n.º 40
0
 def route_list(_):
     yield Listitem.from_dict(callback_test, "season one", info={"mediatype": "season"})
Ejemplo n.º 41
0
 def test_list(self):
     self.route._process_results([Listitem.from_dict(callback_test, "test item")])
     self.assertTrue(plugin_data["succeeded"])
Ejemplo n.º 42
0
    def videos(self, video_ids, multi_channel=False):
        """
        Process VideoIDs and return listitems in a generator

        :param video_ids: List of all the videos to show.
        :param bool multi_channel: [opt] Set to True to enable linking to channel playlists. (default => False)

        :returns: A generator of listitems.
        :rtype: :class:`types.GeneratorType`
        """
        # Check that the quality setting is set to HD or greater
        try:
            ishd = self.setting.get_int("video_quality", addon_id="script.module.youtube.dl")
        except RuntimeError:  # pragma: no cover
            ishd = True

        # Process videos
        for video_data in self.request_videos(video_ids):
            # Create listitem object
            item = Listitem()

            # Fetch Title
            item.label = video_data["title"]

            # Add channel Fanart
            item.art["fanart"] = video_data["fanart"]

            # Fetch video Image url
            item.art["thumb"] = video_data["thumb"]

            # Fetch Description
            item.info["plot"] = u"[B]%s[/B]\n\n%s" % (video_data["channel_title"], video_data["description"])

            # Fetch Studio
            item.info["studio"] = video_data["channel_title"]

            # Fetch Viewcount
            item.info["count"] = video_data["count"]

            # Fetch Possible Date
            date = video_data["date"]
            item.info.date(date[:date.find(u"T")], "%Y-%m-%d")

            # Fetch Category
            item.info["genre"] = video_data["genre"]

            # Set Quality and Audio Overlays
            item.stream.hd(bool(ishd and video_data["hd"]))

            # Set duration
            item.info["duration"] = video_data["duration"]

            # Add Context item to link to related videos
            item.context.related(Related, video_id=video_data["video_id"])

            # Add Context item for youtube channel if videos from more than one channel are ben listed
            if multi_channel:
                item.context.container(Playlist, u"Go to: %s" % video_data["channel_title"],
                                       contentid=video_data["channel_id"])

            # Return the listitem
            item.set_callback(play_video, video_id=video_data["video_id"])
            yield item
Ejemplo n.º 43
0
 def route_list():
     yield Listitem.from_dict(callback_test, "test item", info={"mediatype": "video"})
Ejemplo n.º 44
0
 def route_list():
     yield Listitem.from_dict(callback_test, "test item one", info={"mediatype": "video"})
     yield Listitem.from_dict(callback_test, "test item two", info={"mediatype": "movie"})
     yield Listitem.from_dict(callback_test, "test item three", info={"mediatype": "video"})
Ejemplo n.º 45
0
 def route_list():
     yield Listitem.from_dict(callback_test, "season one", info={"mediatype": "season"})
 def session_one(_, search_query):
     self.assertEqual(search_query, "Rock")
     yield Listitem.from_dict(session_one, "listitem one")
     yield Listitem.from_dict(session_one, "listitem two")
Ejemplo n.º 47
0
 def route_list():
     yield Listitem.from_dict("season one", "test.mkv")
 def results(_, search_query):
     self.assertEqual(search_query, "Rock")
     yield Listitem.from_dict(results, "listitem one")
     yield Listitem.from_dict(results, "listitem two")
 def session_one(_, search_query):
     self.assertEqual(search_query, "Rock")
     yield Listitem.from_dict(session_one, "listitem one")
     yield Listitem.from_dict(session_one, "listitem two")