GData.YouTubeQuery

g GData.Query GData.Query GData.YouTubeQuery GData.YouTubeQuery GData.Query->GData.YouTubeQuery GObject.Object GObject.Object GObject.Object->GData.Query

Subclasses:

None

Methods

Inherited:

GData.Query (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (q)

get_age ()

get_format ()

get_language ()

get_license ()

get_location ()

get_order_by ()

get_restriction ()

get_safe_search ()

get_sort_order ()

get_uploader ()

set_age (age)

set_format (format)

set_language (language)

set_license (license)

set_location (latitude, longitude, radius, has_location)

set_order_by (order_by)

set_restriction (restriction)

set_safe_search (safe_search)

set_sort_order (sort_order)

set_uploader (uploader)

Virtual Methods

Inherited:

GData.Query (1), GObject.Object (7)

Properties

Inherited:

GData.Query (11)

Name

Type

Flags

Short Description

age

GData.YouTubeAge

r/w

Restricts the search to videos uploaded within the specified time period.

format

GData.YouTubeFormat

d/r/w

Specifies that videos must be available in a particular video format. deprecated

has-location

bool

d/r/w

Whether to restrict results to videos with specific coordinates. deprecated

language

str

d/r/w

Restricts the search to videos described in the given language. deprecated

latitude

float

r/w

The latitude of a particular location of which videos should be found.

license

str

r/w

The content license which should be used to filter search results.

location-radius

float

r/w

The radius, in metres, of a circle to search within.

longitude

float

r/w

The longitude of a particular location of which videos should be found.

order-by

str

r/w

Specifies the order of entries in a feed.

restriction

str

r/w

The country code to filter videos playable only in specific countries.

safe-search

GData.YouTubeSafeSearch

r/w

Whether the search results should include restricted content.

sort-order

GData.YouTubeSortOrder

d/r/w

Specifies the direction of sorting. deprecated

uploader

GData.YouTubeUploader

d/r/w

Restricts the search to videos from the specified type of uploader. deprecated

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GData.Query

r

Class Details

class GData.YouTubeQuery(**kwargs)
Bases:

GData.Query

Abstract:

No

Structure:

GData.YouTubeQueryClass

All the fields in the GData.YouTubeQuery structure are private and should never be accessed directly.

New in version 0.3.0.

classmethod new(q)
Parameters:

q (str or None) – a query string, or None

Returns:

a new GData.YouTubeQuery

Return type:

GData.YouTubeQuery

Creates a new GData.YouTubeQuery with its GData.Query :q property set to q.

New in version 0.3.0.

get_age()
Returns:

the age property

Return type:

GData.YouTubeAge

Gets the GData.YouTubeQuery :age property.

New in version 0.3.0.

get_format()
Returns:

the format property

Return type:

GData.YouTubeFormat

Gets the GData.YouTubeQuery :format property.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

get_language()
Returns:

the language property, or None if it is unset

Return type:

str

Gets the GData.YouTubeQuery :language property.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

get_license()
Returns:

the license property, or None if it is unset

Return type:

str

Gets the GData.YouTubeQuery :license property.

New in version 0.11.0.

get_location()
Returns:

latitude:

a location in which to return the latitude, or None

longitude:

a location in which to return the longitude, or None

radius:

a location in which to return the location radius, or None

has_location:

a location in which to return True if the query is searching for videos with a specific location, False otherwise, or None

Return type:

(latitude: float, longitude: float, radius: float, has_location: bool)

Gets the location-based properties of the GData.YouTubeQuery : GData.YouTubeQuery :latitude, GData.YouTubeQuery :longitude, GData.YouTubeQuery :location-radius and GData.YouTubeQuery :has-location.

New in version 0.3.0.

get_order_by()
Returns:

the order by property, or None if it is unset

Return type:

str

Gets the GData.YouTubeQuery :order-by property.

New in version 0.3.0.

get_restriction()
Returns:

the restriction property, or None if it is unset

Return type:

str

Gets the GData.YouTubeQuery :restriction property.

New in version 0.3.0.

Returns:

the safe search property

Return type:

GData.YouTubeSafeSearch

Gets the GData.YouTubeQuery :safe-search property.

New in version 0.3.0.

get_sort_order()
Returns:

the sort order property

Return type:

GData.YouTubeSortOrder

Gets the GData.YouTubeQuery :sort-order property.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

get_uploader()
Returns:

the uploader property

Return type:

GData.YouTubeUploader

Gets the GData.YouTubeQuery :uploader property.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

set_age(age)
Parameters:

age (GData.YouTubeAge) – the new age

Sets the GData.YouTubeQuery :age property of the GData.YouTubeQuery to age.

New in version 0.3.0.

set_format(format)
Parameters:

format (GData.YouTubeFormat) – the requested video format

Sets the GData.YouTubeQuery :format property of the GData.YouTubeQuery to format.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

set_language(language)
Parameters:

language (str or None) – a new language name, or None

Sets the GData.YouTubeQuery :language property of the GData.YouTubeQuery to the new language, language.

Set language to None to unset the property in the query URI.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

set_license(license)
Parameters:

license (str or None) – a new license value, or None

Sets the GData.YouTubeQuery :license property of the GData.YouTubeQuery to the new license value, license.

Set license to None to unset the property in the query URI.

New in version 0.11.0.

set_location(latitude, longitude, radius, has_location)
Parameters:

Sets the location-based properties of the GData.YouTubeQuery : GData.YouTubeQuery :latitude, GData.YouTubeQuery :longitude, GData.YouTubeQuery :location-radius and GData.YouTubeQuery :has-location.

New in version 0.3.0.

set_order_by(order_by)
Parameters:

order_by (str or None) – a new order by string, or None

Sets the GData.YouTubeQuery :order-by property of the GData.YouTubeQuery to the new order by string, order_by.

Set order_by to None to unset the property in the query URI.

New in version 0.3.0.

set_restriction(restriction)
Parameters:

restriction (str or None) – a new restriction string, or None

Sets the GData.YouTubeQuery :restriction property of the GData.YouTubeQuery to the new restriction string, restriction.

Set restriction to None to unset the property in the query URI.

New in version 0.3.0.

Parameters:

safe_search (GData.YouTubeSafeSearch) – a new safe search level

Sets the GData.YouTubeQuery :safe-search property of the GData.YouTubeQuery to safe_search.

New in version 0.3.0.

set_sort_order(sort_order)
Parameters:

sort_order (GData.YouTubeSortOrder) – the new sort order

Sets the GData.YouTubeQuery :sort-order property of the GData.YouTubeQuery to sort_order.

Set sort_order to GData.YouTubeSortOrder.NONE to unset the property in the query URI.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

set_uploader(uploader)
Parameters:

uploader (GData.YouTubeUploader) – the new uploader

Sets the GData.YouTubeQuery :uploader property of the GData.YouTubeQuery to uploader.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Property Details

GData.YouTubeQuery.props.age
Name:

age

Type:

GData.YouTubeAge

Default Value:

GData.YouTubeAge.ALL_TIME

Flags:

READABLE, WRITABLE

Restricts the search to videos uploaded within the specified time period. To retrieve videos irrespective of their age, set the property to GData.YouTubeAge.ALL_TIME.

New in version 0.3.0.

GData.YouTubeQuery.props.format
Name:

format

Type:

GData.YouTubeFormat

Default Value:

GData.YouTubeFormat.UNKNOWN

Flags:

DEPRECATED, READABLE, WRITABLE

Specifies that videos must be available in a particular video format. Use GData.YouTubeFormat.UNKNOWN to retrieve videos irrespective of their format availability.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

GData.YouTubeQuery.props.has_location
Name:

has-location

Type:

bool

Default Value:

False

Flags:

DEPRECATED, READABLE, WRITABLE

Whether to restrict search results to videos with specific coordinates associated with them. If used with a given GData.YouTubeQuery :latitude and GData.YouTubeQuery :longitude, only videos with specific coordinates (not those with merely a descriptive address) will be returned. If used without a latitude and longitude set, only videos with specific coordinates (regardless of those coordinates) will be returned.

For more information, see the documentation for GData.YouTubeQuery :latitude.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries.

GData.YouTubeQuery.props.language
Name:

language

Type:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE

Restricts the search to videos that have a title, description or keywords in a specified language. The language code should be a two-letter ISO 639-1 code; or you can use zh-Hans for simplified Chinese and zh-Hant for traditional Chinese.

For more information, see the online documentation.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

GData.YouTubeQuery.props.latitude
Name:

latitude

Type:

float

Default Value:

1.7976931348623157e+308

Flags:

READABLE, WRITABLE

The latitude of a particular location of which videos should be found. This should be used in conjunction with GData.YouTubeQuery :longitude; if either property is outside the valid range, neither will be used. Valid latitudes are between -90 and 900 degrees; any values of this property outside that range will unset the property in the query URI.

If GData.YouTubeQuery :location-radius is a non-0 value, this will define a circle from which videos should be found.

As it is deprecated, the value of GData.YouTubeQuery :has-location is ignored.

For more information, see the online documentation.

New in version 0.3.0.

GData.YouTubeQuery.props.license
Name:

license

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The content license which should be used to filter search results. If set to, for example, GData.YOUTUBE_LICENSE_CC, only videos which are Creative Commons licensed will be returned in search results. Set this to None to return videos under any license.

For more information, see the online documentation.

New in version 0.11.0.

GData.YouTubeQuery.props.location_radius
Name:

location-radius

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The radius, in metres, of a circle from within which videos should be returned. The circle is centred on the latitude and longitude given in GData.YouTubeQuery :latitude and GData.YouTubeQuery :longitude.

Set this property to 0 to search for specific coordinates, rather than within a given radius.

For more information, see the documentation for GData.YouTubeQuery :latitude.

New in version 0.3.0.

GData.YouTubeQuery.props.longitude
Name:

longitude

Type:

float

Default Value:

1.7976931348623157e+308

Flags:

READABLE, WRITABLE

The longitude of a particular location of which videos should be found. This should be used in conjunction with GData.YouTubeQuery :latitude; if either property is outside the valid range, neither will be used. Valid longitudes are between -180 and 180 degrees; any values of this property outside that range will unset the property in the query URI.

For more information, see the documentation for GData.YouTubeQuery :latitude.

New in version 0.3.0.

GData.YouTubeQuery.props.order_by
Name:

order-by

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Specifies the order of entries in a feed. Supported values are relevance, published, viewCount and rating.

Additionally, results most relevant to a specific language can be returned by setting the property to relevance_lang_languageCode, where languageCode is an ISO 639-1 language code, as used in GData.YouTubeQuery :language.

For more information, see the online documentation.

New in version 0.3.0.

GData.YouTubeQuery.props.restriction
Name:

restriction

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

An ISO 3166 two-letter country code that should be used to filter videos playable only in specific countries.

Previously, this property could also accept the client’s IP address for country lookup. This feature is no longer supported by Google, and will result in an error from the server if used. Use a country code instead.

For more information, see the online documentation.

New in version 0.3.0.

Name:

safe-search

Type:

GData.YouTubeSafeSearch

Default Value:

GData.YouTubeSafeSearch.MODERATE

Flags:

READABLE, WRITABLE

Whether the search results should include restricted content as well as standard content.

For more information, see the online documentation.

New in version 0.3.0.

GData.YouTubeQuery.props.sort_order
Name:

sort-order

Type:

GData.YouTubeSortOrder

Default Value:

GData.YouTubeSortOrder.NONE

Flags:

DEPRECATED, READABLE, WRITABLE

Specifies the direction of sorting. To use the default sort order, set the property to GData.YouTubeSortOrder.NONE.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

GData.YouTubeQuery.props.uploader
Name:

uploader

Type:

GData.YouTubeUploader

Default Value:

GData.YouTubeUploader.ALL

Flags:

DEPRECATED, READABLE, WRITABLE

Restricts the search to videos from the specified type of uploader. Currently, this can only be used to restrict searches to videos from YouTube partners.

New in version 0.3.0.

Deprecated since version 0.17.0: No longer supported by Google. The value of this property will be unused in queries. There is no replacement.