GData.YouTubeService¶
- Subclasses:
- None 
Methods¶
- Inherited:
- GData.Service (27), GObject.Object (37), GData.Batchable (1) 
- Structs:
| class | |
| class | 
 | 
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | 
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| r/w/co | Your YouTube developer API key. | 
Signals¶
- Inherited:
Fields¶
- Inherited:
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | r | 
Class Details¶
- class GData.YouTubeService(**kwargs)¶
- Bases:
- Abstract:
- No 
- Structure:
 - All the fields in the - GData.YouTubeServicestructure are private and should never be accessed directly.- classmethod get_primary_authorization_domain()¶
- Returns:
- the service’s authorization domain 
- Return type:
 - The primary - GData.AuthorizationDomainfor interacting with YouTube. This will not normally need to be used, as it’s used internally by the- GData.YouTubeServicemethods. However, if using the plain- GData.Servicemethods to implement custom queries or requests which libgdata does not support natively, then this domain may be needed to authorize the requests.- The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. - New in version 0.9.0. 
 - classmethod new(developer_key, authorizer)¶
- Parameters:
- developer_key ( - str) – your application’s developer API key
- authorizer ( - GData.Authorizeror- None) – a- GData.Authorizerto authorize the service’s requests, or- None
 
- Returns:
- a new - GData.YouTubeService, or- None; unref with- GObject.Object.unref()
- Return type:
 - Creates a new - GData.YouTubeServiceusing the given- GData.Authorizer. If authorizer is- None, all requests are made as an unauthenticated user. The developer_key must be unique for your application, and as- New in version 0.9.0. 
 - finish_video_upload(upload_stream)¶
- Parameters:
- upload_stream ( - GData.UploadStream) – the- GData.UploadStreamfrom the operation
- Raises:
- Returns:
- the new - GData.YouTubeVideo, or- None; unref with- GObject.Object.unref()
- Return type:
 - Finish off a video upload operation started by - GData.YouTubeService.upload_video(), parsing the result and returning the new- GData.YouTubeVideo.- If an error occurred during the upload operation, it will have been returned during the operation (e.g. by - Gio.OutputStream.splice() or one of the other stream methods). In such a case,- Nonewill be returned but error will remain unset. error is only set in the case that the server indicates that the operation was successful, but an error is encountered in parsing the result sent by the server.- New in version 0.8.0. 
 - get_categories(cancellable)¶
- Parameters:
- cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellable, or- None
- Raises:
- Returns:
- a - GData.APPCategories, or- None; unref with- GObject.Object.unref()
- Return type:
 - Gets a list of the categories currently in use on YouTube. The returned - GData.APPCategoriescontains a list of- GData.YouTubeCategoryswhich enumerate the current YouTube categories.- The category labels ( - GData.Category- :label) are localised based on the value of- GData.Service- :locale.- New in version 0.7.0. 
 - get_categories_async(cancellable, callback, *user_data)¶
- Parameters:
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- callback ( - Gio.AsyncReadyCallbackor- None) – a- Gio.AsyncReadyCallbackto call when the request is finished
- user_data ( - objector- None) – data to pass to the callback function
 
 - Gets a list of the categories currently in use on YouTube. self is reffed when this function is called, so can safely be unreffed after this function returns. - For more details, see - GData.YouTubeService.get_categories(), which is the synchronous version of this function.- When the operation is finished, callback will be called. You can then call - GData.YouTubeService.get_categories_finish() to get the results of the operation.- New in version 0.7.0. 
 - get_categories_finish(async_result)¶
- Parameters:
- async_result ( - Gio.AsyncResult) – a- Gio.AsyncResult
- Raises:
- Returns:
- a - GData.APPCategories, or- None; unref with- GObject.Object.unref()
- Return type:
 - Finishes an asynchronous request for a list of categories on YouTube, as started with - GData.YouTubeService.get_categories_async().- New in version 0.7.0. 
 - get_developer_key()¶
