mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-11 17:19:35 -04:00
checking the status code returned by youtube
This commit is contained in:
parent
2e3a7ad044
commit
a11b59bcf7
1 changed files with 4 additions and 0 deletions
|
@ -638,6 +638,10 @@ module YoutubeAPI
|
|||
# Send the POST request
|
||||
body = YT_POOL.client() do |client|
|
||||
client.post(url, headers: headers, body: data.to_json) do |response|
|
||||
if response.status_code != 200
|
||||
raise InfoException.new("Error: non 200 status code. Youtube API returned \
|
||||
status code #{response.status_code}")
|
||||
end
|
||||
self._decompress(response.body_io, response.headers["Content-Encoding"]?)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue