update fetch_community_post_comments protobuf to match currently used protobuf, add sort_by option

This commit is contained in:
ChunkyProgrammer
2025-06-25 23:34:30 -04:00
parent 4155f15bf7
commit 436f955e0f
4 changed files with 29 additions and 14 deletions

View File

@@ -24,6 +24,15 @@ def fetch_channel_community(ucid, cursor, locale, format, thin_mode)
return extract_channel_community(items, ucid: ucid, locale: locale, format: format, thin_mode: thin_mode)
end
def decode_ucid_from_post_protobuf(params)
decoded_protobuf = params.try { |i| URI.decode_www_form(i) }
.try { |i| Base64.decode(i) }
.try { |i| IO::Memory.new(i) }
.try { |i| Protodec::Any.parse(i) }
return decoded_protobuf.try(&.["56:0:embedded"]["2:0:string"].as_s)
end
def fetch_channel_community_post(ucid, post_id, locale, format, thin_mode)
object = {
"56:embedded" => {