|
|
@ -202,50 +202,58 @@ def produce_channel_videos_url(ucid, page = 1, auto_generated = nil, sort_by = "
|
|
|
|
timestamp = seed - (page - 1).months
|
|
|
|
timestamp = seed - (page - 1).months
|
|
|
|
|
|
|
|
|
|
|
|
page = "#{timestamp.to_unix}"
|
|
|
|
page = "#{timestamp.to_unix}"
|
|
|
|
switch = "\x36"
|
|
|
|
switch = 0x36
|
|
|
|
else
|
|
|
|
else
|
|
|
|
page = "#{page}"
|
|
|
|
page = "#{page}"
|
|
|
|
switch = "\x00"
|
|
|
|
switch = 0x00
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
meta = "\x12\x06videos"
|
|
|
|
meta = IO::Memory.new
|
|
|
|
meta += "\x30\x02"
|
|
|
|
meta.write(Bytes[0x12, 0x06])
|
|
|
|
meta += "\x38\x01"
|
|
|
|
meta.print("videos")
|
|
|
|
meta += "\x60\x01"
|
|
|
|
|
|
|
|
meta += "\x6a\x00"
|
|
|
|
meta.write(Bytes[0x30, 0x02])
|
|
|
|
meta += "\xb8\x01\x00"
|
|
|
|
meta.write(Bytes[0x38, 0x01])
|
|
|
|
meta += "\x20#{switch}"
|
|
|
|
meta.write(Bytes[0x60, 0x01])
|
|
|
|
meta += "\x7a"
|
|
|
|
meta.write(Bytes[0x6a, 0x00])
|
|
|
|
meta += page.size.to_u8.unsafe_chr
|
|
|
|
meta.write(Bytes[0xb8, 0x01, 0x00])
|
|
|
|
meta += page
|
|
|
|
|
|
|
|
|
|
|
|
meta.write(Bytes[0x20, switch, 0x7a, page.size])
|
|
|
|
|
|
|
|
meta.print(page)
|
|
|
|
|
|
|
|
|
|
|
|
case sort_by
|
|
|
|
case sort_by
|
|
|
|
when "newest"
|
|
|
|
when "newest"
|
|
|
|
# Empty tags can be omitted
|
|
|
|
# Empty tags can be omitted
|
|
|
|
# meta += "\x18\x00"
|
|
|
|
# meta.write(Bytes[0x18,0x00])
|
|
|
|
when "popular"
|
|
|
|
when "popular"
|
|
|
|
meta += "\x18\x01"
|
|
|
|
meta.write(Bytes[0x18, 0x01])
|
|
|
|
when "oldest"
|
|
|
|
when "oldest"
|
|
|
|
meta += "\x18\x02"
|
|
|
|
meta.write(Bytes[0x18, 0x02])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
meta = Base64.urlsafe_encode(meta)
|
|
|
|
meta.rewind
|
|
|
|
|
|
|
|
meta = Base64.urlsafe_encode(meta.to_slice)
|
|
|
|
meta = URI.escape(meta)
|
|
|
|
meta = URI.escape(meta)
|
|
|
|
|
|
|
|
|
|
|
|
continuation = "\x12"
|
|
|
|
continuation = IO::Memory.new
|
|
|
|
continuation += ucid.size.to_u8.unsafe_chr
|
|
|
|
continuation.write(Bytes[0x12, ucid.size])
|
|
|
|
continuation += ucid
|
|
|
|
continuation.print(ucid)
|
|
|
|
continuation += "\x1a"
|
|
|
|
|
|
|
|
continuation += meta.size.to_u8.unsafe_chr
|
|
|
|
continuation.write(Bytes[0x1a, meta.size])
|
|
|
|
continuation += meta
|
|
|
|
continuation.print(meta)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
continuation.rewind
|
|
|
|
|
|
|
|
continuation = continuation.gets_to_end
|
|
|
|
|
|
|
|
|
|
|
|
continuation = continuation.size.to_u8.unsafe_chr + continuation
|
|
|
|
wrapper = IO::Memory.new
|
|
|
|
continuation = "\xe2\xa9\x85\xb2\x02" + continuation
|
|
|
|
wrapper.write(Bytes[0xe2, 0xa9, 0x85, 0xb2, 0x02, continuation.size])
|
|
|
|
|
|
|
|
wrapper.print(continuation)
|
|
|
|
|
|
|
|
wrapper.rewind
|
|
|
|
|
|
|
|
|
|
|
|
continuation = Base64.urlsafe_encode(continuation)
|
|
|
|
wrapper = Base64.urlsafe_encode(wrapper.to_slice)
|
|
|
|
continuation = URI.escape(continuation)
|
|
|
|
wrapper = URI.escape(wrapper)
|
|
|
|
|
|
|
|
|
|
|
|
url = "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
|
|
|
|
url = "/browse_ajax?continuation=#{wrapper}&gl=US&hl=en"
|
|
|
|
|
|
|
|
|
|
|
|
return url
|
|
|
|
return url
|
|
|
|
end
|
|
|
|
end
|
|
|
|