Skip to content

Commit

Permalink
Merge branch 'main' into feature/dial-cast-poc
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha authored Feb 5, 2024
2 parents 8cf9df0 + f3aeb58 commit be8f3e3
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 120 deletions.
58 changes: 29 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "0.19.1",
"description": "Unofficial Youtube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.16",
"@rokucommunity/bslint": "^0.8.17",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.7",
"@types/node": "^20.11.16",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.65.18",
"brighterscript-formatter": "^1.6.39",
"brighterscript": "0.65.21",
"brighterscript-formatter": "^1.6.40",
"convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.2.0",
Expand All @@ -21,9 +21,9 @@
"imap": "^0.8.19",
"ip": "^1.1.8",
"json5": "^2.2.3",
"mailparser": "^3.6.6",
"mailparser": "^3.6.7",
"roku-deploy": "^3.11.2",
"rooibos-roku": "^5.10.0",
"rooibos-roku": "^5.11.0",
"semver": "^7.5.4",
"shelljs": "^0.8.5",
"ts-node": "^10.9.2",
Expand Down
1 change: 1 addition & 0 deletions playlet-lib/src/components/MainScene.transpiled.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</interface>
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.brs" />
<script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
Expand Down
49 changes: 15 additions & 34 deletions playlet-lib/src/components/Services/Dash/DashManifest.bs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ class DashManifest
end if

if xml.Node("AdaptationSet", adaptationSetAttributes)
xml.Node("Role", {
xml.EmptyNode("Role", {
"schemeIdUri": "urn:mpeg:dash:role:2011"
"value": audioSet.acont = "original" ? "main" : "alternate"
})
xml.End()

for i = 0 to audioStreams.Count() - 1
stream = audioStreams[i]
Expand All @@ -100,31 +99,23 @@ class DashManifest
"bandwidth": stream.bitrate
})

xml.Node("AudioChannelConfiguration", {
xml.EmptyNode("AudioChannelConfiguration", {
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
"value": `${stream.audioChannels}`
})
xml.End()

if xml.Node("BaseURL")
xml.Text(stream.url)
xml.End()
end if
xml.TextNode("BaseURL", stream.url)

if xml.Node("SegmentBase", { "indexRange": stream.index })
xml.EmptyNode("Initialization", { "range": stream.init })

if xml.Node("SegmentBase", {
"indexRange": stream.index
})
if xml.Node("Initialization", {
"range": stream.init
})
xml.End()
end if
xml.End()
end if

xml.End()
end if
end for

xml.End()
end if

Expand Down Expand Up @@ -178,14 +169,9 @@ class DashManifest
xml.End()
end if

if xml.Node("SegmentBase", {
"indexRange": stream.index
})
if xml.Node("Initialization", {
"range": stream.init
})
xml.End()
end if
if xml.Node("SegmentBase", { "indexRange": stream.index })
xml.EmptyNode("Initialization", { "range": stream.init })

xml.End()
end if

Expand Down Expand Up @@ -249,12 +235,11 @@ class DashManifest
"mimeType": "image/jpeg"
"contentType": "image"
})
xml.Node("SegmentTemplate", {
xml.EmptyNode("SegmentTemplate", {
"media": url
"duration": duration
"startNumber": 0
})
xml.End()

if xml.Node("Representation", {
"id": `thumbnails_${id}`
Expand All @@ -263,11 +248,10 @@ class DashManifest
"height": storyboardHeightInPixels
})

xml.Node("EssentialProperty", {
xml.EmptyNode("EssentialProperty", {
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile"
"value": `${storyboardWidth}x${storyboardHeight}`
})
xml.End()

xml.End()
end if
Expand Down Expand Up @@ -399,11 +383,10 @@ class DashManifest
if videoStream.colorInfo.primaries <> invalid
primaries = m.colorInfo.primaries[videoStream.colorInfo.primaries]
if primaries <> invalid
xml.Node("EssentialProperty", {
xml.EmptyNode("EssentialProperty", {
"schemeIdUri": "urn:mpeg:mpegB:cicp:ColourPrimaries"
"value": primaries
})
xml.End()
else
LogWarn("Unknown colorInfo.primaries:", videoStream.colorInfo.primaries)
end if
Expand All @@ -412,11 +395,10 @@ class DashManifest
if videoStream.colorInfo.transferCharacteristics <> invalid
transferCharacteristics = m.colorInfo.transferCharacteristics[videoStream.colorInfo.transferCharacteristics]
if transferCharacteristics <> invalid
xml.Node("EssentialProperty", {
xml.EmptyNode("EssentialProperty", {
"schemeIdUri": "urn:mpeg:mpegB:cicp:TransferCharacteristics"
"value": transferCharacteristics
})
xml.End()
else
LogWarn("Unknown colorInfo.transferCharacteristics:", videoStream.colorInfo.transferCharacteristics)
end if
Expand All @@ -425,11 +407,10 @@ class DashManifest
if videoStream.colorInfo.matrixCoefficients <> invalid
matrixCoefficients = m.colorInfo.matrixCoefficients[videoStream.colorInfo.matrixCoefficients]
if matrixCoefficients <> invalid
xml.Node("EssentialProperty", {
xml.EmptyNode("EssentialProperty", {
"schemeIdUri": "urn:mpeg:mpegB:cicp:MatrixCoefficients"
"value": matrixCoefficients
})
xml.End()
else
LogWarn("Unknown colorInfo.matrixCoefficients:", videoStream.colorInfo.matrixCoefficients)
end if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,22 @@ We apologize for the inconvenience.`
function VerifyTokenScope(token as string) as boolean
tokenObject = ParseJson(token)
if tokenObject = invalid
LogWarn("Failed to json parse token:", token)
return false
end if
if not IsArray(tokenObject.scopes)
LogWarn("Token scopes are not an array:", tokenObject.scopes)
return false
end if

scopes = tokenObject.scopes.join(",")
return scopes = Invidious.AUTH_SCOPES
expectedScopes = Invidious.AUTH_SCOPES
validScopes = expectedScopes = scopes

if not validScopes
LogWarn(`Token scopes do not match expected scopes. Expected: "${expectedScopes}", got: "${scopes}"`)
end if
return validScopes
end function

function DeleteAuthToken()
Expand Down
10 changes: 5 additions & 5 deletions playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ namespace Http
m.http_code = errcode

buffer = `<html><head><title>${errcode} ${errname}</title></head><body>
<h1>${errname}</h1>
${reason}
<hr>
${m.GeneratedBy()}
</body></html>`
<h1>${errname}</h1>
${reason}
<hr>
${m.GeneratedBy()}
</body></html>`

m.SetBodyDataString(buffer)
m.ContentType("text/html")
Expand Down
Loading

0 comments on commit be8f3e3

Please sign in to comment.