mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-02 08:53:13 +05:30
Fix audio mode for raw URLs
This commit is contained in:
parent
0338fd42e1
commit
8cecce7570
@ -470,11 +470,23 @@ get "/watch" do |env|
|
|||||||
thumbnail = "/vi/#{video.id}/maxres.jpg"
|
thumbnail = "/vi/#{video.id}/maxres.jpg"
|
||||||
|
|
||||||
if params.raw
|
if params.raw
|
||||||
url = fmt_stream[0]["url"]
|
if params.listen
|
||||||
|
url = audio_streams[0]["url"]
|
||||||
|
|
||||||
fmt_stream.each do |fmt|
|
audio_streams.each do |fmt|
|
||||||
if fmt["label"].split(" - ")[0] == params.quality
|
pp fmt["bitrate"]
|
||||||
url = fmt["url"]
|
pp params.quality.rchop("k")
|
||||||
|
if fmt["bitrate"] == params.quality.rchop("k")
|
||||||
|
url = fmt["url"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
url = fmt_stream[0]["url"]
|
||||||
|
|
||||||
|
fmt_stream.each do |fmt|
|
||||||
|
if fmt["label"].split(" - ")[0] == params.quality
|
||||||
|
url = fmt["url"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user