Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4676b45567 | ||
|
|
438050fcca | ||
|
|
70e2608e59 | ||
|
|
d2d875f124 | ||
|
|
6a1069337d | ||
|
|
eb67d9e4c0 | ||
|
|
6d9117a2a0 |
No files matched your search
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.39.1] - 2025-05-23
|
||||
|
||||
### Fixed
|
||||
|
||||
- Regression with watch progress introduced in previous release
|
||||
|
||||
## [0.39.0] - 2025-05-23
|
||||
|
||||
### Added
|
||||
|
||||
- New settings category: `Content Feed`
|
||||
- New setting: `Disable Shorts`
|
||||
|
||||
### Fixed
|
||||
|
||||
- A regression with thumbnails not showing from previous release
|
||||
- Inability to login to Invidious when selected backend is Playlet (local)
|
||||
|
||||
## [0.38.2] - 2025-05-22
|
||||
|
||||
### Added
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"hasInstallScript": true,
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.31",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.31",
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-app",
|
||||
"version": "0.38.2"
|
||||
"version": "0.39.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf ../build/playlet-app",
|
||||
|
||||
@@ -2,8 +2,8 @@ title=Playlet
|
||||
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=38
|
||||
build_version=00002
|
||||
minor_version=39
|
||||
build_version=00001
|
||||
|
||||
ui_resolutions=hd
|
||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-lib",
|
||||
"version": "0.38.2"
|
||||
"version": "0.39.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf ../build/playlet-lib",
|
||||
|
||||
@@ -101,9 +101,16 @@ function CreateChannelFeeds(authorId as string, author as string, tabs as object
|
||||
return invalid
|
||||
end if
|
||||
|
||||
disableShorts = m.preferences["content_feed.disable_shorts"]
|
||||
|
||||
feeds = []
|
||||
for i = 0 to tabs.count() - 1
|
||||
tabName = tabs[i]
|
||||
if tabName = "shorts" and disableShorts
|
||||
LogInfo(`Skipping "Shorts" tab based on user settings`)
|
||||
continue for
|
||||
end if
|
||||
|
||||
if m.tabs.DoesExist(tabName)
|
||||
if tabsParams <> invalid and tabsParams.DoesExist(tabName)
|
||||
params = tabsParams[tabName]
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<field id="isSubscribed" type="boolean" onChange="OnSubscriptionChanged" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<field id="invidious" type="node" bind="/Invidious" />
|
||||
<field id="preferences" type="node" bind="/Preferences" />
|
||||
<field id="bookmarksService" type="node" bind="/BookmarksService" />
|
||||
<function name="ShowSortDialog" />
|
||||
</interface>
|
||||
|
||||
@@ -182,32 +182,13 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function Search(query as string, options = invalid as object) as object
|
||||
searchFilters = invalid
|
||||
continuation = ""
|
||||
cancellation = invalid
|
||||
raw = false
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("searchFilters")
|
||||
searchFilters = options.searchFilters
|
||||
end if
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
end if
|
||||
|
||||
return Innertube.Search(query, searchFilters, continuation, cancellation, raw)
|
||||
return Innertube.Search(query, options)
|
||||
end function
|
||||
|
||||
function GetTrending(options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
params = ""
|
||||
disableShorts = false
|
||||
raw = false
|
||||
|
||||
if options <> invalid
|
||||
@@ -228,6 +209,9 @@ namespace InnertubeService
|
||||
params = "4gIKGgh0cmFpbGVycw%3D%3D"
|
||||
end if
|
||||
end if
|
||||
if options.DoesExist("disableShorts")
|
||||
disableShorts = options.disableShorts
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
@@ -252,7 +236,10 @@ namespace InnertubeService
|
||||
return response.Json()
|
||||
end if
|
||||
|
||||
feeds = Innertube.ParseResponseDataForFeeds(response.Json(), { skipCreatorOnTheRise: true })
|
||||
feeds = Innertube.ParseResponseDataForFeeds(response.Json(), {
|
||||
disableCreatorOnTheRise: true
|
||||
disableShorts: disableShorts
|
||||
})
|
||||
|
||||
result = {
|
||||
feeds: feeds
|
||||
@@ -286,6 +273,7 @@ namespace InnertubeService
|
||||
cancellation = invalid
|
||||
accessToken = invalid
|
||||
continuation = ""
|
||||
disableShorts = false
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
@@ -297,6 +285,9 @@ namespace InnertubeService
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("disableShorts")
|
||||
disableShorts = options.disableShorts
|
||||
end if
|
||||
end if
|
||||
|
||||
request = Innertube.CreateBrowseRequest(browserId, Innertube.ClientType.Tv, "", continuation)
|
||||
@@ -312,7 +303,7 @@ namespace InnertubeService
|
||||
}
|
||||
end if
|
||||
|
||||
feeds = Innertube.ParseResponseDataForFeeds(response.Json())
|
||||
feeds = Innertube.ParseResponseDataForFeeds(response.Json(), { disableShorts: disableShorts })
|
||||
|
||||
result = {
|
||||
feeds: feeds
|
||||
|
||||
@@ -112,6 +112,7 @@ namespace Innertube
|
||||
"searchBarRenderer": ParseNotImplemented
|
||||
"clickTrackingParams": ParseNotImplemented
|
||||
"promoShelfRenderer": ParseNotImplemented
|
||||
"statementBannerRenderer": ParseNotImplemented
|
||||
"adSlotRenderer": ParseNotImplemented
|
||||
"adsControlFlowOpportunityReceivedCommand": ParseNotImplemented
|
||||
}
|
||||
@@ -156,13 +157,13 @@ namespace Innertube
|
||||
end function
|
||||
|
||||
function ParseShelfRenderer(nodeData as object, context as object) as object
|
||||
if context.skipCreatorOnTheRise = true
|
||||
if context.disableCreatorOnTheRise = true
|
||||
badges = nodeData["badges"]
|
||||
if IsArray(badges)
|
||||
for each badge in badges
|
||||
if ValidString(ObjectUtils.Dig(badge, ["metadataBadgeRenderer", "style"])) = "BADGE_STYLE_TYPE_FEATURED"
|
||||
label = ParseText(ObjectUtils.Dig(badge, ["metadataBadgeRenderer", "label"]))
|
||||
LogInfo(`Skipping 'Create on the Rise' shelf (${label})`)
|
||||
LogInfo(`Skipping 'Creator on the Rise' shelf (${label})`)
|
||||
return invalid
|
||||
end if
|
||||
end for
|
||||
@@ -179,7 +180,11 @@ namespace Innertube
|
||||
return nodeData["contents"]
|
||||
end function
|
||||
|
||||
function ParseReelShelfRenderer(nodeData as object, _context as object) as object
|
||||
function ParseReelShelfRenderer(nodeData as object, context as object) as object
|
||||
if context.disableShorts = true
|
||||
LogInfo("Skipping ReelShelfRenderer based on user settings")
|
||||
return invalid
|
||||
end if
|
||||
' TODO: handle reelShelfRenderer.title
|
||||
return nodeData["items"]
|
||||
end function
|
||||
@@ -276,20 +281,31 @@ namespace Innertube
|
||||
end if
|
||||
end if
|
||||
|
||||
liveNow = ValidString(ObjectUtils.Dig(nodeData, ["badges", 0, "metadataBadgeRenderer", "icon", "iconType"])) = "LIVE"
|
||||
if not liveNow
|
||||
thumbnailOverlays = nodeData["thumbnailOverlays"]
|
||||
if IsArray(thumbnailOverlays)
|
||||
for each overlay in thumbnailOverlays
|
||||
if ValidString(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "style"])) = "LIVE"
|
||||
liveNow = true
|
||||
exit for
|
||||
isUpcoming = false
|
||||
liveNow = false
|
||||
|
||||
thumbnailOverlays = nodeData["thumbnailOverlays"]
|
||||
if IsArray(thumbnailOverlays)
|
||||
for each overlay in thumbnailOverlays
|
||||
parsedTimeStatusRenderer = ParseThumbnailOverlayTimeStatusRenderer(overlay)
|
||||
if parsedTimeStatusRenderer <> invalid
|
||||
if parsedTimeStatusRenderer.isShort
|
||||
if context.disableShorts = true
|
||||
LogInfo("Skipping Short based on user settings")
|
||||
return invalid
|
||||
end if
|
||||
end if
|
||||
end for
|
||||
end if
|
||||
|
||||
liveNow = liveNow or parsedTimeStatusRenderer.isLive
|
||||
isUpcoming = isUpcoming or parsedTimeStatusRenderer.isUpcoming
|
||||
end if
|
||||
end for
|
||||
end if
|
||||
|
||||
if ValidString(ObjectUtils.Dig(nodeData, ["badges", 0, "metadataBadgeRenderer", "icon", "iconType"])) = "LIVE"
|
||||
liveNow = true
|
||||
end if
|
||||
|
||||
isUpcoming = false
|
||||
premiereTimestamp = ObjectUtils.Dig(nodeData, ["upcomingEventData", "startTime"])
|
||||
if IsString(premiereTimestamp)
|
||||
premiereTimestamp = premiereTimestamp.ToInt()
|
||||
@@ -362,9 +378,12 @@ namespace Innertube
|
||||
thumbnailOverlays = nodeData["thumbnailOverlays"]
|
||||
if IsArray(thumbnailOverlays)
|
||||
for each overlay in thumbnailOverlays
|
||||
lengthText = ParseText(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "text"]))
|
||||
if lengthText <> ""
|
||||
exit for
|
||||
parsedTimeStatusRenderer = ParseThumbnailOverlayTimeStatusRenderer(overlay)
|
||||
if parsedTimeStatusRenderer <> invalid
|
||||
lengthText = parsedTimeStatusRenderer.text
|
||||
if lengthText <> ""
|
||||
exit for
|
||||
end if
|
||||
end if
|
||||
end for
|
||||
end if
|
||||
@@ -518,8 +537,18 @@ namespace Innertube
|
||||
thumbnailOverlays = nodeData["thumbnailOverlays"]
|
||||
if IsArray(thumbnailOverlays)
|
||||
for each overlay in thumbnailOverlays
|
||||
liveNow = liveNow or (ValidString(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "style"])) = "LIVE")
|
||||
isUpcoming = isUpcoming or (ValidString(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "style"])) = "UPCOMING")
|
||||
parsedTimeStatusRenderer = ParseThumbnailOverlayTimeStatusRenderer(overlay)
|
||||
if parsedTimeStatusRenderer <> invalid
|
||||
if parsedTimeStatusRenderer.isShort
|
||||
if context.disableShorts = true
|
||||
LogInfo("Skipping Short based on user settings")
|
||||
return invalid
|
||||
end if
|
||||
end if
|
||||
|
||||
liveNow = liveNow or parsedTimeStatusRenderer.isLive
|
||||
isUpcoming = isUpcoming or parsedTimeStatusRenderer.isUpcoming
|
||||
end if
|
||||
end for
|
||||
end if
|
||||
|
||||
@@ -869,6 +898,11 @@ namespace Innertube
|
||||
end function
|
||||
|
||||
function ParseShortsLockupViewModel(nodeData as object, context as object) as object
|
||||
if context.disableShorts = true
|
||||
LogInfo("Skipping Short based on user settings")
|
||||
return invalid
|
||||
end if
|
||||
|
||||
videoId = ObjectUtils.Dig(nodeData, ["onTap", "innertubeCommand", "reelWatchEndpoint", "videoId"])
|
||||
if not IsString(videoId)
|
||||
LogWarn("Invalid video ID", nodeData)
|
||||
@@ -978,17 +1012,30 @@ namespace Innertube
|
||||
thumbnailOverlays = ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnailOverlays"])
|
||||
if IsArray(thumbnailOverlays)
|
||||
for each overlay in thumbnailOverlays
|
||||
maybeLengthText = ParseText(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "text"]))
|
||||
if maybeLengthText <> ""
|
||||
lengthText = maybeLengthText
|
||||
parsedTimeStatusRenderer = ParseThumbnailOverlayTimeStatusRenderer(overlay)
|
||||
if parsedTimeStatusRenderer <> invalid
|
||||
if parsedTimeStatusRenderer.isShort
|
||||
if context.disableShorts = true
|
||||
LogInfo("Skipping Short based on user settings")
|
||||
return invalid
|
||||
end if
|
||||
end if
|
||||
|
||||
maybeLengthText = parsedTimeStatusRenderer.text
|
||||
if maybeLengthText <> ""
|
||||
lengthText = maybeLengthText
|
||||
end if
|
||||
|
||||
liveNow = liveNow or parsedTimeStatusRenderer.isLive
|
||||
isUpcoming = isUpcoming or parsedTimeStatusRenderer.isUpcoming
|
||||
end if
|
||||
|
||||
maybePercentDurationWatched = ObjectUtils.Dig(overlay, ["thumbnailOverlayResumePlaybackRenderer", "percentDurationWatched"])
|
||||
if maybePercentDurationWatched <> invalid
|
||||
percentDurationWatched = maybePercentDurationWatched
|
||||
end if
|
||||
liveNow = liveNow or (ValidString(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "style"])) = "LIVE")
|
||||
isUpcoming = isUpcoming or (ValidString(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "style"])) = "UPCOMING")
|
||||
end for
|
||||
|
||||
if liveNow or isUpcoming
|
||||
lengthText = ""
|
||||
end if
|
||||
@@ -1022,6 +1069,11 @@ namespace Innertube
|
||||
end function
|
||||
|
||||
function TileRendererTypeShorts(nodeData as object, context as object) as object
|
||||
if context.disableShorts = true
|
||||
LogInfo("Skipping Short based on user settings")
|
||||
return invalid
|
||||
end if
|
||||
|
||||
videoId = nodeData["contentId"]
|
||||
if not IsString(videoId)
|
||||
LogWarn("Invalid video ID", nodeData)
|
||||
@@ -1204,6 +1256,34 @@ namespace Innertube
|
||||
return ParseText(data["text"])
|
||||
end function
|
||||
|
||||
function ParseThumbnailOverlayTimeStatusRenderer(data as object) as object
|
||||
if data = invalid
|
||||
return invalid
|
||||
end if
|
||||
if not IsAssociativeArray(data) or not data.DoesExist("thumbnailOverlayTimeStatusRenderer")
|
||||
return invalid
|
||||
end if
|
||||
|
||||
renderer = data["thumbnailOverlayTimeStatusRenderer"]
|
||||
if not IsAssociativeArray(renderer)
|
||||
return invalid
|
||||
end if
|
||||
|
||||
text = ParseText(renderer["text"])
|
||||
|
||||
overlayStyle = ValidString(renderer["style"])
|
||||
isLive = overlayStyle = "LIVE"
|
||||
isUpcoming = overlayStyle = "UPCOMING"
|
||||
isShort = overlayStyle = "SHORTS"
|
||||
|
||||
return {
|
||||
"text": text
|
||||
"isLive": isLive
|
||||
"isUpcoming": isUpcoming
|
||||
"isShort": isShort
|
||||
}
|
||||
end function
|
||||
|
||||
function StartNewFeed(title as string, context as object) as void
|
||||
if context.currentFeed <> invalid
|
||||
if context.currentFeed.items.Count() = 0 and context.currentFeed.title = ""
|
||||
|
||||
@@ -6,7 +6,31 @@ import "pkg:/source/utils/Types.bs"
|
||||
|
||||
namespace Innertube
|
||||
|
||||
function Search(query as string, searchFilters as object, continuation = "" as string, cancellation = invalid as object, raw = false as boolean) as object
|
||||
function Search(query as string, options = invalid as object) as object
|
||||
searchFilters = invalid
|
||||
continuation = ""
|
||||
cancellation = invalid
|
||||
disableShorts = false
|
||||
raw = false
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("searchFilters")
|
||||
searchFilters = options.searchFilters
|
||||
end if
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("disableShorts")
|
||||
disableShorts = options.disableShorts
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
end if
|
||||
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
@@ -51,7 +75,7 @@ namespace Innertube
|
||||
return response.Json()
|
||||
end if
|
||||
|
||||
feeds = ParseResponseDataForFeeds(response.Json())
|
||||
feeds = ParseResponseDataForFeeds(response.Json(), { disableShorts: disableShorts })
|
||||
|
||||
result = {
|
||||
feeds: feeds
|
||||
|
||||
@@ -7,10 +7,14 @@ function Init()
|
||||
m.service = new Invidious.InvidiousService(m.top)
|
||||
end function
|
||||
|
||||
function GetCurrentInstance(_unused as dynamic) as string
|
||||
function GetInstance(_unused as dynamic) as string
|
||||
return m.service.GetInstance()
|
||||
end function
|
||||
|
||||
function GetInvidiousInstance(_unused as dynamic) as string
|
||||
return m.service.GetInvidiousInstance()
|
||||
end function
|
||||
|
||||
function GetAuthorizeTokenLink(_unused as dynamic) as dynamic
|
||||
return m.service.GetAuthorizeTokenLink()
|
||||
end function
|
||||
@@ -8,7 +8,8 @@
|
||||
<field id="authToken" type="assocarray" />
|
||||
<field id="apiDefinitions" type="assocarray" />
|
||||
|
||||
<function name="GetCurrentInstance" />
|
||||
<function name="GetInstance" />
|
||||
<function name="GetInvidiousInstance" />
|
||||
<function name="GetAuthorizeTokenLink" />
|
||||
</interface>
|
||||
</component>
|
||||
@@ -15,7 +15,7 @@ import "pkg:/source/utils/TimeUtils.bs"
|
||||
namespace Invidious
|
||||
const INSTANCES_API = "https://api.invidious.io/instances.json?sort_by=type,users"
|
||||
|
||||
const DEFAULT_INSTANCE = "http://127.0.0.1:8888/playlet-invidious-backend"
|
||||
const PLAYLET_BUILT_IN_INSTANCE = "http://127.0.0.1:8888/playlet-invidious-backend"
|
||||
const INSTANCE_EXAMPLE = "https://invidious.example.com"
|
||||
|
||||
const TOKEN_CALLBACK = "/invidious/token_callback"
|
||||
@@ -73,13 +73,25 @@ namespace Invidious
|
||||
|
||||
backend = m.preferences["backend.selected"]
|
||||
if backend = "invidious"
|
||||
instance = m.preferences["invidious.instance"]
|
||||
instance = m.GetInvidiousInstance()
|
||||
if not StringUtils.IsNullOrEmpty(instance)
|
||||
return instance
|
||||
end if
|
||||
end if
|
||||
|
||||
instance = DEFAULT_INSTANCE
|
||||
return m.GetPlayletBuiltinInstance()
|
||||
end function
|
||||
|
||||
function GetInvidiousInstance() as string
|
||||
if m.preferences = invalid
|
||||
m.preferences = m.invidiousNode.preferences
|
||||
end if
|
||||
|
||||
return m.preferences["invidious.instance"]
|
||||
end function
|
||||
|
||||
function GetPlayletBuiltinInstance() as string
|
||||
instance = PLAYLET_BUILT_IN_INSTANCE
|
||||
address = m.invidiousNode.webServer@.GetServerAddress()
|
||||
instance = instance.Replace("http://127.0.0.1:8888", address)
|
||||
return instance
|
||||
@@ -732,7 +744,11 @@ namespace Invidious
|
||||
end function
|
||||
|
||||
function GetAuthorizeTokenLink() as dynamic
|
||||
instance = m.GetInstance()
|
||||
instance = m.GetInvidiousInstance()
|
||||
if StringUtils.IsNullOrEmpty(instance)
|
||||
instance = m.GetPlayletBuiltinInstance()
|
||||
end if
|
||||
|
||||
' Make sure the host is not on https, because https cannot redirect to http, which is our local server
|
||||
invidiousHost = instance.Replace("https://", "http://")
|
||||
|
||||
|
||||
@@ -170,15 +170,16 @@ namespace InvidiousContent
|
||||
end if
|
||||
end function
|
||||
|
||||
function VideoSetThumbnail(node as object, videoItem as object, instance as dynamic, quality = "medium" as string) as boolean
|
||||
function VideoSetThumbnail(node as object, videoItem as object, instance as dynamic, quality = "medium" as string) as void
|
||||
videoThumbnails = videoItem.videoThumbnails
|
||||
hasValidInstance = not StringUtils.IsNullOrEmpty(instance) and instance.InStr(":8888/playlet-invidious-backend") = -1
|
||||
if videoThumbnails = invalid or videoThumbnails.Count() = 0
|
||||
if StringUtils.IsNullOrEmpty(instance)
|
||||
node.thumbnail = `https://i.ytimg.com/vi/${videoItem.videoId}/mqdefault.jpg`
|
||||
else
|
||||
if hasValidInstance
|
||||
node.thumbnail = `${instance}/vi/${videoItem.videoId}/mqdefault.jpg`
|
||||
else
|
||||
node.thumbnail = `https://i.ytimg.com/vi/${videoItem.videoId}/mqdefault.jpg`
|
||||
end if
|
||||
return false
|
||||
return
|
||||
end if
|
||||
url = invalid
|
||||
for each thumbnail in videoThumbnails
|
||||
@@ -191,13 +192,13 @@ namespace InvidiousContent
|
||||
url = videoThumbnails[0].url
|
||||
end if
|
||||
if url.startsWith("/")
|
||||
if StringUtils.IsNullOrEmpty(instance)
|
||||
return false
|
||||
if hasValidInstance
|
||||
url = instance + url
|
||||
else
|
||||
url = `https://i.ytimg.com/vi/${videoItem.videoId}/mqdefault.jpg`
|
||||
end if
|
||||
url = instance + url
|
||||
end if
|
||||
node.thumbnail = url
|
||||
return true
|
||||
end function
|
||||
|
||||
function VideoIsLive(videoItem as object) as boolean
|
||||
@@ -288,16 +289,16 @@ namespace InvidiousContent
|
||||
end if
|
||||
|
||||
thumbnail = ""
|
||||
hasValidInstance = not StringUtils.IsNullOrEmpty(instance) and instance.InStr(":8888/playlet-invidious-backend") = -1
|
||||
if IsString(playlistItem.playlistThumbnail)
|
||||
thumbnailUrl = playlistItem.playlistThumbnail
|
||||
if thumbnailUrl.startsWith("/") and not StringUtils.IsNullOrEmpty(playlistItem.instance)
|
||||
if thumbnailUrl.startsWith("/") and hasValidInstance
|
||||
thumbnailUrl = playlistItem.instance + thumbnailUrl
|
||||
end if
|
||||
thumbnail = thumbnailUrl
|
||||
else if playlistItem.videos <> invalid and playlistItem.videos.Count() > 0 and playlistItem.videos[0].index = 0
|
||||
if VideoSetThumbnail(node, playlistItem.videos[0], instance, quality)
|
||||
return
|
||||
end if
|
||||
VideoSetThumbnail(node, playlistItem.videos[0], instance, quality)
|
||||
return
|
||||
else if node.getChildCount() > 0
|
||||
thumbnail = node.getChild(0).thumbnail
|
||||
end if
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "pkg:/source/utils/RegistryUtils.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
@@ -93,23 +94,21 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
|
||||
isDirty = false
|
||||
|
||||
' v0 -> v1
|
||||
instances = RegistryUtils.Read(RegistryUtils.INVIDIOUS_INSTANCES)
|
||||
if instances <> invalid
|
||||
currentInstance = userPrefs["invidious.instance"]
|
||||
if currentInstance = invalid or currentInstance = ""
|
||||
instances = ParseJson(instances)
|
||||
if instances.Count() > 0
|
||||
instance = instances[0]
|
||||
if instance <> invalid and instance <> ""
|
||||
userPrefs["invidious.instance"] = instance
|
||||
isDirty = true
|
||||
if ValidInt(userPrefs.__version) = 0
|
||||
instances = RegistryUtils.Read(RegistryUtils.INVIDIOUS_INSTANCES)
|
||||
if not StringUtils.IsNullOrEmpty(instances)
|
||||
currentInstance = userPrefs["invidious.instance"]
|
||||
if StringUtils.IsNullOrEmpty(currentInstance)
|
||||
instances = ParseJson(instances)
|
||||
if IsArray(instances) and instances.Count() > 0
|
||||
instance = instances[0]
|
||||
if not StringUtils.IsNullOrEmpty(instance)
|
||||
userPrefs["invidious.instance"] = instance
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
RegistryUtils.Delete(RegistryUtils.INVIDIOUS_INSTANCES)
|
||||
end if
|
||||
RegistryUtils.Delete(RegistryUtils.INVIDIOUS_INSTANCES)
|
||||
end if
|
||||
|
||||
if ValidInt(userPrefs.__version) = 0
|
||||
userPrefs.__version = 1
|
||||
isDirty = true
|
||||
end if
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace VideoQueueUtils
|
||||
end if
|
||||
|
||||
LogInfo(`Playing next recommended video (${videoId})`)
|
||||
instance = invidiousNode@.GetCurrentInstance()
|
||||
instance = invidiousNode@.GetInstance()
|
||||
node = InvidiousContent.ToVideoContentNode(invalid, recommendedVideo, instance)
|
||||
videoQueue.playVideo = node
|
||||
return true
|
||||
|
||||
+7
-1
@@ -8,7 +8,9 @@ namespace Http
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.innertube = server.task.innertube
|
||||
task = server.task
|
||||
m.innertube = task.innertube
|
||||
m.preferences = task.preferences
|
||||
end function
|
||||
|
||||
@get("/playlet-invidious-backend/authorize_token")
|
||||
@@ -65,6 +67,7 @@ namespace Http
|
||||
|
||||
options = {
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
||||
}
|
||||
continuation = request.query.continuation
|
||||
if not StringUtils.IsNullOrEmpty(continuation)
|
||||
@@ -247,6 +250,7 @@ namespace Http
|
||||
raw = request.query.raw <> invalid
|
||||
|
||||
options = {
|
||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
||||
raw: raw
|
||||
type: request.query.type
|
||||
}
|
||||
@@ -295,6 +299,7 @@ namespace Http
|
||||
|
||||
options = {
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
||||
}
|
||||
|
||||
continuation = request.query.continuation
|
||||
@@ -360,6 +365,7 @@ namespace Http
|
||||
raw = request.query.raw <> invalid
|
||||
|
||||
options = {
|
||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
||||
raw: raw
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ namespace Http
|
||||
|
||||
if keysDict["invidious"] = true
|
||||
state["invidious"] = {
|
||||
current_instance: m.invidiousNode@.GetCurrentInstance()
|
||||
instance: m.invidiousNode@.GetInstance()
|
||||
invidious_instance: m.invidiousNode@.GetInvidiousInstance()
|
||||
auth_url: m.invidiousNode@.GetAuthorizeTokenLink()
|
||||
}
|
||||
end if
|
||||
|
||||
@@ -53,6 +53,20 @@
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayText: "Content Feed",
|
||||
key: "content_feed",
|
||||
description: "Feed preferences",
|
||||
children: [
|
||||
{
|
||||
displayText: "Disable Shorts",
|
||||
key: "content_feed.disable_shorts",
|
||||
description: "Disable short videos.",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayText: "Invidious",
|
||||
key: "invidious",
|
||||
|
||||
@@ -768,6 +768,22 @@
|
||||
<source>The backend used for browsing and playing videos.</source>
|
||||
<translation>The backend used for browsing and playing videos.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Content Feed</source>
|
||||
<translation>Content Feed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Feed preferences</source>
|
||||
<translation>Feed preferences</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable Shorts</source>
|
||||
<translation>Disable Shorts</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable short videos.</source>
|
||||
<translation>Disable short videos.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invidious preferences</source>
|
||||
<translation>Invidious preferences</translation>
|
||||
|
||||
@@ -2,8 +2,8 @@ title=PlayletLib
|
||||
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=38
|
||||
build_version=00002
|
||||
minor_version=39
|
||||
build_version=00001
|
||||
|
||||
ui_resolutions=hd
|
||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||
|
||||
@@ -250,6 +250,11 @@ namespace Locale
|
||||
SelectedBackend = "Selected backend"
|
||||
SelectedBackendDescription = "The backend used for browsing and playing videos."
|
||||
|
||||
ContentFeed = "Content Feed"
|
||||
ContentPreferences = "Feed preferences"
|
||||
DisableShorts = "Disable Shorts"
|
||||
DisableShortsDescription = "Disable short videos."
|
||||
|
||||
' "Invidious" is used as node id, so we can't use it before refactoring node ids.
|
||||
' Either way, Invidious doesn't translate, so it's fine to skip it here
|
||||
' Invidious = "Invidious"
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-web",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.38.2",
|
||||
"version": "0.39.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
let invidiousApi = new InvidiousApi();
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
invidiousApi.instance = value?.invidious?.current_instance;
|
||||
invidiousApi.instance = value?.invidious?.instance;
|
||||
});
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
authUrl = value?.invidious?.auth_url;
|
||||
currentInstance = value?.invidious?.current_instance || "";
|
||||
currentInstance =
|
||||
value?.invidious?.invidious_instance || value?.invidious?.instance || "";
|
||||
if (currentInstance === `${host()}/playlet-invidious-backend`) {
|
||||
const trFn = get(translate);
|
||||
currentInstanceName = trFn("Playlet built-in backend");
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
let searchFiltersLabel;
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
invidiousApi.instance = value?.invidious?.current_instance;
|
||||
invidiousApi.instance = value?.invidious?.instance;
|
||||
let userCountryCode = value?.device?.user_country_code;
|
||||
if (!userCountryCode || userCountryCode === "OT") {
|
||||
userCountryCode = "US";
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
tvName = value?.device?.friendly_name ?? "Roku TV";
|
||||
invidiousInstance = value?.invidious?.current_instance;
|
||||
invidiousInstance = value?.invidious?.instance;
|
||||
});
|
||||
|
||||
async function openOnTv() {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
tvName = value?.device?.friendly_name ?? "Roku TV";
|
||||
invidiousInstance = value?.invidious?.current_instance;
|
||||
invidiousInstance = value?.invidious?.instance;
|
||||
});
|
||||
|
||||
async function playOnTv() {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
let invidiousInstance;
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
invidiousInstance = value?.invidious?.current_instance;
|
||||
invidiousInstance = value?.invidious?.instance;
|
||||
});
|
||||
|
||||
function getUpdatedText() {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
tvName = value?.device?.friendly_name ?? "Roku TV";
|
||||
invidiousInstance = value?.invidious?.current_instance;
|
||||
invidiousInstance = value?.invidious?.instance;
|
||||
});
|
||||
|
||||
async function playOnTv() {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
let invidiousInstance;
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
invidiousInstance = value?.invidious?.current_instance;
|
||||
invidiousInstance = value?.invidious?.instance;
|
||||
});
|
||||
|
||||
function getViewCountDateText() {
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
let invidiousApi = new InvidiousApi();
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
invidiousApi.instance = value?.invidious?.current_instance;
|
||||
invidiousApi.instance = value?.invidious?.instance;
|
||||
let userCountryCode = value?.device?.user_country_code;
|
||||
if (!userCountryCode || userCountryCode === "OT") {
|
||||
userCountryCode = "US";
|
||||
|
||||
@@ -22,8 +22,15 @@
|
||||
videoThumbnails.find((thumbnail) => thumbnail.quality === "medium") ||
|
||||
videoThumbnails[0];
|
||||
let url = videoThumbnail.url;
|
||||
if (url.startsWith("/") && invidiousInstance) {
|
||||
url = invidiousInstance + url;
|
||||
if (url.startsWith("/")) {
|
||||
if (
|
||||
invidiousInstance &&
|
||||
!invidiousInstance.includes(":8888/playlet-invidious-backend")
|
||||
) {
|
||||
url = invidiousInstance + url;
|
||||
} else {
|
||||
url = `https://i.ytimg.com/vi/${videoId}/mqdefault.jpg`;
|
||||
}
|
||||
}
|
||||
thumbnailUrl = url;
|
||||
} else if (invidiousInstance) {
|
||||
|
||||
Reference in new issue
Block a user