GData.YouTubeVideo¶
- Subclasses:
None
Methods¶
- Inherited:
GData.Entry (24), GData.Parsable (5), GObject.Object (37), GData.Commentable (9)
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
GData.Parsable (9), GObject.Object (7), GData.Commentable (3)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The aspect ratio of the video. |
||
r |
The average rating of the video. |
||
r/w |
Specifies a genre or developer tag that describes the video. |
||
d/r |
Identifies the owner of the video. |
||
r/w |
A summary or description of the video. |
||
r |
The duration of the video in seconds. |
||
r |
The number of users who have added the video to their favorites. |
||
d/r/w |
Indicates whether the video is in draft, or unpublished, status. |
||
r/w |
Indicates whether the video is private. |
||
[ |
r/w |
A |
|
r/w |
The location as a latitude coordinate associated with this video. |
||
r/w |
Descriptive text about the location where the video was taken. |
||
r/w |
The location as a longitude coordinate associated with this video. |
||
r |
The maximum allowed rating for the video. |
||
r |
The minimum allowed rating for the video. |
||
r |
A URI for a browser-based media player for the full-length video. |
||
r |
The number of times the video has been rated. |
||
r/w |
Specifies the time the video was originally recorded. |
||
r |
Information describing the state of the video. |
||
r |
Specifies the time the video was originally uploaded to YouTube. |
||
d/r |
Specifies a unique ID which YouTube uses to identify the video. |
||
r |
The number of times the video has been viewed. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GData.YouTubeVideo(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
GData.YouTubeVideo
structure are private and should never be accessed directly.- classmethod get_video_id_from_uri(video_uri)¶
- Parameters:
video_uri (
str
) – a YouTube video player URI- Returns:
- Return type:
Extracts a video ID from a YouTube video player URI. The video ID is in the same form as returned by
GData.YouTubeVideo.get_video_id
(), and the video_uri should be in the same form as returned byGData.YouTubeVideo.get_player_uri
().The function will validate whether the URI actually points to a hostname containing <literal>youtube</literal> (e.g. <literal>youtube.com</literal>), and will return
None
if it doesn’t.For example: <informalexample><programlisting> video_id =
GData.YouTubeVideo.get_video_id_from_uri
(“http://www.youtube.com/watch?v=BH_vwsyCrTc&feature=featured”); g_message (“Video ID: %s”, video_id); /<!– –>* Should print: BH_vwsyCrTc *<!– –>/GLib.free
(video_id); </programlisting></informalexample>New in version 0.4.0.
- classmethod new(id)¶
- Parameters:
- Returns:
a new
GData.YouTubeVideo
; unref withGObject.Object.unref
()- Return type:
Creates a new
GData.YouTubeVideo
with the given ID and default properties.
- get_access_control(action)¶
- Parameters:
action (
str
) – the action whose permission should be returned- Returns:
the permission associated with action, or
GData.YouTubePermission.DENIED
- Return type:
Gets the permission associated with the given action on the
GData.YouTubeVideo
. If the given action doesn’t have a permission set on the video,GData.YouTubePermission.DENIED
is returned.New in version 0.7.0.
- get_aspect_ratio()¶
-
Gets the
GData.YouTubeVideo
:aspect-ratio
property.New in version 0.4.0.
- get_category()¶
- Returns:
a
GData.MediaCategory
giving the video’s single and mandatory category- Return type:
Gets the
GData.YouTubeVideo
:category
property.
- get_coordinates()¶
- Returns:
- Return type:
Gets the
GData.YouTubeVideo
:latitude
andGData.YouTubeVideo
:longitude
properties, setting the out parameters to them. If either latitude or longitude isNone
, that parameter will not be set. If the coordinates are unset, latitude and longitude will be set toGObject.G_MAXDOUBLE
.New in version 0.8.0.
- get_credit()¶
- Returns:
a
GData.MediaCredit
giving information on whom to credit for the video, orNone
- Return type:
Gets the
GData.YouTubeVideo
:credit
property.Deprecated since version 0.17.0: This is no longer supported by Google, and will always return
None
. There is no replacement.
- get_description()¶
-
Gets the
GData.YouTubeVideo
:description
property.
- get_duration()¶
- Returns:
the video duration in seconds, or 0 if unknown
- Return type:
Gets the
GData.YouTubeVideo
:duration
property.
- get_favorite_count()¶
- Returns:
the number of users who have added the video to their favorites list
- Return type:
Gets the
GData.YouTubeVideo
:favorite-count
property.
- get_keywords()¶
-
Gets the
GData.YouTubeVideo
:keywords
property.
- get_location()¶
-
Gets the
GData.YouTubeVideo
:location
property.
- get_media_rating(rating_type)¶
- Parameters:
rating_type (
str
) – the type of rating to retrieve- Returns:
the rating of the video for the given rating_type, or
None
if the video isn’t rated with that type (or the type is unknown)- Return type:
Returns the rating of the given type for the video, if one exists. For example, this could be a film rating awarded by the MPAA; or a simple rating specifying whether the video contains adult content.
The valid values for rating_type are:
GData.YOUTUBE_RATING_TYPE_MPAA
andGData.YOUTUBE_RATING_TYPE_V_CHIP
. Further values may be added in future; if an unknown rating type is passed to the function,None
will be returned.The possible return values depend on what’s passed to rating_type. Valid values for each rating type are listed in the documentation for the rating types.
New in version 0.10.0.
- get_player_uri()¶
-
Gets the
GData.YouTubeVideo
:player-uri
property.
- get_rating()¶
- Returns:
- Return type:
Gets various properties of the ratings on the video.
Note that this property may not be retrieved when querying for multiple videos at once, but is guaranteed to be retrieved when querying with
GData.Service.query_single_entry_async
().
- get_recorded()¶
- Returns:
the UNIX timestamp for the time the video was recorded, or -1
- Return type:
Gets the
GData.YouTubeVideo
:recorded
property. If the property is unset, -1 will be returned.New in version 0.3.0.
- get_state()¶
- Returns:
a
GData.YouTubeState
showing the state of the video, orNone
- Return type:
Gets the
GData.YouTubeVideo
:state
property.For more information, see the online documentation.
- get_thumbnails()¶
- Returns:
a
GLib.List
ofGData.MediaThumbnails
, orNone
- Return type:
Gets a list of the thumbnails available for the video.
- get_uploaded()¶
- Returns:
the UNIX timestamp for the time the video was uploaded, or -1
- Return type:
Gets the
GData.YouTubeVideo
:uploaded
property. If the property is unset, -1 will be returned.
- get_video_id()¶
- Returns:
the video’s unique and permanent ID
- Return type:
Gets the
GData.YouTubeVideo
:video-id
property.Deprecated since version 0.17.0: This is now equal to
GData.Entry
:id
.
- get_view_count()¶
- Returns:
the number of times the video has been viewed
- Return type:
Gets the
GData.YouTubeVideo
:view-count
property.
- is_draft()¶
-
Gets the
GData.YouTubeVideo
:is-draft
property.Deprecated since version 0.17.0: This is now equal to
GData.YouTubeVideo.is_private
().
- is_private()¶
-
Gets the
GData.YouTubeVideo
:is-private
property.
- is_restricted_in_country(country)¶
- Parameters:
country (
str
) – an ISO 3166 two-letter country code to check- Returns:
- Return type:
Checks whether viewing of the video is restricted in country, either by its content rating, or by the request of the producer. The return value from this function is purely informational, and no obligation is assumed.
New in version 0.4.0.
- look_up_content(type)¶
- Parameters:
type (
str
) – the MIME type of the content desired- Returns:
a
GData.YouTubeContent
matching type, orNone
- Return type:
Looks up a
GData.YouTubeContent
from the video with the given MIME type. The video’s list of contents is a list of URIs to various formats of the video itself, such as its SWF URI or RTSP stream.Deprecated since version 0.17.0: This is no longer supported by Google, and will always return
None
. To view a video, open the URI returned byGData.YouTubeVideo.get_player_uri
() in a web browser.
- set_access_control(action, permission)¶
- Parameters:
action (
str
) – the action whose permission is being setpermission (
GData.YouTubePermission
) – the permission to give to the action
Sets the permission associated with action on the
GData.YouTubeVideo
, allowing restriction or derestriction of various operations on YouTube videos.Note that only
GData.YOUTUBE_ACTION_RATE
andGData.YOUTUBE_ACTION_COMMENT
actions can have theGData.YouTubePermission.MODERATED
permission.New in version 0.7.0.
- set_aspect_ratio(aspect_ratio)¶
-
Sets the
GData.YouTubeVideo
:aspect-ratio
property to specify the video’s aspect ratio. If aspect_ratio isNone
, the property will be unset.New in version 0.4.0.
- set_category(category)¶
- Parameters:
category (
GData.MediaCategory
) – a newGData.MediaCategory
Sets the
GData.YouTubeVideo
:category
property to the new category, category, and increments its reference count.category must not be
None
. For more information, see the online documentation.
- set_coordinates(latitude, longitude)¶
- Parameters:
latitude (
float
) – the video’s new latitude coordinate, orGObject.G_MAXDOUBLE
longitude (
float
) – the video’s new longitude coordinate, orGObject.G_MAXDOUBLE
Sets the
GData.YouTubeVideo
:latitude
andGData.YouTubeVideo
:longitude
properties to latitude and longitude respectively.New in version 0.8.0.
- set_description(description)¶
-
Sets the
GData.YouTubeVideo
:description
property to the new description, description.Set description to
None
to unset the video’s description.
- set_is_draft(is_draft)¶
- Parameters:
is_draft (
bool
) – whether the video is a draft
Sets the
GData.YouTubeVideo
:is-draft
property to decide whether the video is a draft.Deprecated since version 0.17.0: This is now equivalent to
GData.YouTubeVideo.set_is_private
().
- set_is_private(is_private)¶
- Parameters:
is_private (
bool
) – whether the video is private
Sets the
GData.YouTubeVideo
:is-private
property to decide whether the video is publicly viewable.
- set_keywords(keywords)¶
-
Sets the
GData.YouTubeVideo
:keywords
property to the new keyword list, keywords.keywords must not be
None
. For more information, see the online documentation.
- set_location(location)¶
-
Sets the
GData.YouTubeVideo
:location
property to the new location string, location.Set location to
None
to unset the property in the video.
- set_recorded(recorded)¶
- Parameters:
recorded (
int
) – the video’s new recorded time, or -1
Sets the
GData.YouTubeVideo
:recorded
property to the new recorded time, recorded.Set recorded to -1 to unset the video’s recorded time.
New in version 0.3.0.
Property Details¶
- GData.YouTubeVideo.props.aspect_ratio¶
-
The aspect ratio of the video. A
None
value means the aspect ratio is unknown (it could still be a widescreen video). A value ofGData.YOUTUBE_ASPECT_RATIO_WIDESCREEN
means the video is definitely widescreen.New in version 0.4.0.
- GData.YouTubeVideo.props.average_rating¶
-
The average rating of the video, over all the ratings it’s received.
For more information, see the online documentation.
- GData.YouTubeVideo.props.category¶
- Name:
category
- Type:
- Default Value:
- Flags:
Specifies a genre or developer tag that describes the video.
For more information, see the online documentation.
- GData.YouTubeVideo.props.credit¶
- Name:
credit
- Type:
- Default Value:
- Flags:
Identifies the owner of the video.
Deprecated since version 0.17.0: This is no longer supported by Google, and will always be
None
. There is no replacement.
- GData.YouTubeVideo.props.description¶
-
A summary or description of the video.
For more information, see the online documentation.
- GData.YouTubeVideo.props.duration¶
-
The duration of the video in seconds.
For more information, see the online documentation.
- GData.YouTubeVideo.props.favorite_count¶
-
The number of users who have added the video to their favorites.
For more information, see the online documentation.
- GData.YouTubeVideo.props.is_draft¶
- Name:
is-draft
- Type:
- Default Value:
- Flags:
Indicates whether the video is in draft, or unpublished, status.
Deprecated since version 0.17.0: This is now equal to
GData.YouTubeVideo
:is-private
.
- GData.YouTubeVideo.props.is_private¶
-
Indicates whether the video is private.
- GData.YouTubeVideo.props.keywords¶
-
A
None
-terminated array of words associated with the video.For more information, see the online documentation.
- GData.YouTubeVideo.props.latitude¶
-
The location as a latitude coordinate associated with this video. Valid latitudes range from -90.0 to 90.0 inclusive. Set to a value outside this range to unset the location.
For more information, see the
New in version 0.8.0.
- GData.YouTubeVideo.props.location¶
-
Descriptive text about the location where the video was taken.
For more information, see the online documentation.
- GData.YouTubeVideo.props.longitude¶
-
The location as a longitude coordinate associated with this video. Valid longitudes range from -180.0 to 180.0 inclusive. Set to a value outside this range to unset the location.
For more information, see the
New in version 0.8.0.
- GData.YouTubeVideo.props.max_rating¶
-
The maximum allowed rating for the video.
For more information, see the online documentation.
- GData.YouTubeVideo.props.min_rating¶
-
The minimum allowed rating for the video.
For more information, see the online documentation.
- GData.YouTubeVideo.props.player_uri¶
-
A URI for a browser-based media player for the full-length video (i.e. the video’s page on YouTube).
- GData.YouTubeVideo.props.rating_count¶
-
The number of times the video has been rated.
For more information, see the online documentation.
- GData.YouTubeVideo.props.recorded¶
-
Specifies the time the video was originally recorded.
For more information, see the online documentation.
New in version 0.3.0.
- GData.YouTubeVideo.props.state¶
- Name:
state
- Type:
- Default Value:
- Flags:
Information describing the state of the video. If this is non-
None
, the video is not playable. It points to aGData.YouTubeState
.For more information, see the online documentation.
- GData.YouTubeVideo.props.uploaded¶
-
Specifies the time the video was originally uploaded to YouTube.
For more information, see the online documentation.
- GData.YouTubeVideo.props.video_id¶
- Name:
video-id
- Type:
- Default Value:
- Flags:
Specifies a unique ID which YouTube uses to identify the video. For example:
qz8EfkS4KK0
.For more information, see the online documentation.
Deprecated since version 0.17.0: This is now equal to
GData.Entry
:id
.
- GData.YouTubeVideo.props.view_count¶
-
The number of times the video has been viewed.
For more information, see the online documentation.