- Returns:
- the developer key property 
- Return type:
 - Gets the - GData.YouTubeService- :developer-keyproperty from the- GData.YouTubeService.
 - Parameters:
- video ( - GData.YouTubeVideo) – a- GData.YouTubeVideofor which to find related videos
- query ( - GData.Queryor- None) – a- GData.Querywith the query parameters, or- None
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- progress_callback ( - GData.QueryProgressCallbackor- None) – a- GData.QueryProgressCallbackto call when an entry is loaded, or- None
- progress_user_data ( - objector- None) – data to pass to the progress_callback function
 
- Raises:
- Returns:
- a - GData.Feedof query results; unref with- GObject.Object.unref()
- Return type:
 - Queries the service for videos related to video. The algorithm determining which videos are related is on the server side. - Parameters and other errors are as for - GData.Service.query().
 - Parameters:
- video ( - GData.YouTubeVideo) – a- GData.YouTubeVideofor which to find related videos
- query ( - GData.Queryor- None) – a- GData.Querywith the query parameters, or- None
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- progress_callback ( - GData.QueryProgressCallbackor- None) – a- GData.QueryProgressCallbackto call when an entry is loaded, or- None
- progress_user_data ( - objector- None) – data to pass to the progress_callback function
- callback ( - Gio.AsyncReadyCallbackor- None) – a- Gio.AsyncReadyCallbackto call when authentication is finished
- user_data ( - objector- None) – data to pass to the callback function
 
 - Queries the service for videos related to video. The algorithm determining which videos are related is on the server side. self and query are both reffed when this function is called, so can safely be freed after this function returns. - For more details, see - GData.YouTubeService.query_related(), which is the synchronous version of this function.- When the operation is finished, callback will be called. You can then call - GData.Service.query_finish() to get the results of the operation.- New in version 0.9.1. 
 - query_standard_feed(feed_type, query, cancellable, progress_callback, *progress_user_data)¶
- Parameters:
- feed_type ( - GData.YouTubeStandardFeedType) – the feed type to query, from- GData.YouTubeStandardFeedType
- query ( - GData.Queryor- None) – a- GData.Querywith the query parameters, or- None
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- progress_callback ( - GData.QueryProgressCallbackor- None) – a- GData.QueryProgressCallbackto call when an entry is loaded, or- None
- progress_user_data ( - objector- None) – data to pass to the progress_callback function
 
- Raises:
- Returns:
- a - GData.Feedof query results, or- None; unref with- GObject.Object.unref()
- Return type:
 - Queries the service’s standard feed_type feed to build a - GData.Feed.- Note that with the port from v2 to v3 of the YouTube API in libgdata 0.17.0, all feed types except - GData.YouTubeStandardFeedType.MOST_POPULAR_FEEDhave been deprecated. Other feed types will now transparently return- GData.YouTubeStandardFeedType.MOST_POPULAR_FEED, limited to the past 24 hours.- Parameters and errors are as for - GData.Service.query().
 - query_standard_feed_async(feed_type, query, cancellable, progress_callback, progress_user_data, callback, *user_data)¶
- Parameters:
- feed_type ( - GData.YouTubeStandardFeedType) – the feed type to query, from- GData.YouTubeStandardFeedType
- query ( - GData.Queryor- None) – a- GData.Querywith the query parameters, or- None
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- progress_callback ( - GData.QueryProgressCallbackor- None) – a- GData.QueryProgressCallbackto call when an entry is loaded, or- None
- progress_user_data ( - objector- None) – data to pass to the progress_callback function
- callback ( - Gio.AsyncReadyCallbackor- None) – a- Gio.AsyncReadyCallbackto call when authentication is finished
- user_data ( - objector- None) – data to pass to the callback function
 
 - Queries the service’s standard feed_type feed to build a - GData.Feed. self and query are both reffed when this function is called, so can safely be freed after this function returns.- For more details, see - GData.YouTubeService.query_standard_feed(), which is the synchronous version of this function.- When the operation is finished, callback will be called. You can then call - GData.Service.query_finish() to get the results of the operation.- New in version 0.9.1. 
 - query_videos(query, cancellable, progress_callback, *progress_user_data)¶
