mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add '/videoplayback' redirect
This commit is contained in:
parent
a5fb1d38e0
commit
373c5378b2
3 changed files with 25 additions and 8 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue