mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add 'raw=1' to '/watch' page
This commit is contained in:
parent
61f9e8667c
commit
8c22c226c0
1 changed files with 13 additions and 1 deletions
|
@ -193,7 +193,7 @@ get "/watch" do |env|
|
|||
end
|
||||
subscriptions ||= [] of String
|
||||
|
||||
autoplay, video_loop, video_start, video_end, listen = process_video_params(env.params.query, preferences)
|
||||
autoplay, video_loop, video_start, video_end, listen, raw, quality, autoplay = process_video_params(env.params.query, preferences)
|
||||
if listen
|
||||
env.params.query.delete_all("listen")
|
||||
end
|
||||
|
@ -228,6 +228,18 @@ get "/watch" do |env|
|
|||
# TODO: Find highest resolution thumbnail automatically
|
||||
thumbnail = "https://i.ytimg.com/vi/#{video.id}/mqdefault.jpg"
|
||||
|
||||
if raw
|
||||
url = fmt_stream[0]["url"]
|
||||
|
||||
fmt_stream.each do |fmt|
|
||||
if fmt["label"].split(" - ")[0] == quality
|
||||
url = fmt["url"]
|
||||
end
|
||||
end
|
||||
|
||||
next env.redirect url
|
||||
end
|
||||
|
||||
rvs = [] of Hash(String, String)
|
||||
if video.info.has_key?("rvs")
|
||||
video.info["rvs"].split(",").each do |rv|
|
||||
|
|
Loading…
Reference in a new issue