diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-10-27 21:44:17 -0400 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-10-27 21:44:17 -0400 |
| commit | c58841100a2507c41276d4f6d195b7d221034e0b (patch) | |
| tree | 8733f9c65a04b00da80dd375a375f54fe6e38ca2 /src | |
| parent | 03e24cccd0a897fb94d802eac194abb83e9aeb8e (diff) | |
| download | invidious-c58841100a2507c41276d4f6d195b7d221034e0b.tar.gz invidious-c58841100a2507c41276d4f6d195b7d221034e0b.tar.bz2 invidious-c58841100a2507c41276d4f6d195b7d221034e0b.zip | |
Fix extractor for channel community cursor
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/channels.cr | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr index 4cf322b0..c5381863 100644 --- a/src/invidious/channels.cr +++ b/src/invidious/channels.cr @@ -808,11 +808,23 @@ def produce_channel_community_continuation(ucid, cursor) end def extract_channel_community_cursor(continuation) - cursor = URI.decode_www_form(continuation) + object = URI.decode_www_form(continuation) .try { |i| Base64.decode(i) } .try { |i| IO::Memory.new(i) } .try { |i| Protodec::Any.parse(i) } - .try { |i| Protodec::Any.cast_json(i["80226972:0:embedded"]["3:1:base64"].as_h) } + .try { |i| i["80226972:0:embedded"]["3:1:base64"].as_h } + + if object["53:2:embedded"]?.try &.["3:0:embedded"]? + object["53:2:embedded"]["3:0:embedded"]["2:0:string"] = object["53:2:embedded"]["3:0:embedded"] + .try { |i| i["2:0:base64"].as_h } + .try { |i| Protodec::Any.cast_json(i) } + .try { |i| Protodec::Any.from_json(i) } + .try { |i| Base64.urlsafe_encode(i, padding: false) } + + object["53:2:embedded"]["3:0:embedded"].as_h.delete("2:0:base64") + end + + cursor = Protodec::Any.cast_json(object) .try { |i| Protodec::Any.from_json(i) } .try { |i| Base64.urlsafe_encode(i) } |
