Some checks failed
release / build-release (push) Has been cancelled
- IChannel: creators -> sub-channels -> video posts (public listing API, search mapped) - IRequiresMediaInfoCallback -> signed proxy URLs; stream controller rewrites HLS so the AES-128 key is fetched server-side with the session cookie, segments stay on the CDN - delivery/info cached per token lifetime and throttled (~2/min) - config page: paste sails.sid + validate, extra creators, quality, search test - scripts/package.sh -> plugin folder + zip + md5 + manifest.json; Gitea release workflow - research docs, HAR analysis (HAR itself gitignored), install-pi5.sh Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
sub init()
|
|
m.top.functionname = "request"
|
|
end sub
|
|
|
|
function request()
|
|
json = ParseJSON(m.top.unparsed)
|
|
|
|
contentNode = createObject("roSGNode", "ContentNode")
|
|
for each channel in json.channels
|
|
node = createObject("roSGNode", "category_node")
|
|
node.title = channel.title
|
|
apiConfigObj = ApiConfig()
|
|
node.feed_url = apiConfigObj.buildApiUrl("/api/v3/content/creator?id=" + channel.creator + "&channel=" + channel.id)
|
|
node.creatorGUID = channel.creator
|
|
node.icon = channel.icon.path
|
|
if channel.cover.childImages.Peek() = invalid
|
|
node.HDPosterURL = loadCacheImage(channel.cover.path)
|
|
else
|
|
node.HDPosterURL = loadCacheImage(channel.cover.childImages[0].path)
|
|
end if
|
|
|
|
contentNode.appendChild(node)
|
|
end for
|
|
|
|
m.top.category_node = contentNode
|
|
return ""
|
|
end function
|
|
|
|
function loadCacheImage(url) as String
|
|
appInfo = createObject("roAppInfo")
|
|
version = appInfo.getVersion()
|
|
useragent = "Hydravion (Roku) v" + version
|
|
|
|
' Get Bearer token using TokenUtil
|
|
tokenUtilObj = TokenUtil()
|
|
accessToken = tokenUtilObj.getAccessToken()
|
|
if accessToken = invalid then
|
|
return url
|
|
end if
|
|
|
|
fs = createObject("roFileSystem")
|
|
xfer = createObject("roUrlTransfer")
|
|
xfer.SetCertificatesFile("common:/certs/ca-bundle.crt")
|
|
xfer.InitClientCertificates()
|
|
xfer.AddHeader("Accept", "application/json")
|
|
xfer.AddHeader("User-Agent", useragent)
|
|
xfer.AddHeader("Authorization", "Bearer " + accessToken)
|
|
|
|
filename = url
|
|
filename = mid(filename, instr(1, filename, "//") + 1)
|
|
while instr(1, filename, "/") > 0
|
|
filename = mid(filename, instr(1, filename, "/") + 1)
|
|
end while
|
|
|
|
if not fs.Exists("cachefs:/" + filename) then
|
|
xfer.SetUrl(url)
|
|
xfer.AsyncGetToFile("cachefs:/" + filename)
|
|
filename = url
|
|
else
|
|
filename = "cachefs:/" + filename
|
|
end if
|
|
|
|
return filename
|
|
end function
|
|
|