|
|
@ -512,31 +512,6 @@ def produce_channel_playlists_url(ucid, cursor, sort = "newest", auto_generated
|
|
|
|
return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
|
|
|
|
return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def extract_channel_playlists_cursor(cursor, auto_generated)
|
|
|
|
|
|
|
|
cursor = URI.decode_www_form(cursor)
|
|
|
|
|
|
|
|
.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"].as_h.find { |k, v| k.starts_with? "15:" } }
|
|
|
|
|
|
|
|
.try &.[1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if cursor.try &.as_h?
|
|
|
|
|
|
|
|
cursor = cursor.try { |i| Protodec::Any.cast_json(i.as_h) }
|
|
|
|
|
|
|
|
.try { |i| Protodec::Any.from_json(i) }
|
|
|
|
|
|
|
|
.try { |i| Base64.urlsafe_encode(i) }
|
|
|
|
|
|
|
|
.try { |i| URI.encode_www_form(i) } || ""
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
cursor = cursor.try &.as_s || ""
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !auto_generated
|
|
|
|
|
|
|
|
cursor = URI.decode_www_form(cursor)
|
|
|
|
|
|
|
|
.try { |i| Base64.decode_string(i) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cursor
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: Add "sort_by"
|
|
|
|
# TODO: Add "sort_by"
|
|
|
|
def fetch_channel_community(ucid, continuation, locale, format, thin_mode)
|
|
|
|
def fetch_channel_community(ucid, continuation, locale, format, thin_mode)
|
|
|
|
response = YT_POOL.client &.get("/channel/#{ucid}/community?gl=US&hl=en")
|
|
|
|
response = YT_POOL.client &.get("/channel/#{ucid}/community?gl=US&hl=en")
|
|
|
|