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