From 2a19dbb1fee20e5438751c3bb387f8757f4c2238 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Fri, 8 Nov 2024 18:28:55 +0100 Subject: [PATCH] Channels: Use the same structure as in the other ctoken functions Change explanation, courtesy of iBicha: The \n is basically a decimal 10, which is 1010 binary. That is a field number 1, and a wire type 2 (length-delimited). Then the $ is a decimal 36, which is exactly the length of 00000000-0000-0000-0000-000000000000. So both objects end up being encoded into the same data. --- src/invidious/channels/videos.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/invidious/channels/videos.cr b/src/invidious/channels/videos.cr index 9572adf3..96400f47 100644 --- a/src/invidious/channels/videos.cr +++ b/src/invidious/channels/videos.cr @@ -111,7 +111,9 @@ module Invidious::Channel::Tabs private def make_initial_videos_ctoken(ucid : String, sort_by = "newest") object = { "15:embedded" => { - "2:string" => "\n$00000000-0000-0000-0000-000000000000", + "2:embedded" => { + "1:string" => "00000000-0000-0000-0000-000000000000", + }, "4:varint" => sort_options_videos_short(sort_by), }, }