Update code for Crystal 0.36.0

Rename `HTTPClient@socket` to `HTTPClient@io`, see
https://github.com/crystal-lang/crystal/pull/9543.

Rename `URI#full_path` to `URI#request_target`, see
https://github.com/crystal-lang/crystal/pull/10099.
This commit is contained in:
saltycrys
2021-01-31 19:52:32 +01:00
parent 1f7f013e0a
commit 5f03a583d1
14 changed files with 41 additions and 41 deletions

View File

@@ -144,8 +144,8 @@ class Invidious::Routes::Embed < Invidious::Routes::BaseRoute
adaptive_fmts = video.adaptive_fmts
if params.local
fmt_stream.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).full_path) }
adaptive_fmts.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).full_path) }
fmt_stream.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).request_target) }
adaptive_fmts.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).request_target) }
end
video_streams = video.video_streams

View File

@@ -255,7 +255,7 @@ class Invidious::Routes::Login < Invidious::Routes::BaseRoute
traceback << "Unhandled dialog /b/0/SmsAuthInterstitial."
end
login = client.get(location.full_path, headers)
login = client.get(location.request_target, headers)
headers = login.cookies.add_request_headers(headers)
location = login.headers["Location"]?.try { |u| URI.parse(u) }

View File

@@ -126,8 +126,8 @@ class Invidious::Routes::Watch < Invidious::Routes::BaseRoute
adaptive_fmts = video.adaptive_fmts
if params.local
fmt_stream.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).full_path) }
adaptive_fmts.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).full_path) }
fmt_stream.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).request_target) }
adaptive_fmts.each { |fmt| fmt["url"] = JSON::Any.new(URI.parse(fmt["url"].as_s).request_target) }
end
video_streams = video.video_streams