struct YoutubeAPI::ClientConfig
- YoutubeAPI::ClientConfig
- Struct
- Value
- Object
Overview
################################################################### struct ClientConfig
Data structure used to pass a client configuration to the different API endpoints handlers.
Use case examples:
# Get Norwegian search results
conf_1 = ClientConfig.new(region: "NO")
YoutubeAPI::search("Kollektivet", params: "", client_config: conf_1)
# Use the Android client to request video streams URLs
conf_2 = ClientConfig.new(client_type: ClientType::Android)
YoutubeAPI::player(video_id: "dQw4w9WgXcQ", client_config: conf_2)
# Proxy request through russian proxies
conf_3 = ClientConfig.new(proxy_region: "RU")
YoutubeAPI::next({video_id: "dQw4w9WgXcQ"}, client_config: conf_3)
Defined in:
invidious/helpers/youtube_api.crConstructors
-
.new(*, client_type : YoutubeAPI::ClientType = ClientType::Web, region : Nil | String = "US", proxy_region : Nil | String = nil)
Initialization function
Instance Method Summary
-
#api_key : String
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
-
#client_type : ClientType
Type of client to emulate.
-
#client_type=(client_type : ClientType)
Type of client to emulate.
-
#name : String
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
-
#proxy_region : String | Nil
ISO code of country where the proxy is located.
-
#proxy_region=(proxy_region : String | Nil)
ISO code of country where the proxy is located.
-
#region : String | Nil
Region to provide to youtube, e.g to alter search results (this is passed as the
gl
parmeter). -
#region=(region : String | Nil)
Region to provide to youtube, e.g to alter search results (this is passed as the
gl
parmeter). -
#screen : String
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
-
#to_s
Convert to string, for logging purposes
-
#version : String
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
Constructor Detail
Initialization function
Instance Method Detail
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
Type of client to emulate.
See enum ClientType
and HARDCODED_CLIENTS
.
Type of client to emulate.
See enum ClientType
and HARDCODED_CLIENTS
.
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
ISO code of country where the proxy is located. Used in case of geo-restricted videos.
ISO code of country where the proxy is located. Used in case of geo-restricted videos.
Region to provide to youtube, e.g to alter search results
(this is passed as the gl
parmeter).
Region to provide to youtube, e.g to alter search results
(this is passed as the gl
parmeter).
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)
Getter functions that provides easy access to hardcoded clients parameters (name/version strings and related API key)