mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-17 18:38:50 +00:00
Update to Crystal 0.31.0, resolve compiler deprecation warnings, update dependencies (#764)
* shard: update to crystal 0.31.0 Additionally, no longer use the Crystal "markdown" library which has been removed from the Crystal stdlib in version 0.31.0. See https://github.com/crystal-lang/crystal/pull/8115. Also fix some deprecation warnings using the following commands: find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.escape/URI\.encode_www_form/g' "{}" \; find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.unescape/URI\.decode_www_form/g' "{}" \; sed -i 's/while \%pull\.kind \!\= \:end_object/until \%pull\.kind\.end_object\?/g' src/invidious/helpers/patch_mapping.cr
This commit is contained in:
@@ -266,7 +266,7 @@ def search(query, page = 1, search_params = produce_search_params(content_type:
|
||||
return {0, [] of SearchItem}
|
||||
end
|
||||
|
||||
html = client.get("/results?q=#{URI.escape(query)}&page=#{page}&sp=#{search_params}&hl=en&disable_polymer=1").body
|
||||
html = client.get("/results?q=#{URI.encode_www_form(query)}&page=#{page}&sp=#{search_params}&hl=en&disable_polymer=1").body
|
||||
if html.empty?
|
||||
return {0, [] of SearchItem}
|
||||
end
|
||||
@@ -371,7 +371,7 @@ def produce_search_params(sort : String = "relevance", date : String = "", conte
|
||||
end
|
||||
|
||||
token = Base64.urlsafe_encode(token.to_slice)
|
||||
token = URI.escape(token)
|
||||
token = URI.encode_www_form(token)
|
||||
|
||||
return token
|
||||
end
|
||||
@@ -396,7 +396,7 @@ def produce_channel_search_url(ucid, query, page)
|
||||
|
||||
data.rewind
|
||||
data = Base64.urlsafe_encode(data)
|
||||
continuation = URI.escape(data)
|
||||
continuation = URI.encode_www_form(data)
|
||||
|
||||
data = IO::Memory.new
|
||||
|
||||
@@ -421,7 +421,7 @@ def produce_channel_search_url(ucid, query, page)
|
||||
IO.copy data, buffer
|
||||
|
||||
continuation = Base64.urlsafe_encode(buffer)
|
||||
continuation = URI.escape(continuation)
|
||||
continuation = URI.encode_www_form(continuation)
|
||||
|
||||
url = "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user