mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-23 01:45:41 +00:00
Add '/videoplayback' redirect
This commit is contained in:
@@ -17,7 +17,7 @@ class Config
|
||||
end
|
||||
|
||||
class FilteredCompressHandler < Kemal::Handler
|
||||
exclude ["/videoplayback/:wild/*", "/api/*"]
|
||||
exclude ["/videoplayback/*", "/api/*"]
|
||||
|
||||
def call(env)
|
||||
return call_next env if exclude_match? env
|
||||
|
||||
@@ -152,6 +152,12 @@ class Video
|
||||
return adaptive_fmts
|
||||
end
|
||||
|
||||
def video_streams(adaptive_fmts)
|
||||
video_streams = adaptive_fmts.compact_map { |s| s["type"].starts_with?("video") ? s : nil }
|
||||
|
||||
return video_streams
|
||||
end
|
||||
|
||||
def audio_streams(adaptive_fmts)
|
||||
audio_streams = adaptive_fmts.compact_map { |s| s["type"].starts_with?("audio") ? s : nil }
|
||||
audio_streams.sort_by! { |s| s["bitrate"].to_i }.reverse!
|
||||
|
||||
Reference in New Issue
Block a user