- Parameters:
- query ( - GData.Queryor- None) – a- GData.Querywith the query parameters, or- None
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- progress_callback ( - GData.QueryProgressCallbackor- None) – a- GData.QueryProgressCallbackto call when an entry is loaded, or- None
- progress_user_data ( - objector- None) – data to pass to the progress_callback function
 
- Raises:
- Returns:
- a - GData.Feedof query results, or- None; unref with- GObject.Object.unref()
- Return type:
 - Queries the service for videos matching the parameters set on the - GData.Query. This searches site-wide, and imposes no other restrictions or parameters on the query.- Parameters and errors are as for - GData.Service.query().
 - query_videos_async(query, cancellable, progress_callback, progress_user_data, callback, *user_data)¶
- Parameters:
- query ( - GData.Queryor- None) – a- GData.Querywith the query parameters, or- None
- cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None
- progress_callback ( - GData.QueryProgressCallbackor- None) – a- GData.QueryProgressCallbackto call when an entry is loaded, or- None
- progress_user_data ( - objector- None) – data to pass to the progress_callback function
- callback ( - Gio.AsyncReadyCallbackor- None) – a- Gio.AsyncReadyCallbackto call when authentication is finished
- user_data ( - objector- None) – data to pass to the callback function
 
 - Queries the service for videos matching the parameters set on the - GData.Query. This searches site-wide, and imposes no other restrictions or parameters on the query. self and query are both reffed when this function is called, so can safely be freed after this function returns.- For more details, see - GData.YouTubeService.query_videos(), which is the synchronous version of this function.- When the operation is finished, callback will be called. You can then call - GData.Service.query_finish() to get the results of the operation.- New in version 0.9.1. 
 - upload_video(video, slug, content_type, cancellable)¶
- Parameters:
- video ( - GData.YouTubeVideo) – a- GData.YouTubeVideoto insert
- slug ( - str) – the filename to give to the uploaded file
- content_type ( - str) – the content type of the uploaded data
- cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellablefor the entire upload stream, or- None
 
- Raises:
- Returns:
- a - GData.UploadStreamto write the video data to, or- None; unref with- GObject.Object.unref()
- Return type:
 - Uploads a video to YouTube, using the properties from video and the file data written to the resulting - GData.UploadStream.- If video has already been inserted, a - GData.ServiceError.ENTRY_ALREADYSERTEDerror will be returned. If no user is authenticated with the service,- GData.ServiceError.AUTHENTICATION_REQUIREDwill be returned.- The stream returned by this function should be written to using the standard - Gio.OutputStreammethods, asynchronously or synchronously. Once the stream is closed (using- Gio.OutputStream.close()),- GData.YouTubeService.finish_video_upload() should be called on it to parse and return the updated- GData.YouTubeVideofor the uploaded video. This must be done, as video isn’t updated in-place.- In order to cancel the upload, a - Gio.Cancellablepassed in to cancellable must be cancelled using- Gio.Cancellable.cancel(). Cancelling the individual- Gio.OutputStreamoperations on the- GData.UploadStreamwill not cancel the entire upload; merely the write or close operation in question. See the- GData.UploadStream- :cancellablefor more details.- Any upload errors will be thrown by the stream methods, and may come from the - GData.ServiceErrordomain.- New in version 0.8.0. 
 
Property Details¶
- GData.YouTubeService.props.developer_key¶
- Name:
- developer-key
- Type:
- Default Value:
- Flags:
 - The developer key your application has registered with the YouTube API. For more information, see the online documentation. - With the port from v2 to v3 of the YouTube API in libgdata 0.17.0, it might be necessary to update your application’s developer key.