Merge branch 'iv-org:master' into master

This commit is contained in:
Ramon 2025-05-07 17:25:53 +02:00 committed by GitHub
commit 2c390e76b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View File

@ -2,6 +2,12 @@
## vX.Y.0 (future) ## vX.Y.0 (future)
## v2.20250504.0
Small release with quick workaround fix for issue #4251 (Nil assertion failed).
PR: https://github.com/iv-org/invidious/issues/5263
## v2.20250314.0 ## v2.20250314.0
### Wrap-up ### Wrap-up

View File

@ -90,14 +90,14 @@ db:
## ##
## API key for Invidious companion, used for securing the communication ## API key for Invidious companion, used for securing the communication
## between Invidious and Invidious companion. ## between Invidious and Invidious companion.
## The size of the key needs to be more or equal to 16. ## The key needs to be exactly 16 characters long.
## ##
## Note: This parameter is mandatory when Invidious companion is enabled ## Note: This parameter is mandatory when Invidious companion is enabled
## and should be a random string. ## and should be a random string.
## Such random string can be generated on linux with the following ## Such random string can be generated on linux with the following
## command: `pwgen 16 1` ## command: `pwgen 16 1`
## ##
## Accepted values: a string ## Accepted values: a string (of length 16)
## Default: <none> ## Default: <none>
## ##
#invidious_companion_key: "CHANGE_ME!!" #invidious_companion_key: "CHANGE_ME!!"

View File

@ -21,7 +21,7 @@ module Invidious::Routes::VideoPlayback
end end
# Sanity check, to avoid being used as an open proxy # Sanity check, to avoid being used as an open proxy
if !host.matches?(/[\w-]+.googlevideo.com/) if !host.matches?(/[\w-]+\.(?:googlevideo|c\.youtube)\.com/)
return error_template(400, "Invalid \"host\" parameter.") return error_template(400, "Invalid \"host\" parameter.")
end end
@ -37,7 +37,8 @@ module Invidious::Routes::VideoPlayback
# See: https://github.com/iv-org/invidious/issues/3302 # See: https://github.com/iv-org/invidious/issues/3302
range_header = env.request.headers["Range"]? range_header = env.request.headers["Range"]?
if range_header.nil? sq = query_params["sq"]?
if range_header.nil? && sq.nil?
range_for_head = query_params["range"]? || "0-640" range_for_head = query_params["range"]? || "0-640"
headers["Range"] = "bytes=#{range_for_head}" headers["Range"] = "bytes=#{range_for_head}"
end end