YouTube API . playlistItems

Instance Methods

delete(id, onBehalfOfContentOwner=None)

Deletes playlist items by IDs.

insert(part, body, onBehalfOfContentOwner=None)

Insert a resource into a playlist.

list(part, onBehalfOfContentOwner=None, pageToken=None, playlistId=None, maxResults=None, id=None)

Browse the YouTube playlist collection.

list_next(previous_request, previous_response)

Retrieves the next page of results.

update(part, body, onBehalfOfContentOwner=None)

Update a playlist item.

Method Details

delete(id, onBehalfOfContentOwner=None)
Deletes playlist items by IDs.

Args:
  id: string, YouTube IDs of the playlist items to be deleted. (required)
  onBehalfOfContentOwner: string, The authenticated user acts on behalf of this content owner.
insert(part, body, onBehalfOfContentOwner=None)
Insert a resource into a playlist.

Args:
  part: string, One or more parts to return on the current request. (required)
  body: object, The request body. (required)
    The object takes the form of:

{ # A playlistItem resource refers to another resource, such as a video, that is included in a playlist.
    "snippet": { # Basic details about an item included in a playlist, including title, description, thumbnails, playlist the item is part of and position of the item inside the playlist. # Basic details about the playlist item: title, description, thumbnails.
      "playlistId": "A String", # The playlist the item is part of.
      "description": "A String", # Description of the playlist item.
      "title": "A String", # Title of the playlist item.
      "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The ID of the resource referenced by the playlist item.
        "kind": "A String", # The kind of the referred resource.
        "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
        "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
        "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
      },
      "channelId": "A String", # Channel publishing the playlist item.
      "publishedAt": "A String", # Date and time the playlist item was published at.
      "position": 42, # The position of the item within the playlist.
      "thumbnails": { # Playlist item thumbnails.
        "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
          "url": "A String", # The URL for the thumbnail.
        },
      },
    },
    "contentDetails": { # Details about the content of a playlist item, such as the video or the video fragment start and end time included in the playlist. # Content details about the playlist item: start and end clipping time.
      "note": "A String", # The user-generated note for this item.
      "startAt": "A String", # The time video playback begins.
      "endAt": "A String", # The time video playback ends.
      "videoId": "A String", # ID of the video.
    },
    "kind": "youtube#playlistItem", # The type of this API resource.
    "etag": "A String", # The eTag of the playlist item.
    "id": "A String", # The unique id of the playlist item.
  }

  onBehalfOfContentOwner: string, The authenticated user acts on behalf of this content owner.

Returns:
  An object of the form:

    { # A playlistItem resource refers to another resource, such as a video, that is included in a playlist.
      "snippet": { # Basic details about an item included in a playlist, including title, description, thumbnails, playlist the item is part of and position of the item inside the playlist. # Basic details about the playlist item: title, description, thumbnails.
        "playlistId": "A String", # The playlist the item is part of.
        "description": "A String", # Description of the playlist item.
        "title": "A String", # Title of the playlist item.
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The ID of the resource referenced by the playlist item.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
        "channelId": "A String", # Channel publishing the playlist item.
        "publishedAt": "A String", # Date and time the playlist item was published at.
        "position": 42, # The position of the item within the playlist.
        "thumbnails": { # Playlist item thumbnails.
          "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
            "url": "A String", # The URL for the thumbnail.
          },
        },
      },
      "contentDetails": { # Details about the content of a playlist item, such as the video or the video fragment start and end time included in the playlist. # Content details about the playlist item: start and end clipping time.
        "note": "A String", # The user-generated note for this item.
        "startAt": "A String", # The time video playback begins.
        "endAt": "A String", # The time video playback ends.
        "videoId": "A String", # ID of the video.
      },
      "kind": "youtube#playlistItem", # The type of this API resource.
      "etag": "A String", # The eTag of the playlist item.
      "id": "A String", # The unique id of the playlist item.
    }
list(part, onBehalfOfContentOwner=None, pageToken=None, playlistId=None, maxResults=None, id=None)
Browse the YouTube playlist collection.

Args:
  part: string, Playlist item parts to include in the returned response. Valid values are: id, snippet and contentDetails. (required)
  onBehalfOfContentOwner: string, The authenticated user acts on behalf of this content owner.
  pageToken: string, Token for the page selection.
  playlistId: string, Retrieves playlist items from the given playlist id.
  maxResults: integer, Maximum number of results to return
  id: string, YouTube IDs of the playlist items to be returned.

