Invidious is an alternative front-end to YouTube
Storyboards: Fix some small logic mistakes
Samantaz Foxa335bc0814d3
diff --git a/src/invidious/videos/storyboard.cr b/src/invidious/videos/storyboard.crindex 61aafe37..35012663 100644--- a/src/invidious/videos/storyboard.cr+++ b/src/invidious/videos/storyboard.cr@@ -25,7 +25,7 @@ module Invidious::Videosauthority = /(i\d?).ytimg.com/.match(@url.host.not_nil!).not_nil![1]?@proxied_url = URI.parse(HOST_URL)- @proxied_url.path = "/sb/#{authority}#{@url.path}"+ @proxied_url.path = "/sb/#{authority}/#{@url.path.lchop("/sb/")}"@proxied_url.query = @url.queryend@@ -60,8 +60,7 @@ module Invidious::Videosreturn [] of Storyboard if !storyboards# The base URL is the first chunk- url = URI.parse(storyboards.shift)- params = url.query_params+ base_url = URI.parse(storyboards.shift)return storyboards.map_with_index do |sb, i|# Separate the different storyboard parameters:@@ -81,9 +80,13 @@ module Invidious::Videoscolumns = columns.to_irows = rows.to_i+ # Copy base URL object, so that we can modify it+ url = base_url.dup+# Add the signature to the URL+ params = url.query_paramsparams["sigh"] = sigh- url.query = params.to_s+ url.query_params = params# Replace the template parts with what we haveurl.path = url.path.sub("$L", i).sub("$N", name)