Beispiel #1
0
    def playlists_list_mine(self, client, **kwargs):
        # See full sample for function
        kwargs = self.remove_empty_kwargs(**kwargs)

        response = client.playlists().list(**kwargs).execute()

        return response
Beispiel #2
0
def playlists_insert(client, properties, **kwargs):
    # See full sample for function
    resource = build_resource(properties)

    # See full sample for function
    kwargs = remove_empty_kwargs(**kwargs)

    response = client.playlists().insert(body=resource, **kwargs).execute()

    return response
Beispiel #3
0
def playlists_list_by_channel_id(client, **kwargs):
    """
    get playlist IDs from a channel by inputting a
    channel ID
  """
    kwargs = remove_empty_kwargs(**kwargs)

    response = client.playlists().list(**kwargs).execute()

    length = len(response['items'])

    # for playlist in list of playlists in response
    for i in range(length):
        if not len(response['items'][i]) == 0:
            myPlaylistId = response['items'][i]['id']
            numVids = 7
            playlist_items_list_by_playlist_id(client,
                                               part='snippet,contentDetails',
                                               maxResults=numVids,
                                               playlistId=myPlaylistId)