Skip to content

Invidious is an alternative front-end to YouTube

format changes

ChunkyProgrammerf8febbe2b2fb
diff --git a/src/invidious/channels/community.cr b/src/invidious/channels/community.cr
index 8927c81b..43843b11 100644
--- a/src/invidious/channels/community.cr
+++ b/src/invidious/channels/community.cr
@@ -26,9 +26,9 @@ 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) }
+ .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
@@ -36,10 +36,10 @@ end
def fetch_channel_community_post(ucid, post_id, locale, format, thin_mode)
object = {
"56:embedded" => {
- "2:string" => ucid,
- "3:string" => post_id.to_s,
+ "2:string" => ucid,
+ "3:string" => post_id.to_s,
"11:string" => ucid,
- }
+ },
}
params = object.try { |i| Protodec::Any.cast_json(i) }
.try { |i| Protodec::Any.from_json(i) }
diff --git a/src/invidious/routes/api/v1/misc.cr b/src/invidious/routes/api/v1/misc.cr
index 40f2a439..4ae877a8 100644
--- a/src/invidious/routes/api/v1/misc.cr
+++ b/src/invidious/routes/api/v1/misc.cr
@@ -197,8 +197,8 @@ module Invidious::Routes::API::V1::Misc
.try { |i| IO::Memory.new(i) }
.try { |i| Protodec::Any.parse(i) }
- ucid = decoded_protobuf.try(&.["56:0:embedded"]["2:0:string"].as_s)
- post_id = decoded_protobuf.try(&.["56:0:embedded"]["3:1:string"].as_s)
+ ucid = decoded_protobuf.try(&.["56:0:embedded"]["2:0:string"].as_s)
+ post_id = decoded_protobuf.try(&.["56:0:embedded"]["3:1:string"].as_s)
else
ucid = sub_endpoint["browseId"]? if sub_endpoint["browseId"]? && sub_endpoint["browseId"]?.try &.as_s.starts_with? "UC"
post_id = nil