mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 00:29:53 +05:30
Handle non-200 status codes for YouTube DASH manifests
This commit is contained in:
parent
cf686202e0
commit
72bcd3cc72
@ -21,7 +21,13 @@ module Invidious::Routes::API::Manifest
|
|||||||
end
|
end
|
||||||
|
|
||||||
if dashmpd = video.dash_manifest_url
|
if dashmpd = video.dash_manifest_url
|
||||||
manifest = YT_POOL.client &.get(URI.parse(dashmpd).request_target).body
|
response = YT_POOL.client &.get(URI.parse(dashmpd).request_target)
|
||||||
|
|
||||||
|
if response.status_code != 200
|
||||||
|
haltf env, status_code: response.status_code
|
||||||
|
end
|
||||||
|
|
||||||
|
manifest = response.body
|
||||||
|
|
||||||
manifest = manifest.gsub(/<BaseURL>[^<]+<\/BaseURL>/) do |baseurl|
|
manifest = manifest.gsub(/<BaseURL>[^<]+<\/BaseURL>/) do |baseurl|
|
||||||
url = baseurl.lchop("<BaseURL>")
|
url = baseurl.lchop("<BaseURL>")
|
||||||
|
Loading…
Reference in New Issue
Block a user