mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-20 13:14:27 -05:00
Fix #resolve_url by adding ClientConfig argument
The private `_post_json` method of the YoutubeAPI requires a ClientConfig as the third parameter. This was passed in all Youtube API methods except the `#resolve_url` method.
This commit is contained in:
parent
5b020e81ca
commit
e9add69e26
@ -325,11 +325,14 @@ module YoutubeAPI
|
|||||||
end
|
end
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# resolve_url(url)
|
# resolve_url(url, client_config?)
|
||||||
#
|
#
|
||||||
# Requests the youtubei/v1/navigation/resolve_url endpoint with the
|
# Requests the youtubei/v1/navigation/resolve_url endpoint with the
|
||||||
# required headers and POST data in order to get a JSON reply.
|
# required headers and POST data in order to get a JSON reply.
|
||||||
#
|
#
|
||||||
|
# An optional ClientConfig parameter can be passed, too (see
|
||||||
|
# `struct ClientConfig` above for more details).
|
||||||
|
#
|
||||||
# Output:
|
# Output:
|
||||||
#
|
#
|
||||||
# ```
|
# ```
|
||||||
@ -349,13 +352,13 @@ module YoutubeAPI
|
|||||||
# channel_b = YoutubeAPI.resolve_url("https://youtube.com/c/invalid")
|
# channel_b = YoutubeAPI.resolve_url("https://youtube.com/c/invalid")
|
||||||
# ```
|
# ```
|
||||||
#
|
#
|
||||||
def resolve_url(url : String)
|
def resolve_url(url : String, client_config : ClientConfig | Nil = nil)
|
||||||
data = {
|
data = {
|
||||||
"context" => self.make_context(nil),
|
"context" => self.make_context(nil),
|
||||||
"url" => url,
|
"url" => url,
|
||||||
}
|
}
|
||||||
|
|
||||||
return self._post_json("/youtubei/v1/navigation/resolve_url", data)
|
return self._post_json("/youtubei/v1/navigation/resolve_url", data, client_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user