diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-02-25 09:11:41 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-02-25 09:11:41 -0600 |
| commit | 09d0972ab45227be66e3e3a29934c3378dc6dc1f (patch) | |
| tree | d3e74f469eceb0c1ced066ac5a015deb13bcf4fa | |
| parent | 6b12449be4a8cf1015fd3ad93b3b90ec93dc0210 (diff) | |
| download | invidious-09d0972ab45227be66e3e3a29934c3378dc6dc1f.tar.gz invidious-09d0972ab45227be66e3e3a29934c3378dc6dc1f.tar.bz2 invidious-09d0972ab45227be66e3e3a29934c3378dc6dc1f.zip | |
Pull dash URL from player response0.14.1
| -rw-r--r-- | src/invidious.cr | 6 | ||||
| -rw-r--r-- | src/invidious/videos.cr | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 3129f6d2..dda725ff 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -3735,8 +3735,8 @@ get "/api/manifest/dash/id/:id" do |env| halt env, status_code: 403 end - if video.info["dashmpd"]? - manifest = client.get(video.info["dashmpd"]).body + if dashmpd = video.player_response["streamingData"]["dashManifestUrl"]?.try &.as_s + manifest = client.get(dashmpd).body manifest = manifest.gsub(/<BaseURL>[^<]+<\/BaseURL>/) do |baseurl| url = baseurl.lchop("<BaseURL>") @@ -3993,7 +3993,7 @@ get "/videoplayback" do |env| end if response.status_code >= 400 - halt env, status_code: 403 + halt env, status_code: response.status_code end client = make_client(URI.parse(host), proxies, region) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 03770af7..e02378f7 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -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| |
