From b58950c574fae491b7194594d93df13c3c972c3c Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 1 Nov 2019 12:00:59 -0400 Subject: [PATCH] Fix decoding for channel playlists extractor --- src/invidious/channels.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr index c5381863..2d911089 100644 --- a/src/invidious/channels.cr +++ b/src/invidious/channels.cr @@ -526,10 +526,12 @@ end def extract_channel_playlists_cursor(url, auto_generated) cursor = URI.parse(url).query_params - .try { |i| Base64.decode(i["continuation"]) } + .try { |i| URI.decode_www_form(i["continuation"]) } + .try { |i| Base64.decode(i) } .try { |i| IO::Memory.new(i) } .try { |i| Protodec::Any.parse(i) } - .try { |i| i["80226972:0:embedded"]["3:1:base64"]["15:7:string"].as_s } + .try { |i| i["80226972:0:embedded"]["3:1:base64"].as_h.find { |k, v| k.starts_with?("15:") } } + .try &.[1].as_s || "" if !auto_generated cursor = URI.decode_www_form(cursor)