diff options
| author | syeopite <70992037+syeopite@users.noreply.github.com> | 2021-08-03 00:48:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-03 00:48:58 -0700 |
| commit | e9add69e267c143925ba51d54c03deaba2e0e85a (patch) | |
| tree | 54c9899e24e6b3fb5fac28c231815d72ba9ed572 /src | |
| parent | 5b020e81cae7db93d67b9228e14fe94778966be6 (diff) | |
| download | invidious-e9add69e267c143925ba51d54c03deaba2e0e85a.tar.gz invidious-e9add69e267c143925ba51d54c03deaba2e0e85a.tar.bz2 invidious-e9add69e267c143925ba51d54c03deaba2e0e85a.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/helpers/youtube_api.cr | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/invidious/helpers/youtube_api.cr b/src/invidious/helpers/youtube_api.cr index a5b4b2d5..4ed707f6 100644 --- a/src/invidious/helpers/youtube_api.cr +++ b/src/invidious/helpers/youtube_api.cr @@ -325,11 +325,14 @@ module YoutubeAPI end #################################################################### - # resolve_url(url) + # resolve_url(url, client_config?) # # Requests the youtubei/v1/navigation/resolve_url endpoint with the # 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: # # ``` @@ -349,13 +352,13 @@ module YoutubeAPI # 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 = { "context" => self.make_context(nil), "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 #################################################################### |
