Ejemplo n.º 1
0
    def __init__(self, username):
        feed = ManyPageFeed(url_creator('user', username))
        self.username = feed.get('author', 0, 'name', '$t')
        self.num_playlists = feed.get('openSearch$totalResults', '$t')
        self.playlists = []

        for page in feed:
            if not page.get('entry'):
                continue
            for playlist_dict in page.get('entry'):
                playlist_id = playlist_dict.get('yt$playlistId', {}).get('$t')
                self.playlists.append(Playlist(playlist_id))
Ejemplo n.º 2
0
    def __init__(self, username):
        feed = ManyPageFeed(url_creator('user', username))
        self.username = feed.get('author', 0, 'name', '$t')
        self.num_playlists = feed.get('openSearch$totalResults', '$t')
        self.playlists = []

        for page in feed:
            if not page.get('entry'):
                continue
            for playlist_dict in page.get('entry'):
                playlist_id = playlist_dict.get('yt$playlistId', {}).get('$t')
                self.playlists.append(Playlist(playlist_id))
Ejemplo n.º 3
0
    def __init__(self, playlist_id):
        playlist_feed = ManyPageFeed(url_creator('playlist', playlist_id))
        self.id = playlist_id
        self.title = playlist_feed.get('title', '$t')
        self.subtitle = playlist_feed.get('subtitle', '$t')
        self.user = playlist_feed.get('author', 0, 'name', '$t')
        self.summary = playlist_feed.get('content', '$t')
        self.num_videos = playlist_feed.get('openSearch$totalResults', '$t')
        self.videos = []

        for page in playlist_feed:
            if not page.get('entry'):
                continue
            for video_data_dict in page.get('entry'):
                self.videos.append(Video(video_dict=video_data_dict))
Ejemplo n.º 4
0
    def __init__(self, playlist_id):
        playlist_feed = ManyPageFeed(url_creator('playlist', playlist_id))
        self.id = playlist_id
        self.title = playlist_feed.get('title', '$t')
        self.subtitle = playlist_feed.get('subtitle', '$t')
        self.user = playlist_feed.get('author', 0, 'name', '$t')
        self.summary = playlist_feed.get('content', '$t')
        self.num_videos = playlist_feed.get('openSearch$totalResults','$t')
        self.videos = []

        for page in playlist_feed:
            if not page.get('entry'):
                continue
            for video_data_dict in page.get('entry'):
                self.videos.append(Video(video_dict=video_data_dict))