mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-18 06:35:49 -04:00
checking the status code returned by youtube
This commit is contained in:
parent
2e3a7ad044
commit
a11b59bcf7
@ -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…
x
Reference in New Issue
Block a user