summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-01-12 12:00:44 -0600
committerOmar Roth <omarroth@hotmail.com>2019-01-12 12:00:44 -0600
commit0f48d221b40511b9f5ec999616af97853f587fbc (patch)
treea11d378f7a2117a4b5abf73cd89869bd797a4096
parent8f57388cd315a95fe0addfcd7894b9b1b368762d (diff)
downloadinvidious-0f48d221b40511b9f5ec999616af97853f587fbc.tar.gz
invidious-0f48d221b40511b9f5ec999616af97853f587fbc.tar.bz2
invidious-0f48d221b40511b9f5ec999616af97853f587fbc.zip
Fix hlsvp extractor
-rw-r--r--src/invidious.cr12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index ba47fab4..d35cb324 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -368,8 +368,8 @@ get "/watch" do |env|
host_params = env.request.query_params
host_params.delete_all("v")
- if video.info["hlsvp"]?
- hlsvp = video.info["hlsvp"]
+ if video.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
+ hlsvp = video.player_response["streamingData"]["hlsManifestUrl"].as_s
hlsvp = hlsvp.gsub("https://manifest.googlevideo.com", host_url)
end
@@ -470,8 +470,8 @@ get "/embed/:id" do |env|
host_params = env.request.query_params
host_params.delete_all("v")
- if video.info["hlsvp"]?
- hlsvp = video.info["hlsvp"]
+ if video.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
+ hlsvp = video.player_response["streamingData"]["hlsManifestUrl"].as_s
hlsvp = hlsvp.gsub("https://manifest.googlevideo.com", host_url)
end
@@ -2520,12 +2520,12 @@ get "/api/v1/videos/:id" do |env|
json.field "isListed", video.info["is_listed"] == "1"
end
- if video.info["hlsvp"]?
+ if video.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, env.request.headers["Host"]?)
host_params = env.request.query_params
host_params.delete_all("v")
- hlsvp = video.info["hlsvp"]
+ hlsvp = video.player_response["streamingData"]["hlsManifestUrl"].as_s
hlsvp = hlsvp.gsub("https://manifest.googlevideo.com", host_url)
json.field "hlsUrl", hlsvp