mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Fix extractor for channel community cursor
This commit is contained in:
parent
03e24cccd0
commit
c58841100a
2 changed files with 16 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
@ -808,11 +808,23 @@ def produce_channel_community_continuation(ucid, cursor)
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_channel_community_cursor(continuation)
|
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| Base64.decode(i) }
|
||||||
.try { |i| IO::Memory.new(i) }
|
.try { |i| IO::Memory.new(i) }
|
||||||
.try { |i| Protodec::Any.parse(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| Protodec::Any.from_json(i) }
|
||||||
.try { |i| Base64.urlsafe_encode(i) }
|
.try { |i| Base64.urlsafe_encode(i) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue