YouTube Data API . videos

Instance Methods

delete(id)

Deletes a YouTube video.

insert(part=None, body=None, media_body=None)

Uploads a video to YouTube and optionally sets the video's metadata.

list(id, part=None)

Returns a list of videos that match the API request parameters.

update(part=None, body)

Updates a video's metadata.

Method Details

delete(id)
Deletes a YouTube video.

Args:
  id: string, The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID. (required)
insert(part=None, body=None, media_body=None)
Uploads a video to YouTube and optionally sets the video's metadata.

Args:
  part: string, The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.

The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. (required)
  body: object, The request body.
    The object takes the form of:

{ # A video resource represents a YouTube video.
    "status": { # The status of a video details the video's upload status and privacy status. # The status object contains information about the video's uploading, processing, and privacy statuses.
      "privacyStatus": "A String", # The video's privacy status.
      "uploadStatus": "A String", # The status of the uploaded video.
      "rejectionReason": "A String", # This value explains why YouTube rejected an uploaded video. This property is only present if the uploadStatus property indicates that the upload was rejected.
      "failureReason": "A String", # This value explains why a video failed to upload. This property is only present if the uploadStatus property indicates that the upload failed.
    },
    "topicDetails": { # Freebase topic information related to the video. # The topicDetails object encapsulates information about Freebase topics associated with the video.
      "topicIds": [ # A list of Freebase topic IDs associated with the video. You can retrieve information about each topic using the Freebase Topic API.
        "A String",
      ],
    },
    "kind": "youtube#video", # The type of the API resource. For video resources, the value will be youtube#video.
    "statistics": { # Statistics about the video, such as the number of times the video was viewed or liked. # The statistics object contains statistics about the video.
      "commentCount": "A String", # The number of comments for the video.
      "viewCount": "A String", # The number of times the video has been viewed.
      "favoriteCount": "A String", # The number of users who currently have the video marked as a favorite video.
      "dislikeCount": "A String", # The number of users who have indicated that they disliked the video by giving it a negative rating.
      "likeCount": "A String", # The number of users who have indicated that they liked the video by giving it a positive rating.
    },
    "contentDetails": { # The contentDetails object contains information about the video content, including the length of the video and its aspect ratio.
      "duration": "A String", # The length of the video. The tag value is an ISO 8601 duration in the format PT#M#S, in which the letters PT indicate that the value specifies a period of time, and the letters M and S refer to length in minutes and seconds, respectively. The # characters preceding the M and S letters are both integers that specify the number of minutes (or seconds) of the video. For example, a value of PT15M51S indicates that the video is 15 minutes and 51 seconds long.
      "regionRestriction": { # Region restriction of the video. # The regionRestriction object contains information about the countries where a video is (or is not) viewable. The object will contain either the contentDetails.regionRestriction.allowed property or the contentDetails.regionRestriction.blocked property.
        "blocked": [ # A list of region codes that identify countries where the video is blocked. If this property is present and a country is not listed in its value, then the video is viewable in that country. If this property is present and contains an empty list, the video is viewable in all countries.
          "A String",
        ],
        "allowed": [ # A list of region codes that identify countries where the video is viewable. If this property is present and a country is not listed in its value, then the video is blocked from appearing in that country. If this property is present and contains an empty list, the video is blocked in all countries.
          "A String",
        ],
      },
    },
    "snippet": { # Basic details about a video, including title, description, uploader, thumbnails and category. # The snippet object contains basic details about the video, such as its title, description, and category.
      "thumbnails": { # A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.
        "a_key": { # Name of the thumbnail, to easily identify it. The set of names is dependent on the resource the thumbnail is for.
          "url": "A String", # The thumbnail image's URL.
          "width": 42,
          "height": 42,
        },
      },
      "tags": [ # A list of keyword tags associated with the video. Tags may contain spaces. This field is only visible to the video's uploader.
        "A String",
      ],
      "channelId": "A String", # The ID that YouTube uses to uniquely identify the channel that the video was uploaded to.
      "publishedAt": "A String", # The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
      "title": "A String", # The video's title.
      "categoryId": "A String", # The YouTube video category associated with the video.
      "description": "A String", # The video's description.
    },
    "player": { # Player to be used for a video playback. # The player object contains information that you would use to play the video in an embedded player.
      "embedHtml": "A String", # An