Returns:
  An object of the form:

    { # A paginated list of playlist items returned as the response to a youtube.playlistItems.list call.
    "nextPageToken": "A String", # Token to the next page.
    "kind": "youtube#playlistItemListResponse", # The type of this API response.
    "items": [ # List of playlist items matching the request criteria.
      { # A playlistItem resource refers to another resource, such as a video, that is included in a playlist.
          "snippet": { # Basic details about an item included in a playlist, including title, description, thumbnails, playlist the item is part of and position of the item inside the playlist. # Basic details about the playlist item: title, description, thumbnails.
            "playlistId": "A String", # The playlist the item is part of.
            "description": "A String", # Description of the playlist item.
            "title": "A String", # Title of the playlist item.
            "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The ID of the resource referenced by the playlist item.
              "kind": "A String", # The kind of the referred resource.
              "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
              "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
              "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
            },
            "channelId": "A String", # Channel publishing the playlist item.
            "publishedAt": "A String", # Date and time the playlist item was published at.
            "position": 42, # The position of the item within the playlist.
            "thumbnails": { # Playlist item thumbnails.
              "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
                "url": "A String", # The URL for the thumbnail.
              },
            },
          },
          "contentDetails": { # Details about the content of a playlist item, such as the video or the video fragment start and end time included in the playlist. # Content details about the playlist item: start and end clipping time.
            "note": "A String", # The user-generated note for this item.
            "startAt": "A String", # The time video playback begins.
            "endAt": "A String", # The time video playback ends.
            "videoId": "A String", # ID of the video.
          },
          "kind": "youtube#playlistItem", # The type of this API resource.
          "etag": "A String", # The eTag of the playlist item.
          "id": "A String", # The unique id of the playlist item.
        },
    ],
    "etag": "A String", # The eTag of the response.
    "prevPageToken": "A String", # Token to the previous page.
    "pageInfo": { # Paging details for lists of resources, including total number of items available and number of resources returned in a single page. # Paging information for the list result.
      "totalResults": 42, # The total number of results.
      "resultsPerPage": 42, # The number of results to display for each page.
    },
  }
list_next(previous_request, previous_response)
Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.
      
update(part, body, onBehalfOfContentOwner=None)
Update a playlist item.

Args:
  part: string, One or more parts to return on the current request. (required)
  body: object, The request body. (required)
    The object takes the form of:

{ # A playlistItem resource refers to another resource, such as a video, that is included in a playlist.
    "snippet": { # Basic details about an item included in a playlist, including title, description, thumbnails, playlist the item is part of and position of the item inside the playlist. # Basic details about the playlist item: title, description, thumbnails.
      "playlistId": "A String", # The playlist the item is part of.
      "description": "A String", # Description of the playlist item.
      "title": "A String", # Title of the playlist item.
      "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The ID of the resource referenced by the playlist item.
        "kind": "A String", # The kind of the referred resource.
        "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
        "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
        "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
      },
      "channelId": "A String", # Channel publishing the playlist item.
      "publishedAt": "A String", # Date and time the playlist item was published at.
      "position": 42, # The position of the item within the playlist.
      "thumbnails": { # Playlist item thumbnails.
        "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
          "url": "A String", # The URL for the thumbnail.
        },
      },
    },
    "contentDetails": { # Details about the content of a playlist item, such as the video or the video fragment start and end time included in the playlist. # Content details about the playlist item: start and end clipping time.
      "note": "A String", # The user-generated note for this item.
      "startAt": "A String", # The time video playback begins.
      "endAt": "A String", # The time video playback ends.
      "videoId": "A String", # ID of the video.
    },
    "kind": "youtube#playlistItem", # The type of this API resource.
    "etag": "A String", # The eTag of the playlist item.
    "id": "A String", # The unique id of the playlist item.
  }

  onBehalfOfContentOwner: string, The authenticated user acts on behalf of this content owner.

Returns:
  An object of the form:

    { # A playlistItem resource refers to another resource, such as a video, that is included in a playlist.
      "snippet": { # Basic details about an item included in a playlist, including title, description, thumbnails, playlist the item is part of and position of the item inside the playlist. # Basic details about the playlist item: title, description, thumbnails.
        "playlistId": "A String", # The playlist the item is part of.
        "description": "A String", # Description of the playlist item.
        "title": "A String", # Title of the playlist item.
        "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The ID of the resource referenced by the playlist item.
          "kind": "A String", # The kind of the referred resource.
          "channelId": "A String", # ID of the referred channel. Present only when type is "CHANNEL".
          "playlistId": "A String", # ID of the referred playlist. Present only when type is "PLAYLIST".
          "videoId": "A String", # ID of the referred video. Present only when type is "VIDEO".
        },
        "channelId": "A String", # Channel publishing the playlist item.
        "publishedAt": "A String", # Date and time the playlist item was published at.
        "position": 42, # The position of the item within the playlist.
        "thumbnails": { # Playlist item thumbnails.
          "a_key": { # A thumbnail is an image representing a YouTube resource. # A map of thumbnails by their name.
            "url": "A String", # The URL for the thumbnail.
          },
        },
      },
      "contentDetails": { # Details about the content of a playlist item, such as the video or the video fragment start and end time included in the playlist. # Content details about the playlist item: start and end clipping time.
        "note": "A String", # The user-generated note for this item.
        "startAt": "A String", # The time video playback begins.
        "endAt": "A String", # The time video playback ends.
        "videoId": "A String", # ID of the video.
      },
      "kind": "youtube#playlistItem", # The type of this API resource.
      "etag": "A String", # The eTag of the playlist item.
      "id": "A String", # The unique id of the playlist item.
    }