# YouTube Data API . videos

## Instance Methods

Deletes a YouTube video.

Retrieves the ratings that the authorized user gave to a list of specified videos.

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

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

Retrieves the next page of results.

Add a like or dislike rating to a video or remove a rating from a video.

Report abuse for a video.

Updates a video's metadata.

### Method Details

`delete(id, onBehalfOfContentOwner=None)`

    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)
      onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.

    The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.

`getRating(id, onBehalfOfContentOwner=None)`

    Retrieves the ratings that the authorized user gave to a list of specified videos.

    Args:
      id: string, The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID. (required)
      onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.

    The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

    Returns:
      An object of the form:

        {
        "eventId": "A String", # Serialized EventId of the request which produced this response.
        "items": [ # A list of ratings that match the request criteria.
          {
            "rating": "A String",
            "videoId": "A String",
          },
        ],
        "kind": "youtube#videoGetRatingResponse", # Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse".
        "etag": "A String", # Etag of this resource.
        "visitorId": "A String", # The visitorId identifies the visitor.
      }

`insert(part, body=None, media_body=None, onBehalfOfContentOwner=None, stabilize=None, media_mime_type=None, onBehalfOfContentOwnerChannel=None, notifySubscribers=None, autoLevels=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.

    Note that not all parts contain properties that can be set when inserting or updating a video. 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.
        "liveStreamingDetails": { # Details about the live streaming metadata. # The liveStreamingDetails object contains metadata about a live video broadcast. The object will only be present in a video resource if the video is an upcoming, live, or completed live broadcast.
          "actualEndTime": "A String", # The time that the broadcast actually ended. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available until the broadcast is over.
          "activeLiveChatId": "A String", # The ID of the currently active live chat attached to this video. This field is filled only if the video is a currently live broadcast that has live chat. Once the broadcast transitions to complete this field will be removed and the live chat closed down. For persistent broadcasts that live chat id will no longer be tied to this video but rather to the new video being displayed at the persistent page.
          "scheduledStartTime": "A String", # The time that the broadcast is scheduled to begin. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
          "concurrentViewers": "A String", # The number of viewers currently watching the broadcast. The property and its value will be present if the broadcast has current viewers and the broadcast owner has not hidden the viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers for a broadcast when the broadcast ends. So, this property would not identify the number of viewers watching an archived video of a live broadcast that already ended.
          "actualStartTime": "A String", # The time that the broadcast actually started. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available until the broadcast begins.
          "scheduledEndTime": "A String", # The time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. If the value is empty or the property is not present, then the broadcast is scheduled to continue indefinitely.
        },
        "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.
          "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.
          "description": "A String", # The video's description.
          "tags": [ # A list of keyword tags associated with the video. Tags may contain spaces.
            "A String",
          ],
          "defaultAudioLanguage": "A String", # The default_audio_language property specifies the language spoken in the video's default audio track.
          "channelId": "A String", # The ID that YouTube uses to uniquely identify the channel that the video was uploaded to.
          "defaultLanguage": "A String", # The language of the videos's default snippet.
          "liveBroadcastContent": "A String", # Indicates if the video is an upcoming/active live broadcast. Or it's "none" if the video is not an upcoming/active live broadcast.
          "channelTitle": "A String", # Channel title for the channel that the video belongs to.
          "title": "A String", # The video's title.
          "categoryId": "A String", # The YouTube video category associated with the video.
          "localized": { # Localized versions of certain video properties (e.g. title). # Localized snippet selected with the hl parameter. If no such localization exists, this field is populated with the default snippet. (Read-only)
            "description": "A String", # Localized version of the video's description.
            "title": "A String", # Localized version of the video's title.
          },
          "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # 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.
            "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
          },
        },
        "kind": "youtube#video", # Identifies what kind of resource this is. Value: the fixed string "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.
        },
        "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 that are centrally associated with the video. These are topics that are centrally featured in the video, and it can be said that the video is mainly about each of these. You can retrieve information about each topic using the Freebase Topic API.
            "A String",
          ],
          "topicCategories": [ # A list of Wikipedia URLs that provide a high-level description of the video's content.
            "A String",
          ],
          "relevantTopicIds": [ # Similar to topic_id, except that these topics are merely relevant to the video. These are topics that may be mentioned in, or appear in the video. You can retrieve information about each topic using Freebase Topic API.
            "A String",
          ],
        },
        "monetizationDetails": { # Details about monetization of a YouTube Video. # The monetizationDetails object encapsulates information about the monetization status of the video.
          "access": { # Rights management policy for YouTube resources. # The value of access indicates whether the video can be monetized or not.
            "exception": [ # A list of region codes that identify countries where the default policy do not apply.
              "A String",
            ],
            "allowed": True or False, # The value of allowed indicates whether the access to the policy is allowed or denied by default.
          },
        },
        "contentDetails": { # Details about the content of a YouTube Video. # The contentDetails object contains information about the video content, including the length of the video and its aspect ratio.
          "definition": "A String", # The value of definition indicates whether the video is available in high definition or only in standard definition.
          "projection": "A String", # Specifies the projection format of the video.
          "countryRestriction": { # Rights management policy for YouTube resources. # The countryRestriction object contains information about the countries where a video is (or is not) viewable.
            "exception": [ # A list of region codes that identify countries where the default policy do not apply.
              "A String",
            ],
            "allowed": True or False, # The value of allowed indicates whether the access to the policy is allowed or denied by default.
          },
          "hasCustomThumbnail": True or False, # Indicates whether the video uploader has provided a custom thumbnail image for the video. This property is only visible to the video uploader.
          "contentRating": { # Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 69 # Specifies the ratings that the video received under various rating schemes.
            "cncRating": "A String", # Rating system in France - Commission de classification cinematographique
            "catvfrRating": "A String", # The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian French-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.
            "cbfcRating": "A String", # The video's Central Board of Film Certification (CBFC - India) rating.
            "bfvcRating": "A String", # The video's rating from Thailand's Board of Film and Video Censors.
            "mdaRating": "A String", # The video's rating from Singapore's Media Development Authority (MDA) and, specifically, it's Board of Film Censors (BFC).
            "lsfRating": "A String", # The video's rating from Indonesia's Lembaga Sensor Film.
            "medietilsynetRating": "A String", # The video's rating from Medietilsynet, the Norwegian Media Authority.
            "bmukkRating": "A String", # The video's rating from the Austrian Board of Media Classification (Bundesministerium für Unterricht, Kunst und Kultur).
            "chfilmRating": "A String", # The video's rating in Switzerland.
            "resorteviolenciaRating": "A String", # The video's rating in Venezuela.
            "rteRating": "A String", # The video's rating from Ireland's Raidió Teilifís Éireann.
            "csaRating": "A String", # The video's rating from France's Conseil supérieur de l?audiovisuel, which rates broadcast content.
            "moctwRating": "A String", # The video's rating from Taiwan's Ministry of Culture (文化部).
            "catvRating": "A String", # Rating system for Canadian TV - Canadian TV Classification System The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian English-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.
            "pefilmRating": "A String", # The video's rating in Peru.
            "djctqRatingReasons": [ # Reasons that explain why the video received its DJCQT (Brazil) rating.
              "A String",
            ],
            "incaaRating": "A String", # The video's INCAA (Instituto Nacional de Cine y Artes Audiovisuales - Argentina) rating.
            "oflcRating": "A String", # The video's Office of Film and Literature Classification (OFLC - New Zealand) rating.
            "fpbRating": "A String", # The video's rating from South Africa's Film and Publication Board.
            "mccaaRating": "A String", # The video's rating from Malta's Film Age-Classification Board.
            "tvpgRating": "A String", # The video's TV Parental Guidelines (TVPG) rating.
            "rtcRating": "A String", # The video's General Directorate of Radio, Television and Cinematography (Mexico) rating.
            "cscfRating": "A String", # The video's rating from Luxembourg's Commission de surveillance de la classification des films (CSCF).
            "fskRating": "A String", # The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - Germany) rating.
            "bbfcRating": "A String", # The video's British Board of Film Classification (BBFC) rating.
            "kmrbRating": "A String", # The video's Korea Media Rating Board (영상물등급위원회) rating. The KMRB rates videos in South Korea.
            "smsaRating": "A String", # The video's rating from Statens medieråd (Sweden's National Media Council).
            "egfilmRating": "A String", # The video's rating in Egypt.
            "cicfRating": "A String", # The video's rating from the Commission de Contrôle des Films (Belgium).
            "nbcplRating": "A String", # The video's rating in Poland.
            "nbcRating": "A String", # The video's rating from the Maldives National Bureau of Classification.
            "ytRating": "A String", # A rating that YouTube uses to identify age-restricted content.
            "nfvcbRating": "A String", # The video's rating from Nigeria's National Film and Video Censors Board.
            "djctqRating": "A String", # The video's Departamento de Justiça, Classificação, Qualificação e Títulos (DJCQT - Brazil) rating.
            "ifcoRating": "A String", # The video's Irish Film Classification Office (IFCO - Ireland) rating. See the IFCO website for more information.
            "fcoRating": "A String", # The video's rating from Hong Kong's Office for Film, Newspaper and Article Administration.
            "eefilmRating": "A String", # The video's rating in Estonia.
            "acbRating": "A String", # The video's Australian Classification Board (ACB) or Australian Communications and Media Authority (ACMA) rating. ACMA ratings are used to classify children's television programming.
            "grfilmRating": "A String", # The video's rating in Greece.
            "cccRating": "A String", # The video's Consejo de Calificación Cinematográfica (Chile) rating.
            "ecbmctRating": "A String", # Rating system in Turkey - Evaluation and Classification Board of the Ministry of Culture and Tourism
            "czfilmRating": "A String", # The video's rating in the Czech Republic.
            "kfcbRating": "A String", # The video's rating from the Kenya Film Classification Board.
            "fmocRating": "A String", # This property has been deprecated. Use the contentDetails.contentRating.cncRating instead.
            "eirinRating": "A String", # The video's Eirin (映倫) rating. Eirin is the Japanese rating system.
            "cceRating": "A String", # The video's rating from Portugal's Comissão de Classificação de Espect´culos.
            "nkclvRating": "A String", # The video's rating from the Nacionãlais Kino centrs (National Film Centre of Latvia).
            "mtrcbRating": "A String", # The video's rating from the Movie and Television Review and Classification Board (Philippines).
            "mibacRating": "A String", # The video's rating from the Ministero dei Beni e delle Attività Culturali e del Turismo (Italy).
            "anatelRating": "A String", # The video's Anatel (Asociación Nacional de Televisión) rating for Chilean television.
            "mcstRating": "A String", # The video's rating system for Vietnam - MCST
            "smaisRating": "A String", # The video's rating in Iceland.
            "ilfilmRating": "A String", # The video's rating in Israel.
            "russiaRating": "A String", # The video's National Film Registry of the Russian Federation (MKRF - Russia) rating.
            "mpaaRating": "A String", # The video's Motion Picture Association of America (MPAA) rating.
            "fpbRatingReasons": [ # Reasons that explain why the video received its FPB (South Africa) rating.
              "A String",
            ],
            "agcomRating": "A String", # The video's rating from Italy's Autorità per le Garanzie nelle Comunicazioni (AGCOM).
            "chvrsRating": "A String", # The video's Canadian Home Video Rating System (CHVRS) rating.
            "cnaRating": "A String", # The video's rating from Romania's CONSILIUL NATIONAL AL AUDIOVIZUALULUI (CNA).
            "icaaRating": "A String", # The video's Instituto de la Cinematografía y de las Artes Audiovisuales (ICAA - Spain) rating.
            "mccypRating": "A String", # The video's rating from the Danish Film Institute's (Det Danske Filminstitut) Media Council for Children and Young People.
            "nfrcRating": "A String", # The video's rating from the Bulgarian National Film Center.
            "skfilmRating": "A String", # The video's rating in Slovakia.
            "mocRating": "A String", # The video's Ministerio de Cultura (Colombia) rating.
            "rcnofRating": "A String", # The video's rating from the Hungarian Nemzeti Filmiroda, the Rating Committee of the National Office of Film.
            "mekuRating": "A String", # The video's rating from Finland's Kansallinen Audiovisuaalinen Instituutti (National Audiovisual Institute).
            "fcbmRating": "A String", # The video's rating from Malaysia's Film Censorship Board.
            "kijkwijzerRating": "A String", # voor de Classificatie van Audiovisuele Media (Netherlands).
          },
          "caption": "A String", # The value of captions indicates whether the video has captions or not.
          "regionRestriction": { # DEPRECATED 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",
            ],
          },
          "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.
          "licensedContent": True or False, # The value of is_license_content indicates whether the video is licensed content.
          "dimension": "A String", # The value of dimension indicates whether the video is available in 3D or in 2D.
        },
        "ageGating": { # Age restriction details related to a video. This data can only be retrieved by the video owner.
          "restricted": True or False, # Age-restricted trailers. For redband trailers and adult-rated video-games. Only users aged 18+ can view the content. The the field is true the content is restricted to viewers aged 18+. Otherwise The field won't be present.
          "alcoholContent": True or False, # Indicates whether or not the video has alcoholic beverage content. Only users of legal purchasing age in a particular country, as identified by ICAP, can view the content.
          "videoGameRating": "A String", # Video game rating, if any.
        },
        "fileDetails": { # Describes original video file properties, including technical details about audio and video streams, but also metadata information like content length, digitization time, or geotagging information. # The fileDetails object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner.
          "bitrateBps": "A String", # The uploaded video file's combined (video and audio) bitrate in bits per second.
          "container": "A String", # The uploaded video file's container format.
          "fileType": "A String", # The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded.
          "creationTime": "A String", # The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported:
              # - Date only: YYYY-MM-DD
              # - Naive time: YYYY-MM-DDTHH:MM:SS
              # - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM
          "durationMs": "A String", # The length of the uploaded video in milliseconds.
          "fileName": "A String", # The uploaded file's name. This field is present whether a video file or another type of file was uploaded.
          "fileSize": "A String", # The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded.
          "videoStreams": [ # A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream.
            { # Information about a video stream.
              "bitrateBps": "A String", # The video stream's bitrate, in bits per second.
              "vendor": "A String", # A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code.
              "codec": "A String", # The video codec that the stream uses.
              "widthPixels": 42, # The encoded video content's width in pixels. You can calculate the video's encoding aspect ratio as width_pixels / height_pixels.
              "heightPixels": 42, # The encoded video content's height in pixels.
              "aspectRatio": 3.14, # The video content's display aspect ratio, which specifies the aspect ratio in which the video should be displayed.
              "rotation": "A String", # The amount that YouTube needs to rotate the original source content to properly display the video.
              "frameRateFps": 3.14, # The video stream's frame rate, in frames per second.
            },
          ],
          "audioStreams": [ # A list of audio streams contained in the uploaded video file. Each item in the list contains detailed metadata about an audio stream.
            { # Information about an audio stream.
              "bitrateBps": "A String", # The audio stream's bitrate, in bits per second.
              "codec": "A String", # The audio codec that the stream uses.
              "vendor": "A String", # A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code.
              "channelCount": 42, # The number of audio channels that the stream contains.
            },
          ],
        },
        "processingDetails": { # Describes processing status and progress and availability of some other Video resource parts. # The processingProgress object encapsulates information about YouTube's progress in processing the uploaded video file. The properties in the object identify the current processing status and an estimate of the time remaining until YouTube finishes processing the video. This part also indicates whether different types of data or content, such as file details or thumbnail images, are available for the video.
            #
            # The processingProgress object is designed to be polled so that the video uploaded can track the progress that YouTube has made in processing the uploaded video file. This data can only be retrieved by the video owner.
          "fileDetailsAvailability": "A String", # This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request.
          "editorSuggestionsAvailability": "A String", # This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request.
          "processingStatus": "A String", # The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed.
          "processingIssuesAvailability": "A String", # This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request.
          "processingFailureReason": "A String", # The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed.
          "thumbnailsAvailability": "A String", # This value indicates whether thumbnail images have been generated for the video.
          "processingProgress": { # Video processing progress and completion time estimate. # The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing.
            "timeLeftMs": "A String", # An estimate of the amount of time, in millseconds, that YouTube needs to finish processing the video.
            "partsProcessed": "A String", # The number of parts of the video that YouTube has already processed. You can estimate the percentage of the video that YouTube has already processed by calculating:
                # 100 * parts_processed / parts_total
                #
                # Note that since the estimated number of parts could increase without a corresponding increase in the number of parts that have already been processed, it is possible that the calculated progress could periodically decrease while YouTube processes a video.
            "partsTotal": "A String", # An estimate of the total number of parts that need to be processed for the video. The number may be updated with more precise estimates while YouTube processes the video.
          },
          "tagSuggestionsAvailability": "A String", # This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request.
        },
        "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