From 578bbcd181e56c3b71837e96df8c2ae03ee491db Mon Sep 17 00:00:00 2001 From: syeopite <70992037+syeopite@users.noreply.github.com> Date: Wed, 28 Jul 2021 16:28:09 -0700 Subject: [PATCH] Fix raw parameter for videos in listen mode (#2270) --- src/invidious/routes/watch.cr | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index c6c7c154..cd8ef910 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -167,9 +167,11 @@ class Invidious::Routes::Watch < Invidious::Routes::BaseRoute if params.listen url = audio_streams[0]["url"].as_s - audio_streams.each do |fmt| - if fmt["bitrate"].as_i == params.quality.rchop("k").to_i - url = fmt["url"].as_s + if params.quality.ends_with? "k" + audio_streams.each do |fmt| + if fmt["bitrate"].as_i == params.quality.rchop("k").to_i + url = fmt["url"].as_s + end end end else