Pull dash URL from player response

This commit is contained in:
Omar Roth 2019-02-25 09:11:41 -06:00
parent 6b12449be4
commit 09d0972ab4
2 changed files with 5 additions and 5 deletions

View file

@ -300,9 +300,9 @@ class Video
self.info["adaptive_fmts"].split(",") do |string|
adaptive_fmts << HTTP::Params.parse(string)
end
elsif self.info.has_key?("dashmpd")
elsif dashmpd = self.player_response["streamingData"]["dashManifestUrl"]?.try &.as_s
client = make_client(YT_URL)
response = client.get(self.info["dashmpd"])
response = client.get(dashmpd)
document = XML.parse_html(response.body)
document.xpath_nodes(%q(//adaptationset)).each do |adaptation_set|