35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
import "pkg:/components/Services/Innertube/Context.bs"
|
|
import "pkg:/source/services/HttpClient.bs"
|
|
import "pkg:/source/utils/StringUtils.bs"
|
|
|
|
namespace Innertube
|
|
|
|
function CreateBrowseRequest(browseId as string, clienType as Innertube.ClientType, params = "" as string, continuation = "" as string) as object
|
|
deviceInfo = CreateObject("roDeviceInfo")
|
|
|
|
payload = {
|
|
"context": Innertube.CreateContext(clienType, deviceInfo, "")
|
|
}
|
|
|
|
if not StringUtils.IsNullOrEmpty(continuation)
|
|
payload["continuation"] = continuation
|
|
else
|
|
payload["browseId"] = browseId
|
|
if not StringUtils.IsNullOrEmpty(params)
|
|
payload["params"] = params
|
|
end if
|
|
end if
|
|
|
|
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/browse?prettyPrint=false&alt=json", payload)
|
|
headers = {
|
|
"accept": "*/*"
|
|
"accept-language": "*"
|
|
}
|
|
headers.Append(Innertube.CreateHeaders(clienType))
|
|
request.Headers(headers)
|
|
|
|
return request
|
|
end function
|
|
|
|
end namespace
|