Compare commits

...
75 Commits
Author SHA1 Message Date
Brahim Hadriche ab246e8080 Release v0.38.2 (#619) 2025-05-22 18:06:24 -04:00
Brahim Hadriche 7f3591409e [skip ci] delete openapi spec 2025-05-22 18:03:08 -04:00
Brahim Hadriche 650e70f271 [skip ci] locale 2025-05-22 17:58:55 -04:00
Brahim Hadriche a9f70b48aa Remove open api spec 2025-05-22 17:46:52 -04:00
Brahim Hadriche becb8b04f5 Refactor settings 2025-05-22 17:41:47 -04:00
Brahim Hadriche 68a4f9fade Show lines in playlist view 2025-05-21 21:21:42 -04:00
Brahim Hadriche 07ebd011cf Refresh client versions 2025-05-21 20:17:53 -04:00
Brahim Hadriche d210d84d63 changelog 2025-05-21 12:08:48 -04:00
Weblate (bot)andLacey Anaya 1e129e9a73 Translated using Weblate (German) (#616)
Currently translated at 100.0% (320 of 320 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/de/

Co-authored-by: Lacey Anaya <yecakeh263@anawalls.com>
2025-05-21 12:08:35 -04:00
Brahim Hadriche 1c6b47a5a6 Handle TILE_CONTENT_TYPE_SHORTS 2025-05-21 09:06:17 -04:00
Brahim Hadriche 013e2f49ca Release v0.38.1 (#614) 2025-05-20 12:30:45 -04:00
Brahim Hadriche d2fbd59d6a Fix video does not continuing from previous progress when opened 2025-05-20 12:27:21 -04:00
Brahim Hadriche f681a7024c Fix history cache, show percent watched in web app 2025-05-19 18:56:07 -04:00
Brahim Hadriche e9c2ab9f76 Release v0.38.0 (#613) 2025-05-19 18:02:20 -04:00
Brahim Hadriche aed102f57a Fix a bug where watch history videos repeat indefinitely 2025-05-19 17:50:50 -04:00
Brahim Hadricheandgithub-action linter 8b123b18f5 Watching progress (#609)
* Watching progress

* watch time endpoint

* Lint fix

* Changelog

* options mandatory

* tweak

* tweak

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2025-05-19 17:35:35 -04:00
Brahim Hadriche 158788b42e [skip ci] typo 2025-05-17 17:37:21 -04:00
Brahim Hadriche 8d42c0213b Fix proxying in dash manifest (#607)
* Fix proxying in dash manifest

* Changelog
2025-05-17 16:25:24 -04:00
Brahim Hadriche 7c1aa80819 Fix a bug where playlists with small number of videos has duplicates 2025-05-17 15:17:43 -04:00
Brahim Hadriche 30ea007502 A couple of fixes 2025-05-17 09:42:19 -04:00
Brahim Hadriche fc7a029147 [chore] update dependencies (#606)
* update dependencies

* Backend changes
2025-05-16 23:43:10 -04:00
Brahim Hadriche cbb34d45fc Release v0.37.0 (#605)
* Release v0.37.0

* web app adjustments
2025-05-16 18:19:52 -04:00
Brahim Hadriche beeb21283d [skip ci] error formatting tweak 2025-05-16 11:59:02 -04:00
Brahim Hadriche 89ec969c40 YouTube account support enabled 2025-05-15 22:44:41 -04:00
Brahim Hadriche 0e226cfc42 CORS change 2025-05-15 22:22:52 -04:00
Brahim Hadriche 5762de656c Ignore videoSurveyShelfRenderer 2025-05-15 22:18:01 -04:00
Brahim Hadriche a721cd3f0a [skip ci] YouTube account disclaimer 2025-05-15 22:11:24 -04:00
Brahim Hadriche 8c0692dc10 Fix formatting 2025-05-15 21:56:38 -04:00
Brahim Hadriche 21c7aee907 [skip ci] Update Privacy 2025-05-15 21:55:01 -04:00
Brahim Hadriche 227a5157a5 Parse metadata lines on tv feeds 2025-05-15 21:50:40 -04:00
Brahim Hadriche 4fc44becd2 OAuth: mark video watched (#604)
* OAuth: mark video watched

* remove comment

* Tweaks
2025-05-15 18:29:18 -04:00
Brahim Hadricheandgithub-action linter 918b763384 OAuth: subscribe/unsubscribe (#603)
* OAuth: subscribe/unsubscribe

* Lint fix

* Cancel fetch status when subscribe button is clicked

* tweak

* error handling

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2025-05-14 20:11:18 -04:00
Brahim Hadriche e821464451 OAuth: recommended feed 2025-05-13 18:08:34 -04:00
Brahim Hadriche fb030cee97 OAuth: Fix auth playlist duplication issue 2025-05-13 13:56:32 -04:00
Brahim Hadriche 6e13e3009a [skip ci] Make username label wider 2025-05-12 22:18:15 -04:00
Brahim Hadriche b38f105e02 Private playlists, continuation 2025-05-12 19:58:07 -04:00
Brahim Hadriche 9b58bf47ad Do not print auth token to logs 2025-05-11 20:05:10 -04:00
Brahim Hadriche af12ac43be [skip ci] Display YouTube profile in web app 2025-05-11 19:47:38 -04:00
Brahim Hadriche 32f0477f36 OAuth fix lock from web app in case Invidious instance is not Playlet backend 2025-05-11 19:47:16 -04:00
Brahim Hadriche dcadb1ec17 Add Canadian english locale file 2025-05-11 15:58:10 -04:00
Brahim Hadriche 02c9358eb1 [skip ci] ignore adsControlFlowOpportunityReceivedCommand 2025-05-11 15:47:46 -04:00
Brahim Hadriche dea178f78e [skip ci] ignore adSlotRenderer 2025-05-11 15:42:25 -04:00
Brahim Hadriche 1268f63bbc Fix isue with web app fetching translation for locale en_CA 2025-05-11 12:41:37 -04:00
Brahim Hadriche cd10f237f4 [skip ci] Handle singleColumnBrowseResultsRenderer 2025-05-10 22:39:01 -04:00
Brahim Hadriche 64c23ade48 update dependencies (#600) 2025-05-10 21:12:01 -04:00
Brahim Hadricheandgithub-action linter 1dcd88a9a4 OAuth refresh token (#601)
* OAuth refresh token

* Lint fix

* tweak refresh logic

* error handling cancelled request

* Ignore endScreenPlaylistRenderer

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2025-05-10 21:04:07 -04:00
Brahim Hadriche b040b2997c Rotate visitor data every day 2025-05-08 21:48:52 -04:00
Brahim Hadriche 21a10705f1 Handle unauthorized case in backend 2025-05-06 17:05:01 -04:00
Brahim Hadriche 1120d40085 [skip ci] skip genericPromoRenderer 2025-05-05 21:56:16 -04:00
Brahim Hadriche 2b633888f4 [skip ci] TODO for adding "mark as watched" 2025-05-05 20:06:47 -04:00
Brahim Hadriche af4a6ee726 placeholder 2025-05-05 20:05:26 -04:00
Brahim Hadricheandgithub-action linter f3f9327c1c Process local http request (#599)
* Local http?

* option utils

* Fix for hanging web app

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2025-05-05 17:21:12 -04:00
Brahim Hadriche fae875845a Remove workaround no longer needed 2025-05-04 10:47:19 -04:00
Brahim Hadriche 17aca0b8bf Release v0.36.7 (#597) 2025-05-03 22:40:45 -04:00
Brahim Hadriche 49390ab0ae Fixed Playlet backend error caused by Roku 14.5 update on Canada devices 2025-05-03 22:34:57 -04:00
Brahim Hadriche bb2ca5515b [skip ci] tweak 2025-05-03 12:02:18 -04:00
Brahim Hadriche e15b6ec958 [skip ci] small tweak 2025-05-03 11:40:06 -04:00
Brahim Hadriche 6a80fe6c74 Parse gridShelfViewModel 2025-05-03 11:37:37 -04:00
Brahim Hadriche 0d61d1e337 Release v0.36.6 (#596) 2025-05-03 10:42:26 -04:00
Brahim Hadriche 33c6e174ee [chore] update dependencies (#595)
* update dependencies

* Bottom nav ui fix

* Bottom nav ui fix2

* changelog

* Backend logging
2025-05-03 10:34:40 -04:00
Brahim Hadriche 91b17fa4a4 Release v0.36.5 (#594) 2025-05-02 19:51:07 -04:00
Brahim Hadriche 943d39af33 Update innertube versions 2025-05-02 19:43:25 -04:00
Brahim Hadriche e8015d52ff Log unknown nodes better 2025-05-02 19:43:07 -04:00
Brahim Hadriche d919489f50 Fixed small error handling bug in Playlet backend 2025-05-01 22:18:23 -04:00
Brahim Hadriche 62675446b2 Update readme link and changelog 2025-04-29 22:28:23 -04:00
Brahim Hadriche 4a8b12294d Update README.md 2025-04-22 15:05:54 -04:00
Brahim Hadriche 5583f55aae Release v0.36.4 (#586) 2025-04-19 11:44:28 -04:00
Brahim Hadriche d4f15e7dfb update dependencies (#585) 2025-04-19 11:38:22 -04:00
Brahim Hadriche de7c3f8a99 update dependencies (#581) 2025-04-12 16:59:10 -04:00
Brahim Hadriche b35dc4423e changelog 2025-04-12 16:55:09 -04:00
Weblate (bot)anddavbrasan 23146706ee Translated using Weblate (Portuguese (Brazil)) (#582)
Currently translated at 100.0% (319 of 319 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/pt_BR/

Co-authored-by: davbrasan <davidbrazps2@gmail.com>
2025-04-12 16:54:34 -04:00
Brahim Hadriche d10444b96c changelog 2025-04-10 16:27:58 -04:00
Weblate (bot)andEttore Atalan 2f7ba64488 Translated using Weblate (German) (#580)
Currently translated at 100.0% (319 of 319 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/de/

Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
2025-04-10 16:27:35 -04:00
Brahim Hadricheandgithub-action linter f1f50cc19e [chore] update dependencies (#579)
* update dependencies

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2025-04-05 12:16:18 -04:00
Brahim Hadriche b3a9887634 [skip ci] remove announcement 2025-04-03 13:21:33 -04:00
98 changed files with 2799 additions and 1466 deletions

No files matched your search

+98
View File
@@ -5,6 +5,104 @@ 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.38.2] - 2025-05-22
### Added
- German translation
### Changed
- Settings: Added a "backend" section, and removed backend selection from Playback to avoid confusion
### Removed
- [advanced users]: `playlet-web-api.yml` was removed. It was getting outdated, and too hard to maintain to justify keeping it
### Fixed
- Display issue in playlist view
## [0.38.1] - 2025-05-20
### Fixed
- Cache issue for watch history
- Video progress not showing in web app
- Video does not continuing from previous progress when opened
## [0.38.0] - 2025-05-19
### Added
- Watch progress for YouTube accounts: Progress is saved as you watch. Progress bar is shown on video thumbnails (only on user feeds, such as recommendations, subscriptions, and watch history)
- Known bug: Watch progress doesn't update for all videos.
### Fixed
- A few issues related to Playlet backend feeds and caching
- An error when Invidious doesn't return valid video metadata
- A bug where playlists with small number of videos has duplicates
- A bug where DASH manifest was not generated correctly for proxied Invidious videos
- A bug where watch history videos repeat indefinitely
## [0.37.0] - 2025-05-16
### Added
- YouTube account support. The following features are now available:
- The ability to login to one or multiple accounts
- Both YouTube accounts and Invidious accounts are supported side-by-side
- Subscriptions
- User playlists
- Watch History
- Watched videos on Playlet are added to the watch history
- Subscribe/Unsubscribe
- Recommended videos for logged in YouTube user are available in the home screen
- This feed can be enabled/disabled from the settings
- When an Invidious user is logged in, this becomes "popular" since Invidious does not support recommendations
### Fixed
- A bug where Session data did not refresh after 24 hours
### Changed
- [advanced users]: the Playlet web server's CORS headers are no longer set to `*`, for security reasons.
## [0.36.7] - 2025-05-04
### Fixed
- Playlet backend error caused by Roku 14.5 update on Canada devices
## [0.36.6] - 2025-05-03
### Fixed
- Small UI bug in web app nav bar
- Backend logging to improve debugging
## [0.36.5] - 2025-05-02
### Fixed
- Small error handling bug in Playlet backend
## [0.36.4] - 2025-04-19
### Added
- Portuguese (Brazil) translations (Thanks to davbrasan)
### Removed
- Startup announcement dialog
### Fixed
- German translation (Thanks to Atalanttore)
## [0.36.3] - 2025-04-02
### Fixed
+5
View File
@@ -32,6 +32,11 @@ Playlet makes requests directly to Innertube instead of Invidious.
Similar to Invidious requests, only the bare minimum and necessary information
is sent, which is used to enable the viewing of content.
Additionally, when a YouTube account is used in Playlet, Innertube traffic can
become associated with the account, which further reduces user privacy. This
is necessary to use features associated with YouTube accounts, such as
subscriptions, playlists, and watch history.
## SponsorBlock
Playlet may request information from a [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
+3 -2
View File
@@ -15,7 +15,7 @@
<a href="/LICENSE">
<img alt="AGPL-3.0 license" src="https://img.shields.io/github/license/iBicha/playlet.svg"/>
</a>
<a href="https://channelstore.roku.com/details/840aec36f51bfe6d96cf6db9055a372a/playlet">
<a href="https://channelstore.roku.com/details/4a41d0921265a5e31429a7679442153f:b5bcb5b630c28b01e93bf59856317b43/playlet">
<img alt="Roku Channel Store" src="https://img.shields.io/badge/Roku%20Store-Install-blueviolet?logo=roku&logoColor=blueviolet&labelColor=white"/>
</a>
<a href="https://github.com/iBicha/playlet/wiki">
@@ -40,7 +40,7 @@ More under [Screenshots](./docs/screenshots/README.md)
## Installation
[Playlet on Roku channel store](https://channelstore.roku.com/details/840aec36f51bfe6d96cf6db9055a372a/playlet) or search "Playlet" in the Roku channel store on your device.
[Playlet on Roku channel store](https://channelstore.roku.com/details/4a41d0921265a5e31429a7679442153f:b5bcb5b630c28b01e93bf59856317b43/playlet) or search "Playlet" in the Roku channel store on your device.
Can't install from the store? See [How to install Playlet as a sideloaded/dev app](https://github.com/iBicha/playlet/discussions/371)
@@ -49,6 +49,7 @@ Can't install from the store? See [How to install Playlet as a sideloaded/dev ap
- 🔥 No Ads (Not now, not ever)
- 🕵️ No Tracking
- 🛡️ Privacy driven (uses [Invidious](https://invidious.io/) backend)
- 🙋 User accounts (YouTube and Invidious accounts)
- ⚔️ [SponsorBlock](https://sponsor.ajay.app/) integration (skips undesirable sections in videos)
- 📱 Browse, search, and cast from phone using the YouTube app or the browser
- 🔮 Picture-in-picture mode
+1 -3
View File
@@ -166,8 +166,6 @@ Playlet lib comes equipped with a web server that runs on port 8888 when the app
The web server runs on a continuously running [Task](https://developer.roku.com/en-ca/docs/references/scenegraph/control-nodes/task.md) and uses a middeware system to manage routes, serve static files, [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), and more.
The server's API enpoints are described through the Open API spec file [playlet-web-api.yml](./playlet-web-api.yml)
Please note: while we would like to keep the API stable as much as possible, Playlet can't reasonbly maintain multiple versions of the API like traditional web apis, because it adds complexity and maintainablity burden on an app the runs in constrained environment. In short, we'll try not to break the API, but we might from time to time.
#### Debug endpoints
@@ -276,7 +274,7 @@ The Playlet web app uses [Tailwind CSS](https://tailwindcss.com/) as its base st
### API calls
The Playlet web app communicates with the Playlet Roku app using web APIs. Most of the APIs used are described in the OpenAPI spec [playlet-web-api.yml](./playlet-web-api.yml). The web app also uses Invidious apis documented at [https://docs.invidious.io/api](https://docs.invidious.io/api)
The Playlet web app communicates with the Playlet Roku app using web APIs. The web app also uses Invidious apis documented at [https://docs.invidious.io/api](https://docs.invidious.io/api)
#### API calls (proxy authenticated)
-644
View File
@@ -1,644 +0,0 @@
openapi: 3.0.0
info:
title: Playlet Web API
version: 0.36.3
description:
Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can
also be used by other apps.
contact:
name: Brahim Hadriche
url: https://github.com/iBicha
email: brahim.hadriche@gmail.com
servers:
- url: http://{ROKU_DEV_TARGET}:{PORT}
description: Playlet server
variables:
ROKU_DEV_TARGET:
description: The IP address of the Roku device
default: 192.168.1.x
PORT:
description: The port number of the Playlet server
default: "8888"
paths:
/api/state:
get:
summary: Get Playlet app state
description: >
Get the current state of the Playlet app. The `key` parameter is
optional and can be omitted to get the entire state. If the `key`
parameter is specified, only the specified key(s) will be returned.
operationId: getPlayletState
parameters:
- name: key
in: query
description: specific key(s) to get
required: false
schema:
type: array
items:
type: string
enum:
- app
- device
- invidious
- preferences
- profiles
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/PlayletAppState"
/api/preferences:
get:
summary: Get preferences
description: |
Get the current user preferences.
operationId: getPreferences
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/PreferencesObject"
put:
summary: Set preferences
description: >
Set the current user preferences. The request body can contain some or
all of the preferences. Any preferences not specified in the request
body will be left unchanged.
operationId: setPreferences
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PreferencesObject"
responses:
"204":
description: No Content
"400":
description: Bad Request
delete:
summary: Reset preferences
description: |
Reset the current user preferences to their default values.
operationId: resetPreferences
responses:
"204":
description: No Content
/api/search-history:
get:
summary: Get search history
description: |
Get the current search history.
operationId: getSearchHistory
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
type: string
post:
summary: Add to search history
description: |
Add a query to the search history.
operationId: addToSearchHistory
requestBody:
content:
application/json:
schema:
type: object
properties:
query:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
type: string
"400":
description: Bad Request
delete:
summary: Clear search history
description: |
Clear the search history.
operationId: clearSearchHistory
responses:
"204":
description: No Content
/api/queue:
get:
summary: Get video queue
description: Get the current videos in the queue.
operationId: getVideoQueue
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
items:
type: array
items:
$ref: "#/components/schemas/VideoQueueObject"
index:
type: integer
nowPlaying:
$ref: "#/components/schemas/VideoQueueObject"
post:
summary: Add to video queue
description: Add a video or a playlist to the queue.
operationId: addToVideoQueue
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/VideoQueueObject"
responses:
"204":
description: No Content
delete:
summary: Clear video queue
description: Clear the video queue.
operationId: clearVideoQueue
responses:
"204":
description: No Content
/api/queue/play:
post:
summary: Play video
description: Play a video or playlist. This adds the video or playlist to the current position in the queue and plays it.
operationId: playVideoQueue
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/VideoQueueObject"
responses:
"204":
description: No Content
/api/view/open:
get:
summary: Open a channel view or a playlist view
description: Open a channel view or a playlist view. If a video is playing in full screen, it is shrinked.
operationId: openView
parameters:
- name: channelId
in: query
description: The ID of the channel to open
required: false
schema:
type: string
- name: playlistId
in: query
description: The ID of the playlist to open
required: false
schema:
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
/api/home-layout:
get:
summary: Get home layout
description: Get the current home layout. This is the layout of the home screen, based on user preferences.
operationId: getHomeLayout
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
title:
type: string
feedSources:
type: array
items:
type: object
properties:
apiType:
type: string
endpoint:
type: string
id:
type: string
queryParams:
type: object
additionalProperties: true
title:
type: string
/api/playlet-lib-urls:
get:
summary: Get Playlet lib URLs
description: Get the currently loaded Playlet lib url, and the saved ones to be loaded on next start.
operationId: getPlayletLibUrls
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
loaded:
type: object
properties:
link:
type: string
type:
type: string
saved:
type: array
items:
type: object
properties:
link:
type: string
type:
type: string
post:
summary: Set Playlet lib URLs
description: >
Set a list of Playlet lib URLs to be loaded on next start. Playlet will try to load them one after the other
until one succeeds.
operationId: setPlayletLibUrls
requestBody:
content:
application/json:
schema:
type: array
items:
type: object
properties:
link:
type: string
type:
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
delete:
summary: Clear Playlet lib URLs
description: Clear the Playlet lib URLs. This affects the saved links in the registry, and will take effect on next start.
operationId: clearPlayletLibUrls
responses:
"204":
description: No Content
/invidious/login:
get:
summary: Redirect to the Invidious auth URL
description: Redirect to the Invidious auth URL, to allow authorizing an access token. Redirects to the Invidious auth URL.
operationId: invidiousLoginUrl
responses:
"302":
description: Found
headers:
Location:
schema:
type: string
format: uri
/api/profiles:
get:
summary: Get profiles
description: Get the logged profiles, and the currently active profile.
operationId: getProfiles
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
currentProfile:
type: string
profiles:
type: array
items:
$ref: "#/components/schemas/ProfileObject"
delete:
summary: Logout from a profile
description: Logout from a profile. This will remove the profile from the list of logged profiles.
operationId: logoutProfile
parameters:
- name: id
in: query
description: The ID of the profile to logout
required: true
schema:
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
"404":
description: Not Found
/api/profiles/activate:
post:
summary: Activate a profile
description: Activate a profile. This will set the profile as the active profile.
operationId: activateProfile
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
"404":
description: Not Found
# Roku External Control Protocol (ECP)
/input/{appId}:
servers:
- url: http://{ROKU_DEV_TARGET}:8060
description: Roku ECP endpoint
variables:
ROKU_DEV_TARGET:
description: The IP address of the Roku device
default: 192.168.1.x
parameters:
- $ref: "#/components/parameters/ecpAppId"
post:
summary: Send input to Playlet through ECP
description: Send input to Playlet through Roku External Control Protocol (ECP). This enables the deep-linking functionality.
operationId: ecpInput
parameters:
- $ref: "#/components/parameters/ecpContentId"
- $ref: "#/components/parameters/ecpMediaType"
- $ref: "#/components/parameters/ecpVideoId"
- $ref: "#/components/parameters/ecpTimestamp"
- $ref: "#/components/parameters/ecpTitle"
- $ref: "#/components/parameters/ecpAuthor"
responses:
"200":
description: OK
/launch/{appId}:
servers:
- url: http://{ROKU_DEV_TARGET}:8060
description: Roku ECP endpoint
variables:
ROKU_DEV_TARGET:
description: The IP address of the Roku device
default: 192.168.1.x
parameters:
- $ref: "#/components/parameters/ecpAppId"
post:
summary: Launch Playlet using ECP with arguments
description: Launch Playlet through Roku External Control Protocol (ECP) with arguments. This enables the deep-linking functionality.
operationId: ecpLaunch
parameters:
- $ref: "#/components/parameters/ecpClearPlayletLibUrls"
- $ref: "#/components/parameters/ecpContentId"
- $ref: "#/components/parameters/ecpMediaType"
- $ref: "#/components/parameters/ecpVideoId"
- $ref: "#/components/parameters/ecpTimestamp"
- $ref: "#/components/parameters/ecpTitle"
- $ref: "#/components/parameters/ecpAuthor"
responses:
"200":
description: OK
components:
parameters:
ecpAppId:
name: appId
in: path
description: The app ID of the Playlet app
required: true
schema:
type: string
enum:
- "693751" # Playlet app id
- dev
default: "693751"
ecpContentId:
name: contentId
in: query
description: The ID of the content to play. If specified with mediaType=video, this is the videoId.
required: false
schema:
type: string
ecpMediaType:
name: mediaType
in: query
description: The type of the content of ContentId. To be used with the contentId argument.
required: false
schema:
type: string
enum:
- video
ecpVideoId:
name: videoId
in: query
description: The video ID of the video to play. If specified, the video will be played.
required: false
schema:
type: string
ecpTimestamp:
name: timestamp
in: query
description: The timestamp of the video to play. To be used with the contentId argument.
required: false
schema:
type: integer
ecpTitle:
name: title
in: query
description: The title of the video. This is optionally added so we can display the title while loading, or when displaying the "Added to queue" notification.
required: false
schema:
type: string
ecpAuthor:
name: author
in: query
description: The author of the video. This is optionally added so we can display the author while loading, or when displaying the "Added to queue" notification.
required: false
schema:
type: string
ecpClearPlayletLibUrls:
name: clearPlayletLibUrls
in: query
description: If specified, the Playlet lib URLs will be cleared.
required: false
schema:
type: string
schemas:
PlayletAppState:
type: object
properties:
app:
type: object
properties:
id:
type: string
version:
type: string
git_commit_hash:
type: string
lib_version:
type: string
lib_git_commit_hash:
type: string
lib_version_latest:
type: string
lib_url_type:
type: string
device:
type: object
properties:
model:
type: string
model_display_name:
type: string
model_type:
type: string
model_details:
type: object
additionalProperties: true
os_version:
type: object
properties:
build:
type: string
major:
type: string
minor:
type: string
revision:
type: string
display_type:
type: string
display_mode:
type: string
display_aspect_ratio:
type: string
display_size:
type: object
properties:
w:
type: integer
h:
type: integer
video_mode:
type: string
ui_resolution:
type: object
properties:
height:
type: integer
name:
type: string
width:
type: integer
graphics_platform:
type: string
internet_status:
type: boolean
user_country_code:
type: string
friendly_name:
type: string
current_locale:
type: string
invidious:
type: object
properties:
current_instance:
type: string
auth_url:
type: string
preferences:
$ref: "#/components/schemas/PreferencesObject"
profiles:
type: object
properties:
currentProfile:
type: string
profiles:
type: array
items:
$ref: "#/components/schemas/ProfileObject"
PreferencesObject:
type: object
properties:
invidious.instance:
type: string
invidious.proxy_videos:
type: string
enum:
- always
- if_needed
- never
playback.autoplay:
type: string
enum:
- auto
- 720p
playback.preferred_quality:
type: string
sponsorblock.enabled:
type: boolean
sponsorblock.show_notifications:
type: boolean
ProfileObject:
type: object
properties:
id:
type: string
type:
type: string
username:
type: string
serverUrl:
type: string
# TODO:P1 add the rest of properties
VideoQueueObject:
type: object
properties:
videoId:
type: string
playlistId:
type: string
playlistIndex:
type: integer
timestamp:
type: integer
title:
type: string
author:
type: string
+277 -279
View File
@@ -1,49 +1,49 @@
{
"name": "playlet",
"version": "0.36.3",
"version": "0.38.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.36.3",
"version": "0.38.2",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.28",
"@rokucommunity/bslint": "^0.8.31",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.13.14",
"@types/node": "^22.15.18",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.68.5",
"brighterscript-formatter": "^1.7.12",
"brighterscript-formatter": "^1.7.14",
"cheerio": "1.0.0-rc.11",
"convert-svg-to-png": "^0.6.4",
"crypto-js": "^4.2.0",
"dotenv": "^16.4.7",
"dotenv": "^16.5.0",
"fs-extra": "^11.3.0",
"glob": "^11.0.1",
"glob": "^11.0.2",
"imap": "^0.8.19",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.7.2",
"protocol-buffers-schema": "^3.6.0",
"roku-deploy": "^3.12.4",
"roku-test-automation": "^2.0.11",
"rooibos-roku": "5.15.6",
"roku-deploy": "^3.12.5",
"roku-test-automation": "^2.0.13",
"rooibos-roku": "5.15.7",
"rounded-rect-9patch": "^1.1.2",
"semver": "^7.7.1",
"shelljs": "^0.9.2",
"semver": "^7.7.2",
"shelljs": "^0.10.0",
"ts-node": "^10.9.2",
"typescript": "5.8.2",
"typescript": "5.8.3",
"xml2js": "^0.6.2",
"yaml": "^2.7.0"
"yaml": "^2.8.0"
},
"engines": {
"node": "20"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.37.0"
"@rollup/rollup-linux-x64-gnu": "^4.40.2"
}
},
"node_modules/@babel/code-frame": {
@@ -438,9 +438,9 @@
"dev": true
},
"node_modules/@rokucommunity/bslint": {
"version": "0.8.28",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.28.tgz",
"integrity": "sha512-hLrkcwQHkSVXiRHWl9Y3+knVnClSrE6G/aeVNxEPFbHzNh85CFub0BfnzKbTfOSN0CjfAxo9/LoHt1axPHGQOg==",
"version": "0.8.31",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.31.tgz",
"integrity": "sha512-/VsycIH2OiEoNe7fCLqbQrDnX/JoKUV3Nufg0+auCM/DhCYzL4iM965VkSBebWzwUsnQXjILaKC4fRcMjpSBPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -471,10 +471,11 @@
}
},
"node_modules/@rokucommunity/logger": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@rokucommunity/logger/-/logger-0.3.9.tgz",
"integrity": "sha512-j4DK7dF2klMhoclJZ6P7h1bT4bMVt/ynfCi3GSMozXld0M1HbpRyY3TCxu6dnxPl16l6PtIosNHELjQxKzFp6g==",
"version": "0.3.11",
"resolved": "https://registry.npmjs.org/@rokucommunity/logger/-/logger-0.3.11.tgz",
"integrity": "sha512-yQWa+rRVYkZeEYFePHzNtB6/DL+wPjjL/xt9wM0gQPDugSl8kJZ3ywyUtrFS+y/wzY0Nc2M+1704GVx0vdOO9A==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^4.1.2",
"date-fns": "^2.30.0",
@@ -596,9 +597,9 @@
}
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.37.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.37.0.tgz",
"integrity": "sha512-pKivGpgJM5g8dwj0ywBwe/HeVAUSuVVJhUTa/URXjxvoyTT/AxsLTAbkHkDHG7qQxLoW2s3apEIl26uUe08LVQ==",
"version": "4.40.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.2.tgz",
"integrity": "sha512-lG7Xa+BmBNwpjmVUbmyKxdQJ3Q6whHjMjzQplOs5Z+Gj7mxPtWakGHqzMqNER68G67kmCX9qX57aRsW5V0VOng==",
"cpu": [
"x64"
],
@@ -759,13 +760,13 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "22.13.14",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz",
"integrity": "sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==",
"version": "22.15.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.18.tgz",
"integrity": "sha512-v1DKRfUdyW+jJhZNEI1PYy29S2YRxMV5AOO/x/SjKmW0acCIOqmbj6Haf9eHAhsPmrhlHSxEhv/1WszcLWV4cg==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.20.0"
"undici-types": "~6.21.0"
}
},
"node_modules/@types/qs": {
@@ -1359,13 +1360,13 @@
}
},
"node_modules/brighterscript-formatter": {
"version": "1.7.12",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.12.tgz",
"integrity": "sha512-APjT5R5jm7MneedYtIJJxxk05wh3SltaY9l823jF9Ir3ZasajmARGPzgDwJfxz83H+sNmcN7XpheQruFMLvSTQ==",
"version": "1.7.14",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.14.tgz",
"integrity": "sha512-rbK5lT2UZ/yD/JLryIsZC9Kng1vh4xFf9CO1tp8nMRaOTncscuD1mtMsmJXq0uQusxoRNBXB/tvSZQPKR9+SXQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"brighterscript": "^0.69.3",
"brighterscript": "^0.69.9",
"glob-all": "^3.3.0",
"jsonc-parser": "^3.0.0",
"source-map": "^0.7.3",
@@ -1401,14 +1402,14 @@
}
},
"node_modules/brighterscript-formatter/node_modules/brighterscript": {
"version": "0.69.3",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.69.3.tgz",
"integrity": "sha512-o0GmdYI41CihI3nCD5o/ndZpFLa1HuL793trJVCVijEQZSRjr6NjtvdXSlq9QNzvWKb9t0W1ZyA0dyD4Q5k3bw==",
"version": "0.69.9",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.69.9.tgz",
"integrity": "sha512-IZ3q29gVZ/9Z8ZqBVDVmT5mqhf8/gyF2WxzxV2oHT3SoZyKPe9JpbOvjDqUwd51HoYI55eJWiY3TTG94CPAxXA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rokucommunity/bslib": "^0.1.1",
"@rokucommunity/logger": "^0.3.9",
"@rokucommunity/logger": "^0.3.11",
"@xml-tools/parser": "^1.0.7",
"array-flat-polyfill": "^1.0.1",
"chalk": "^2.4.2",
@@ -1433,7 +1434,7 @@
"parse-ms": "^2.1.0",
"readline": "^1.3.0",
"require-relative": "^0.8.7",
"roku-deploy": "^3.12.4",
"roku-deploy": "^3.12.5",
"safe-json-stringify": "^1.2.0",
"serialize-error": "^7.0.1",
"source-map": "^0.7.4",
@@ -1447,7 +1448,8 @@
"yargs": "^16.2.0"
},
"bin": {
"bsc": "dist/cli.js"
"bsc": "dist/cli.js",
"bsc0": "dist/cli.js"
}
},
"node_modules/brighterscript-formatter/node_modules/brighterscript/node_modules/cliui": {
@@ -2739,10 +2741,11 @@
}
},
"node_modules/dotenv": {
"version": "16.4.7",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz",
"integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
@@ -3004,95 +3007,40 @@
"dev": true
},
"node_modules/execa": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
"integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
"dev": true,
"license": "MIT",
"dependencies": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/execa/node_modules/cross-spawn": {
"version": "6.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz",
"integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==",
"dev": true,
"license": "MIT",
"dependencies": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
"node": ">=10"
},
"engines": {
"node": ">=4.8"
"funding": {
"url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
"node_modules/execa/node_modules/get-stream": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true,
"license": "MIT",
"dependencies": {
"pump": "^3.0.0"
"engines": {
"node": ">=10"
},
"engines": {
"node": ">=6"
}
},
"node_modules/execa/node_modules/path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/execa/node_modules/semver": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/execa/node_modules/shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
"dev": true,
"license": "MIT",
"dependencies": {
"shebang-regex": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/execa/node_modules/shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/execa/node_modules/signal-exit": {
@@ -3102,19 +3050,6 @@
"dev": true,
"license": "ISC"
},
"node_modules/execa/node_modules/which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"which": "bin/which"
}
},
"node_modules/express": {
"version": "4.21.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
@@ -3601,9 +3536,9 @@
}
},
"node_modules/glob": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz",
"integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==",
"version": "11.0.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz",
"integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==",
"dev": true,
"license": "ISC",
"dependencies": {
@@ -3968,6 +3903,16 @@
"node": ">= 6"
}
},
"node_modules/human-signals": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">=10.17.0"
}
},
"node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -4062,15 +4007,6 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"node_modules/interpret": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
"dev": true,
"engines": {
"node": ">= 0.10"
}
},
"node_modules/ip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",
@@ -4124,21 +4060,6 @@
"node": ">=8"
}
},
"node_modules/is-core-module": {
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
"integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
"dev": true,
"dependencies": {
"hasown": "^2.0.2"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -4189,13 +4110,16 @@
}
},
"node_modules/is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-typedarray": {
@@ -4565,6 +4489,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true,
"license": "MIT"
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -4631,6 +4562,16 @@
"node": ">= 0.6"
}
},
"node_modules/mimic-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@@ -4766,13 +4707,6 @@
"node": ">= 0.4.0"
}
},
"node_modules/nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true,
"license": "MIT"
},
"node_modules/node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
@@ -4862,26 +4796,16 @@
}
},
"node_modules/npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"license": "MIT",
"dependencies": {
"path-key": "^2.0.0"
"path-key": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/npm-run-path/node_modules/path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
"node": ">=8"
}
},
"node_modules/nth-check": {
@@ -4940,14 +4864,20 @@
"wrappy": "1"
}
},
"node_modules/p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
"node_modules/onetime": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
"dev": true,
"license": "MIT",
"dependencies": {
"mimic-fn": "^2.1.0"
},
"engines": {
"node": ">=4"
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-limit": {
@@ -5219,12 +5149,6 @@
"node": ">=8"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"node_modules/path-scurry": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
@@ -5730,18 +5654,6 @@
"integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==",
"dev": true
},
"node_modules/rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==",
"dev": true,
"dependencies": {
"resolve": "^1.1.6"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
@@ -6006,26 +5918,6 @@
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"dev": true
},
"node_modules/resolve": {
"version": "1.22.10",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
"integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==",
"dev": true,
"dependencies": {
"is-core-module": "^2.16.0",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
@@ -6320,9 +6212,9 @@
}
},
"node_modules/roku-deploy": {
"version": "3.12.4",
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.12.4.tgz",
"integrity": "sha512-XRiLkGRppo2hcSJfkvTOkgCyxVdDLOVq2vlH41WiDE9h/7qycxFLKrQBxwhE+3L+FI5AobVCQ/v08dEQEyTqBw==",
"version": "3.12.5",
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.12.5.tgz",
"integrity": "sha512-ulPePpNtS29ePMc15Qk/XrEW8uFfhfKrFvKtV4jiifOuyESCqvBbGvt1EOuIMAaq2rA+5q/lWL7LkVKgyQz0QA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -6393,9 +6285,9 @@
}
},
"node_modules/roku-test-automation": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/roku-test-automation/-/roku-test-automation-2.0.11.tgz",
"integrity": "sha512-arx0/fho9Pr1XvXXI/Pwmt8lRcL7pZgbYcoiX99PEBfg7vQxrdaJBe955T3JJ94/7NV73vCI+WwAL2jKsjpWhg==",
"version": "2.0.13",
"resolved": "https://registry.npmjs.org/roku-test-automation/-/roku-test-automation-2.0.13.tgz",
"integrity": "sha512-oz6O7XT343/dD0gt1la6k0g2MJMX8qbZYPe1NDB7bzU1JebMieBDgtqQJJmyK2TvzSvoSKmYEGCspEJl9rSChg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -6409,7 +6301,8 @@
"path": "^0.12.7",
"portfinder": "^1.0.33",
"postman-request": "^2.88.1-postman.40",
"roku-deploy": "^3.10.2"
"roku-deploy": "^3.10.2",
"stoppable": "^1.1.0"
}
},
"node_modules/roku-test-automation/node_modules/fs-extra": {
@@ -6453,12 +6346,14 @@
"license": "MIT"
},
"node_modules/rooibos-roku": {
"version": "5.15.6",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.15.6.tgz",
"integrity": "sha512-lC6ST5/azVUAMXSwVr2Kb4zzmyfCJfCB3vwNy1GUrlAm0W/nZGm2ho5IFlJa34V50yU7sunpqXNjXmQIStsZXQ==",
"version": "5.15.7",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.15.7.tgz",
"integrity": "sha512-07zAuGdKoT3DUnYO0FETrRAoYVy3+l138cODkoA32XcnV7zx2svs2T0fRRKUvKgH3gIzDGCYr3QjbBhAn48Etw==",
"dev": true,
"license": "ISC",
"license": "MIT",
"dependencies": {
"brighterscript": "0.67.4",
"minimatch": "^3.0.4",
"roku-debug": "^0.21.10",
"roku-deploy": "^3.12.1",
"rooibos_promises": "npm:@rokucommunity/promises@^0.5.0",
@@ -6496,6 +6391,64 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/rooibos-roku/node_modules/brighterscript": {
"version": "0.67.4",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.67.4.tgz",
"integrity": "sha512-1EbX2Po9WbIyi4r557fk6txkYR0VvbnGm1caS9AVlVek2R6d9+QsQxr+f24PePM4l/TOBvZ1JieBt6NheM4P2Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rokucommunity/bslib": "^0.1.1",
"@rokucommunity/logger": "^0.3.9",
"@xml-tools/parser": "^1.0.7",
"array-flat-polyfill": "^1.0.1",
"chalk": "^2.4.2",
"chevrotain": "^7.0.1",
"chokidar": "^3.5.1",
"clear": "^0.1.0",
"cross-platform-clear-console": "^2.3.0",
"debounce-promise": "^3.1.0",
"eventemitter3": "^4.0.0",
"fast-glob": "^3.2.12",
"file-url": "^3.0.0",
"fs-extra": "^8.1.0",
"jsonc-parser": "^2.3.0",
"long": "^3.2.0",
"luxon": "^2.5.2",
"minimatch": "^3.0.4",
"moment": "^2.23.0",
"p-settle": "^2.1.0",
"parse-ms": "^2.1.0",
"readline": "^1.3.0",
"require-relative": "^0.8.7",
"roku-deploy": "^3.12.1",
"serialize-error": "^7.0.1",
"source-map": "^0.7.4",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-languageserver-types": "^3.17.5",
"vscode-uri": "^3.0.8",
"xml2js": "^0.5.0",
"yargs": "^16.2.0"
},
"bin": {
"bsc": "dist/cli.js"
}
},
"node_modules/rooibos-roku/node_modules/brighterscript/node_modules/vscode-languageserver": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz",
"integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==",
"dev": true,
"license": "MIT",
"dependencies": {
"vscode-languageserver-protocol": "3.17.5"
},
"bin": {
"installServerIntoExtension": "bin/installServerIntoExtension"
}
},
"node_modules/rooibos-roku/node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
@@ -6531,6 +6484,31 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"node_modules/rooibos-roku/node_modules/fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"dev": true,
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
},
"engines": {
"node": ">=6 <7 || >=8"
}
},
"node_modules/rooibos-roku/node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
"dev": true,
"license": "MIT",
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/rooibos-roku/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
@@ -6557,6 +6535,16 @@
"node": ">=8"
}
},
"node_modules/rooibos-roku/node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/rooibos-roku/node_modules/vscode-languageserver": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-6.1.1.tgz",
@@ -6586,6 +6574,20 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/rooibos-roku/node_modules/xml2js": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
"integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
"dev": true,
"license": "MIT",
"dependencies": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/rooibos-roku/node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
@@ -6710,9 +6712,9 @@
}
},
"node_modules/semver": {
"version": "7.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
"integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
"version": "7.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
"integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
"dev": true,
"license": "ISC",
"bin": {
@@ -6853,19 +6855,14 @@
}
},
"node_modules/shelljs": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.9.2.tgz",
"integrity": "sha512-S3I64fEiKgTZzKCC46zT/Ib9meqofLrQVbpSswtjFfAVDW+AZ54WTnAM/3/yENoxz/V1Cy6u3kiiEbQ4DNphvw==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.10.0.tgz",
"integrity": "sha512-Jex+xw5Mg2qMZL3qnzXIfaxEtBaC4n7xifqaqtrZDdlheR70OGkydrPJWT0V1cA1k3nanC86x9FwAmQl6w3Klw==",
"dev": true,
"license": "BSD-3-Clause",
"dependencies": {
"execa": "^1.0.0",
"fast-glob": "^3.3.2",
"interpret": "^1.0.0",
"rechoir": "^0.6.2"
},
"bin": {
"shjs": "bin/shjs"
"execa": "^5.1.1",
"fast-glob": "^3.3.2"
},
"engines": {
"node": ">=18"
@@ -7056,6 +7053,17 @@
"node": ">= 0.8"
}
},
"node_modules/stoppable": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz",
"integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4",
"npm": ">=6"
}
},
"node_modules/stream": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/stream/-/stream-0.0.2.tgz",
@@ -7190,14 +7198,14 @@
"node": ">=8"
}
},
"node_modules/strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
"node_modules/strip-final-newline": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
"node": ">=6"
}
},
"node_modules/supports-color": {
@@ -7212,18 +7220,6 @@
"node": ">=4"
}
},
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true,
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
@@ -7467,9 +7463,9 @@
"dev": true
},
"node_modules/typescript": {
"version": "5.8.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -7516,10 +7512,11 @@
"dev": true
},
"node_modules/undici-types": {
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
"dev": true
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true,
"license": "MIT"
},
"node_modules/universalify": {
"version": "2.0.1",
@@ -7928,15 +7925,16 @@
"dev": true
},
"node_modules/yaml": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz",
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==",
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz",
"integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==",
"dev": true,
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14"
"node": ">= 14.6"
}
},
"node_modules/yargs": {
+14 -14
View File
@@ -1,37 +1,37 @@
{
"name": "playlet",
"version": "0.36.3",
"version": "0.38.2",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.28",
"@rokucommunity/bslint": "^0.8.31",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.13.14",
"@types/node": "^22.15.18",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.68.5",
"brighterscript-formatter": "^1.7.12",
"brighterscript-formatter": "^1.7.14",
"cheerio": "1.0.0-rc.11",
"convert-svg-to-png": "^0.6.4",
"crypto-js": "^4.2.0",
"dotenv": "^16.4.7",
"dotenv": "^16.5.0",
"fs-extra": "^11.3.0",
"glob": "^11.0.1",
"glob": "^11.0.2",
"imap": "^0.8.19",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.7.2",
"protocol-buffers-schema": "^3.6.0",
"roku-deploy": "^3.12.4",
"roku-test-automation": "^2.0.11",
"rooibos-roku": "5.15.6",
"roku-deploy": "^3.12.5",
"roku-test-automation": "^2.0.13",
"rooibos-roku": "5.15.7",
"rounded-rect-9patch": "^1.1.2",
"semver": "^7.7.1",
"shelljs": "^0.9.2",
"semver": "^7.7.2",
"shelljs": "^0.10.0",
"ts-node": "^10.9.2",
"typescript": "5.8.2",
"typescript": "5.8.3",
"xml2js": "^0.6.2",
"yaml": "^2.7.0"
"yaml": "^2.8.0"
},
"engines": {
"node": "20"
@@ -75,6 +75,6 @@
"shutdown": "node tools/shutdown.js"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.37.0"
"@rollup/rollup-linux-x64-gnu": "^4.40.2"
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.36.3",
"version": "0.38.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.36.3"
"version": "0.38.2"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.36.3",
"version": "0.38.2",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-app",
+2 -2
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=36
build_version=00003
minor_version=38
build_version=00002
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.36.3",
"version": "0.38.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.36.3"
"version": "0.38.2"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.36.3",
"version": "0.38.2",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-lib",
@@ -159,18 +159,25 @@ function OnDispose()
m.subscribeTask.cancel = true
m.subscribeTask = invalid
end if
if m.fetchSubscriptionStatusTask <> invalid
m.fetchSubscriptionStatusTask.cancel = true
m.fetchSubscriptionStatusTask = invalid
end if
end function
function OnSubscribeButtonSelected()
if m.subscribeTask <> invalid
m.subscribeTask.cancel = true
end if
if m.fetchSubscriptionStatusTask <> invalid
m.fetchSubscriptionStatusTask.cancel = true
end if
isSubbed = IsSubscribed()
m.subscribeTask = AsyncTask.Start(Tasks.SubscribeTask, {
channelView: m.top
invidious: m.invidious
ucid: m.authorId
subscribe: not isSubbed
subscribe: not m.top.isSubscribed
})
end function
@@ -350,25 +357,10 @@ function IsLoggedIn() as boolean
return m.invidious.authToken <> invalid
end function
function IsSubscribed() as boolean
authorId = m.top.authorId
if StringUtils.IsNullOrEmpty(authorId)
return false
end if
subscriptions = m.invidious.subscriptions
if subscriptions = invalid
return false
end if
if not subscriptions.DoesExist(authorId)
return false
end if
return subscriptions[authorId]
end function
function OnAuthorIdChange()
SetSubscribeButtonVisibility()
OnSubscriptionChanged()
FetchSubscriptionStatus()
end function
function SetSubscribeButtonVisibility()
@@ -380,9 +372,34 @@ function SetSubscribeButtonVisibility()
end if
end function
function FetchSubscriptionStatus() as void
if not IsLoggedIn()
return
end if
authorId = m.top.authorId
if StringUtils.IsNullOrEmpty(authorId)
return
end if
if m.fetchSubscriptionStatusTask <> invalid
return
end if
m.fetchSubscriptionStatusTask = AsyncTask.Start(Tasks.FetchSubscriptionStatusTask, {
channelView: m.top
ucid: authorId
authToken: m.invidious.authToken
invidious: m.invidious
})
end function
function OnFetchSubscriptionStatusResult(result as object) as void
m.fetchSubscriptionStatusTask = invalid
end function
function OnSubscriptionChanged()
isSubbed = IsSubscribed()
if isSubbed
if m.top.isSubscribed
m.subscribeButton.text = Tr(Locale.Buttons.Unsubscribe)
else
m.subscribeButton.text = Tr(Locale.Buttons.Subscribe)
@@ -2,6 +2,7 @@
<interface>
<field id="content" type="node" onChange="OnContentSet" />
<field id="authorId" type="string" onChange="OnAuthorIdChange" />
<field id="isSubscribed" type="boolean" onChange="OnSubscriptionChanged" />
<field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="bookmarksService" type="node" bind="/BookmarksService" />
@@ -0,0 +1,48 @@
import "pkg:/components/Services/Innertube/InnertubeService.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs"
@asynctask
function FetchSubscriptionStatusTask(input as object) as object
channelView = input.channelView
ucid = input.ucid
invidiousNode = input.invidious
authToken = input.authToken
if m.top.cancel
return invalid
end if
isInnertubeProfile = authToken.profileNode.type = "youtube"
if isInnertubeProfile
subscriptionStatus = InnertubeService.GetSubscriptionStatusForChannel(ucid, {
cancellation: m.top.cancellation
accessToken: authToken.token
})
if subscriptionStatus.error <> invalid
LogError("Failed to fetch subscription status:", subscriptionStatus.error)
return invalid
end if
channelView.isSubscribed = subscriptionStatus.isSubscribed
else
service = new Invidious.InvidiousService(invidiousNode)
subscriptionsRequest = service.GetSubscriptions(m.top.cancellation)
if not subscriptionsRequest.IsSuccess()
error = subscriptionsRequest.ErrorMessage()
LogError("Failed to fetch subscriptions:", error)
return invalid
end if
subscriptions = subscriptionsRequest.Json()
isSubscribed = false
for each subscription in subscriptions
if subscription.authorId = ucid
isSubscribed = true
exit for
end if
end for
channelView.isSubscribed = isSubscribed
end if
return invalid
end function
@@ -2,6 +2,7 @@ import "pkg:/components/Services/Invidious/InvidiousService.bs"
@asynctask
function SubscribeTask(input as object) as object
channelView = input.channelView
invidiousNode = input.invidious
ucid = input.ucid
subscribe = input.subscribe
@@ -13,23 +14,17 @@ function SubscribeTask(input as object) as object
service = new Invidious.InvidiousService(invidiousNode)
if subscribe
response = service.Subscribe(ucid)
response = service.Subscribe(ucid, m.top.cancellation)
else
response = service.Unsubscribe(ucid)
response = service.Unsubscribe(ucid, m.top.cancellation)
end if
if not response.IsSuccess()
error = response.ErrorMessage()
LogError("Failed to subscribe/unsubscribe to channel:", error)
return {
success: false
error: error
}
return invalid
end if
invidiousNode.refreshSubscribtions = true
return {
success: true
}
channelView.isSubscribed = subscribe
return invalid
end function
@@ -43,5 +43,6 @@
<field id="statsText" type="string" />
<!-- videoId is Mix continuation (playlistId starts with "RD") -->
<field id="videoId" type="string" />
<field id="lines" type="stringarray" />
</interface>
</component>
@@ -54,13 +54,19 @@ function PlaylistContentTask(input as object) as object
}
end if
beforeChildCount = contentNode.getChildCount()
InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
childCount = contentNode.getChildCount()
afterChildCount = contentNode.getChildCount()
videoCount = ValidInt(metadata.videoCount)
hasContinuation = not StringUtils.IsNullOrEmpty(metadata.continuation)
if (hadContinuation and not hasContinuation) or (metadata.videos.Count() = 0 or childCount >= videoCount)
noMoreContinuation = hadContinuation and not hasContinuation
noVideosAdded = afterChildCount = beforeChildCount
reachedVideoCount = videoCount <> -1 and afterChildCount >= videoCount
if noMoreContinuation or noVideosAdded or reachedVideoCount
contentNode.loadState = FeedLoadState.Loaded
return {
success: true
@@ -0,0 +1,56 @@
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/TimeUtils.bs"
function HasValidAccessToken(_unused as dynamic) as boolean
serverType = m.top.type
accessToken = m.top.accessToken
if StringUtils.IsNullOrEmpty(accessToken)
return false
end if
if serverType = "invidious"
return true
end if
nowSeconds = TimeUtils.Now().AsSeconds()
expiresTimestamp = m.top.expiresTimestamp
' We should refresh the token if it's about to expire in 30 minutes
' Although the current token might be valid, we can let current request
' wait for the new token
shouldRefreshToken = expiresTimestamp < nowSeconds + 60 * 30
if shouldRefreshToken
RefreshAccessToken()
end if
return not shouldRefreshToken
end function
function RefreshAccessToken() as void
if m.refreshTokenTask <> invalid
return
end if
if m.profilesService = invalid
m.profilesService = m.top.getScene().findNode("ProfilesService")
end if
LogInfo("Refreshing access token for profile:", m.top.username)
m.refreshTokenTask = AsyncTask.Start(Tasks.ProfileRefreshTokenTask, {
profile: m.top
profilesService: m.profilesService
accessTokenObject: {
clientId: m.top.clientId
clientSecret: m.top.clientSecret
refreshToken: m.top.refreshToken
}
}, OnProfileRefreshTokenTaskResult)
end function
function OnProfileRefreshTokenTaskResult(output as object) as void
m.refreshTokenTask = invalid
end function
@@ -18,5 +18,7 @@
<field id="clientSecret" type="string" />
<field id="color" type="color" />
<function name="HasValidAccessToken" />
</interface>
</component>
@@ -0,0 +1,25 @@
import "pkg:/components/Services/Innertube/InnertubeService.bs"
import "pkg:/source/utils/ErrorUtils.bs"
@asynctask
function ProfileRefreshTokenTask(input as object) as object
profileNode = input.profile
accessTokenObject = input.accessTokenObject
profilesService = input.profilesService
try
if InnertubeService.AuthRefreshAccessToken(accessTokenObject)
profileNode.expiresIn = accessTokenObject.expiresIn
profileNode.expiresTimestamp = accessTokenObject.expiresTimestamp
profileNode.accessToken = accessTokenObject.accessToken
profilesService@.SaveUserProfilesToRegistry()
else
LogError("Failed to refresh access token")
profileNode.accessToken = invalid
end if
catch error
LogError("Failed to refresh access token:", ErrorUtils.Format(error))
profileNode.accessToken = invalid
end try
return invalid
end function
@@ -22,5 +22,10 @@
<field id="title" type="string" />
<field id="videoId" type="string" />
<field id="viewCountText" type="string" />
<!-- lines is from the tv client (author name + video info) -->
<field id="lines" type="stringarray" />
<!-- videoInfo is from web client -->
<field id="videoInfo" type="string" />
<field id="percentDurationWatched" type="float" />
</interface>
</component>
+7 -7
View File
@@ -56,14 +56,14 @@ end function
function ShowAnnouncement() as void
dialog = DialogUtils.ShowDialogOnce({
messageId: "1736288537"
title: "Announcement - Playlet backend"
messageId: "1747362859"
title: "Announcement - YouTube account support"
message: [
"An experimental built-in backend has been added to Playlet."
"This allows you to access YouTube content without the need for an Invidious instance."
"To use it, go to the Settings > Invidious > Instance and set the field to empty (Edit, and delete the url)."
"Please note that it's missing some features and may not work as expected."
"Thank you for using Playlet!"
"YouTube account support is now available in Playlet!"
`Subscriptions, playlists, watch history and "Recommended" are now available in the app.`
"If you encounter any issues, please report them on GitHub."
"https://github.com/iBicha/playlet/issues"
"Thank you."
]
alwaysOnTop: true
marginWidth: 180
@@ -53,14 +53,14 @@ end function
function ShowAnnouncement() as void
dialog = DialogUtils_ShowDialogOnce({
messageId: "1736288537"
title: "Announcement - Playlet backend"
messageId: "1747362859"
title: "Announcement - YouTube account support"
message: [
"An experimental built-in backend has been added to Playlet."
"This allows you to access YouTube content without the need for an Invidious instance."
"To use it, go to the Settings > Invidious > Instance and set the field to empty (Edit, and delete the url)."
"Please note that it's missing some features and may not work as expected."
"Thank you for using Playlet!"
"YouTube account support is now available in Playlet!"
"Subscriptions, playlists, watch history and " + chr(34) + "Recommended" + chr(34) + " are now available in the app."
"If you encounter any issues, please report them on GitHub."
"https://github.com/iBicha/playlet/issues"
"Thank you."
]
alwaysOnTop: true
marginWidth: 180
@@ -1,3 +1,4 @@
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/TimeUtils.bs"
import "pkg:/source/utils/Types.bs"
@@ -15,7 +16,23 @@ function OnContentSet() as void
m.top.title = content.title
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.top.author = content._author
author = content._author
if not StringUtils.IsNullOrEmpty(author)
videoInfo = content.videoInfo
if not StringUtils.IsNullOrEmpty(videoInfo)
author += `\n` + videoInfo
end if
else
lines = content.lines
if IsArray(lines) and lines.Count() > 0
author = lines[0]
if lines.Count() > 1
author += `\n` + lines[1]
end if
end if
end if
m.top.author = author
m.top.thumbnailUri = content.thumbnail
SetDurationText(content.lengthText)
@@ -44,8 +44,9 @@
<Label
id="authorLabel"
width="350"
height="25"
font="font:SmallestSystemFont" />
font="font:SmallestSystemFont"
maxLines="2"
wrap="true" />
</LayoutGroup>
</children>
@@ -79,9 +79,9 @@
</Poster>
<Label
id="UsernameLabel"
width="200"
width="300"
horizAlign="center"
translation="[0,250]">
translation="[-50,250]">
</Label>
<Label
id="ServerLabel"
@@ -40,14 +40,9 @@ function OnRowItemSelected() as void
row = m.profileRowList.content.GetChild(0)
selectedProfile = row.GetChild(index)
if selectedProfile.type = "login"
#if YT_OAUTH_SUPPORT
backendTypeSelectionView = BackendTypeSelectionViewUtils.Open(m.appController)
backendTypeSelectionView.observeFieldScoped("selectedBackendType", FuncName(OnBackEndSelected))
return
#else
LoginWithInvidious()
return
#end if
backendTypeSelectionView = BackendTypeSelectionViewUtils.Open(m.appController)
backendTypeSelectionView.observeFieldScoped("selectedBackendType", FuncName(OnBackEndSelected))
return
end if
ProfileViewUtils.Open(selectedProfile, m.appController)
@@ -89,7 +84,12 @@ function ShowLoginWithYouTubeDialog() as void
' TODO:P2 localize
dialog = DialogUtils.ShowDialogEx({
title: "Disclaimer"
message: "Playlet authors acknowledge that all trademarks and registered trademarks mentioned in this application and related pages are the property of their respective owners. The use of these trademarks or trade names is for identification purposes only and does not imply any endorsement, affiliation, or sponsorship by the trademark owner."
message: [
"Playlet is a third-party app and is not affiliated with, endorsed by, or sponsored by YouTube or Google. All trademarks and registered trademarks mentioned are the property of their respective owners and are used only for identification purposes."
"By using Playlet and signing in with your YouTube account, you acknowledge that you do so at your own risk. The developers of Playlet are not liable for any harm, including but not limited to data loss, account suspension or ban, hacking, or loss of content."
"Use responsibly, especially if your YouTube account is tied to business or monetization."
]
large: true
buttons: [
Tr(Locale.Buttons.OK)
Tr(Locale.Buttons.Cancel)
@@ -66,9 +66,9 @@
</Poster>
<Label
id="UsernameLabel"
width="200"
width="400"
horizAlign="center"
translation="[0,210]">
translation="[-100,210]">
<Font role="font" uri="font:MediumSystemFontFile" size="26" />
</Label>
<Label
@@ -17,7 +17,7 @@ function SearchSuggestionsTask(input as object) as object
suggestions: []
}
else
backend = preferencesNode["playback.backend"]
backend = preferencesNode["backend.selected"]
if backend = "playlet"
searchSuggestsions = InnertubeService.SearchSuggestions(q, m.top.cancellation)
else
@@ -19,7 +19,7 @@
<CheckList
id="checkList"
vertFocusAnimationStyle="floatingFocus"
translation="[164,70]">
translation="[164,40]">
<ContentNode role="content" />
</CheckList>
@@ -12,7 +12,6 @@ class DashManifest
m.invidiousInstance = invidiousInstance
m.utils = new Http.Utils()
m.urlRegex = /https?:\/\/\S+(\/\S+)/i
' https://github.com/LuanRT/YouTube.js/blob/6082b4a52ee07a622735e6e9128a0531a5ae3bfb/src/utils/StreamingInfo.ts#L332-L349
m.colorInfo = {
@@ -38,8 +37,11 @@ class DashManifest
adaptiveFormats.Append(metadata.adaptiveFormats)
if local
parsedInvidiousUrl = UrlUtils.ParseUrl(m.invidiousInstance)
for i = 0 to adaptiveFormats.Count() - 1
adaptiveFormats[i].url = m.urlRegex.replace(adaptiveFormats[i].url, m.invidiousInstance + "\1")
parsedUrl = UrlUtils.ParseUrl(adaptiveFormats[i].url)
parsedInvidiousUrl.path = UrlUtils.AppendQueryParams(parsedUrl.path, { host: parsedUrl.host })
adaptiveFormats[i].url = UrlUtils.BuildUrlFromParts(parsedInvidiousUrl)
end for
end if
@@ -1,19 +1,19 @@
const INNERTUBE_IOS_CLIENT_NAME = "5"
const INNERTUBE_IOS_CLIENT_VERSION = "19.49.7"
const INNERTUBE_IOS_CLIENT_VERSION = "20.20.5"
const INNERTUBE_IOS_DEVICE_MODEL = "iPhone16,2"
const INNERTUBE_IOS_OS_VERSION = "18.1"
const INNERTUBE_IOS_USER_AGENT = "com.google.ios.youtube/19.49.7 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X)"
const INNERTUBE_IOS_USER_AGENT = "com.google.ios.youtube/20.20.5 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X)"
const INNERTUBE_WEB_BROWSER_NAME = "Chrome"
const INNERTUBE_WEB_BROWSER_VERSION = "134.0.0.0"
const INNERTUBE_WEB_BROWSER_VERSION = "136.0.0.0"
const INNERTUBE_WEB_CLIENT_NAME = "1"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20250317.01.00"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20250520.05.00"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0"
const INNERTUBE_TV_BROWSER_NAME = "LG Browser"
const INNERTUBE_TV_BROWSER_VERSION = "7.00.00"
const INNERTUBE_TV_CLIENT_NAME = "2"
const INNERTUBE_TV_CLIENT_VERSION = "7.20241211.14.01"
const INNERTUBE_TV_CLIENT_VERSION = "7.20250519.12.01"
const INNERTUBE_TV_DEVICE_MAKE = "LGE"
const INNERTUBE_TV_DEVICE_MODEL = "24LF4820-BU"
const INNERTUBE_TV_OS_NAME = "webOS"
@@ -147,6 +147,7 @@ namespace Innertube
"clientFormFactor": "UNKNOWN_FORM_FACTOR"
"webpSupport": false
"tvAppInfo": {
' "appQuality": "TV_APP_QUALITY_FULL_ANIMATION"
"appQuality": "TV_APP_QUALITY_LIMITED_MEMORY"
"useStartPlaybackPreviewCommand": false
"supportsNativeScrolling": false
@@ -162,7 +163,12 @@ namespace Innertube
end function
function GetCurrentLocale(deviceInfo as object) as string
return deviceInfo.GetCurrentLocale()
currentLocale = deviceInfo.GetCurrentLocale()
' en_CA is not a valid locale for Innertube
if currentLocale = "en_CA"
currentLocale = "en_US"
end if
return currentLocale
end function
function GetContentRegion(deviceInfo as object) as string
@@ -7,6 +7,7 @@ import "pkg:/components/Services/Innertube/PlayerEndpoint.bs"
import "pkg:/components/Services/Innertube/ResolveUrlEndpoint.bs"
import "pkg:/components/Services/Innertube/SearchEndpoint.bs"
import "pkg:/components/Services/Innertube/SearchFilters.bs"
import "pkg:/components/Services/Innertube/SubscriptionEndpoint.bs"
import "pkg:/source/services/HttpClient.bs"
import "pkg:/source/utils/CancellationUtils.bs"
import "pkg:/source/utils/ObjectUtils.bs"
@@ -39,8 +40,12 @@ namespace InnertubeService
end if
end if
playerRequest = Innertube.CreatePlayerRequest(videoId, ctt, visitorData)
playerRequest = Innertube.CreatePlayerRequest(videoId, ctt, visitorData, Innertube.ClientType.IOS)
playerRequest.Cancellation(cancellation)
if raw
playerRequest.LogCurlCommand()
playerRequest.NoCache()
end if
playerRequest.Send()
nextRequest = invalid
@@ -48,6 +53,10 @@ namespace InnertubeService
if fetchNext
nextRequest = Innertube.CreateNextRequest({ "videoId": videoId }, ctt)
nextRequest.Cancellation(cancellation)
if raw
nextRequest.LogCurlCommand()
nextRequest.NoCache()
end if
nextRequest.Send()
end if
@@ -227,9 +236,16 @@ namespace InnertubeService
request = Innertube.CreateBrowseRequest("FEtrending", Innertube.ClientType.WEB, params)
request.Cancellation(cancellation)
if raw
request.LogCurlCommand()
request.NoCache()
end if
response = request.Await()
if not response.IsSuccess()
return invalid
return {
error: response.ErrorMessage()
}
end if
if raw
@@ -291,11 +307,142 @@ namespace InnertubeService
response = request.Await()
if not response.IsSuccess()
return invalid
return {
error: response.ErrorMessage()
}
end if
json = response.Json()
return Innertube.ParseResponseDataForFeeds(json)
feeds = Innertube.ParseResponseDataForFeeds(response.Json())
result = {
feeds: feeds
}
cacheControl = Innertube.ParseResponseForCacheControl(response)
if cacheControl <> invalid
result["cache-control"] = cacheControl
end if
return result
end function
function AuthGetPlaybackTrackingUrls(videoId as string, options as object) as object
cancellation = invalid
accessToken = options.accessToken
if options.DoesExist("cancellation")
cancellation = options.cancellation
end if
playerRequest = Innertube.CreatePlayerRequest(videoId, "", "", Innertube.ClientType.Tv)
playerRequest.Cancellation(cancellation)
playerRequest.Header("Authorization", "Bearer " + accessToken)
playerResponse = playerRequest.Await()
if not playerResponse.IsSuccess()
return {
error: playerResponse.ErrorMessage()
}
end if
json = playerResponse.Json()
videostatsPlaybackUrl = ObjectUtils.Dig(json, ["playbackTracking", "videostatsPlaybackUrl", "baseUrl"])
videostatsWatchtimeUrl = ObjectUtils.Dig(json, ["playbackTracking", "videostatsWatchtimeUrl", "baseUrl"])
return {
videostatsPlaybackUrl: videostatsPlaybackUrl
videostatsWatchtimeUrl: videostatsWatchtimeUrl
}
end function
function AuthMarkVideoWatched(videostatsPlaybackUrl as string, options as object) as boolean
cancellation = invalid
accessToken = options.accessToken
if options.DoesExist("cancellation")
cancellation = options.cancellation
end if
videostatsPlaybackUrl = videostatsPlaybackUrl.replace("https://s.", "https://www.")
queryParams = UrlUtils.ParseQueryComponents(videostatsPlaybackUrl)
queryParams["c"] = "TVHTML5"
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["ver"] = "2"
queryParams["cpn"] = InnertubeService.CreateClientPlaybackNonce()
queryParams["cmt"] = 0
queryParams["final"] = "1"
videostatsPlaybackUrl = UrlUtils.SetQueryParams(videostatsPlaybackUrl, queryParams)
request = HttpClient.Get(videostatsPlaybackUrl)
request.Cancellation(cancellation)
request.NoCache()
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Tv))
request.Header("Authorization", "Bearer " + accessToken)
response = request.Await()
if not response.IsSuccess()
LogError("Error marking video as watched:", response.ErrorMessage())
return false
end if
LogDebug("Marked video as watched")
return true
end function
function AuthMarkVideoWatchTime(time as float, videostatsWatchtimeUrl as string, options = invalid as object) as boolean
cancellation = invalid
accessToken = options.accessToken
if options <> invalid
if options.DoesExist("cancellation")
cancellation = options.cancellation
end if
end if
timeStr = time.ToStr("%.3f")
videostatsWatchtimeUrl = videostatsWatchtimeUrl.replace("https://s.", "https://www.")
queryParams = UrlUtils.ParseQueryComponents(videostatsWatchtimeUrl)
queryParams["c"] = "TVHTML5"
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["ver"] = "2"
queryParams["cpn"] = InnertubeService.CreateClientPlaybackNonce()
queryParams["cmt"] = 0
queryParams["final"] = "1"
queryParams["st"] = timeStr
queryParams["et"] = timeStr
videostatsWatchtimeUrl = UrlUtils.SetQueryParams(videostatsWatchtimeUrl, queryParams)
request = HttpClient.Get(videostatsWatchtimeUrl)
request.Cancellation(cancellation)
request.NoCache()
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Tv))
request.Header("Authorization", "Bearer " + accessToken)
response = request.Await()
if not response.IsSuccess()
LogError("Error marking video watch time:", response.ErrorMessage())
return false
end if
LogDebug("Marked video watch time:", timeStr)
return true
end function
function CreateClientPlaybackNonce() as string
length = 16
result = []
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
alphabetLen = alphabet.len()
for i = 1 to length
result.push(alphabet.mid(Rnd(alphabetLen - 1), 1))
end for
return result.join("")
end function
function GetChannel(channelId as string, options = invalid as object) as object
@@ -321,6 +468,10 @@ namespace InnertubeService
request = Innertube.CreateBrowseRequest(channelId, Innertube.ClientType.Web, params, continuation)
request.Cancellation(cancellation)
if raw
request.LogCurlCommand()
request.NoCache()
end if
response = request.Await()
if not response.IsSuccess()
@@ -346,10 +497,123 @@ namespace InnertubeService
return result
end function
function GetSubscriptionStatusForChannel(channelId as string, options = invalid as object) as object
cancellation = invalid
accessToken = options.accessToken
if options <> invalid
if options.DoesExist("cancellation")
cancellation = options.cancellation
end if
end if
request = Innertube.CreateBrowseRequest(channelId, Innertube.ClientType.Tv, "", "")
request.Cancellation(cancellation)
if accessToken <> invalid
request.Header("Authorization", "Bearer " + accessToken)
end if
response = request.Await()
if not response.IsSuccess()
return {
error: response.ErrorMessage()
}
end if
responseData = response.Json()
error = Innertube.ParseResponseDataForError(responseData)
if error <> ""
return {
error: error
}
end if
channelHeaderButtons = ObjectUtils.Dig(responseData, ["contents", "tvBrowseRenderer", "content", "tvSurfaceContentRenderer", "header", "channelHeaderRenderer", "buttons"])
if not IsArray(channelHeaderButtons)
return {
error: "Node 'contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.header.channelHeaderRenderer.buttons' not found"
}
end if
subscribeButtonRenderer = invalid
for each button in channelHeaderButtons
if not IsAssociativeArray(button) or not button.DoesExist("subscribeButtonRenderer")
continue for
end if
subscribeButtonRenderer = button.subscribeButtonRenderer
exit for
end for
if subscribeButtonRenderer = invalid
return {
error: "no 'subscribeButtonRenderer' found under 'buttons'"
}
end if
if not IsBool(subscribeButtonRenderer["subscribed"])
return {
error: "no 'subscribed' status found under 'subscribeButtonRenderer'"
}
end if
return {
success: true
isSubscribed: subscribeButtonRenderer["subscribed"]
}
end function
function SubscribeToChannel(channelId as string, options = invalid as object) as object
cancellation = invalid
accessToken = options.accessToken
if options <> invalid
if options.DoesExist("cancellation")
cancellation = options.cancellation
end if
end if
request = Innertube.CreateSubscribeRequest(channelId, "")
request.Cancellation(cancellation)
if accessToken <> invalid
request.Header("Authorization", "Bearer " + accessToken)
end if
response = request.Await()
return {
success: response.IsSuccess()
error: response.ErrorMessage()
}
end function
function UnsubscribeFromChannel(channelId as string, options = invalid as object) as object
cancellation = invalid
accessToken = options.accessToken
if options <> invalid
if options.DoesExist("cancellation")
cancellation = options.cancellation
end if
end if
request = Innertube.CreateUnsubscribeRequest(channelId, "")
request.Cancellation(cancellation)
if accessToken <> invalid
request.Header("Authorization", "Bearer " + accessToken)
end if
response = request.Await()
return {
success: response.IsSuccess()
error: response.ErrorMessage()
}
end function
function GetPlaylist(playlistId as string, options = invalid as object) as object
continuation = ""
cancellation = invalid
raw = false
accessToken = invalid
if options <> invalid
if options.DoesExist("continuation")
@@ -361,14 +625,29 @@ namespace InnertubeService
if options.DoesExist("raw")
raw = options.raw
end if
if options.DoesExist("accessToken")
accessToken = options.accessToken
end if
end if
if not playlistId.StartsWith("VL")
playlistId = "VL" + playlistId
end if
request = Innertube.CreateBrowseRequest(playlistId, Innertube.ClientType.Web, "", continuation)
client = Innertube.ClientType.Web
if accessToken <> invalid
client = Innertube.ClientType.Tv
end if
request = Innertube.CreateBrowseRequest(playlistId, client, "", continuation)
request.Cancellation(cancellation)
if accessToken <> invalid
request.Header("Authorization", "Bearer " + accessToken)
end if
if raw
request.LogCurlCommand()
request.NoCache()
end if
response = request.Await()
if not response.IsSuccess()
@@ -383,6 +662,10 @@ namespace InnertubeService
result = Innertube.ParsePlaylistPageResponseData(response.Json())
if result.playlistId = invalid and result.error = invalid
result["playlistId"] = playlistId
end if
cacheControl = Innertube.ParseResponseForCacheControl(response)
if cacheControl <> invalid
result["cache-control"] = cacheControl
@@ -414,6 +697,10 @@ namespace InnertubeService
end if
request = Innertube.CreateNextRequest(args, "")
request.Cancellation(cancellation)
if raw
request.LogCurlCommand()
request.NoCache()
end if
response = request.Await()
if not response.IsSuccess()
@@ -426,7 +713,14 @@ namespace InnertubeService
return response.Json()
end if
return Innertube.ParseMixPageResponseData(response.Json())
result = Innertube.ParseMixPageResponseData(response.Json())
cacheControl = Innertube.ParseResponseForCacheControl(response)
if cacheControl <> invalid
result["cache-control"] = cacheControl
end if
return result
end function
function ResolveUrl(url as string, options = invalid as object) as object
@@ -477,24 +771,19 @@ namespace InnertubeService
return Innertube.PollForAccessToken(code, code, cancellation)
end function
function AuthRefreshAccessTokenIfNeeded(accessToken as object, cancellation = invalid as object) as boolean
function AuthRefreshAccessToken(accessToken as object, cancellation = invalid as object) as boolean
if not IsAssociativeArray(accessToken)
return false
end if
nowSeconds = TimeUtils.Now().AsSeconds()
expiresTimestamp = accessToken["expires_timestamp"]
refreshed = Innertube.RefreshAccessToken(accessToken, cancellation)
if expiresTimestamp = invalid or expiresTimestamp < nowSeconds
refreshed = Innertube.RefreshAccessToken(accessToken, cancellation)
if IsAssociativeArray(refreshed) and refreshed.DoesExist("accessToken")
accessToken.Append(refreshed)
if accessToken.DoesExist("expiresIn")
accessToken["expiresTimestamp"] = TimeUtils.Now().AsSeconds() + accessToken["expiresIn"]
end if
return true
if IsAssociativeArray(refreshed) and refreshed.DoesExist("accessToken")
accessToken.Append(refreshed)
if accessToken.DoesExist("expiresIn")
accessToken["expiresTimestamp"] = TimeUtils.Now().AsSeconds() + accessToken["expiresIn"]
end if
return true
end if
return false
@@ -25,7 +25,7 @@ namespace Innertube
for each key in nodeData
directive = directives[key]
if directive = invalid
LogWarn("Unknown node", key)
LogWarn("Unknown node", key, `\n`, FormatJson(nodeData[key]))
#if THROW_ON_UNKNOWN_NODES
#if DEBUG
throw "Unknown node: " + key
@@ -42,6 +42,7 @@ namespace Innertube
function GetParsingDirectives() as object
return {
"twoColumnSearchResultsRenderer": ParseTwoColumnSearchResultsRenderer
"singleColumnBrowseResultsRenderer": ParseSingleColumnBrowseResultsRenderer
"twoColumnBrowseResultsRenderer": ParseTwoColumnBrowseResultsRenderer
"watchNextEndScreenRenderer": ParseWatchNextEndScreenRenderer
"tabRenderer": ParseTabRenderer
@@ -53,9 +54,11 @@ namespace Innertube
"reelShelfRenderer": ParseReelShelfRenderer
"verticalListRenderer": ParseVerticalListRenderer
"horizontalListRenderer": ParseHorizontalListRenderer
"horizontalListContinuation": ParseHorizontalListContinuation
"expandedShelfContentsRenderer": ParseExpandedShelfContentsRenderer
"channelFeaturedContentRenderer": ParseChannelFeaturedContentRenderer
"playlistVideoListRenderer": ParsePlaylistVideoListRenderer
"playlistVideoListContinuation": ParsePlaylistVideoListContinuation
"videoRenderer": ParseVideoRenderer
"gridVideoRenderer": ParseGridVideoRenderer
"channelVideoPlayerRenderer": ParseChannelVideoPlayerRenderer
@@ -66,12 +69,14 @@ namespace Innertube
"gridChannelRenderer": ParseGridChannelRenderer
"playlistRenderer": ParsePlaylistRenderer
"gridPlaylistRenderer": ParseGridPlaylistRenderer
"gridShelfViewModel": ParseGridShelfViewModel
"lockupViewModel": ParseLockupViewModel
"shortsLockupViewModel": ParseShortsLockupViewModel
"tvBrowseRenderer": ParseTvBrowseRenderer
"tvSurfaceContentRenderer": ParseTvSurfaceContentRenderer
"tvSecondaryNavRenderer": ParseTvSecondaryNavRenderer
"tvSecondaryNavSectionRenderer": ParseTvSecondaryNavSectionRenderer
"twoColumnRenderer": ParseTwoColumnRenderer
"tileRenderer": ParseTileRenderer
"gridRenderer": ParseGridRenderer
"richGridRenderer": ParseRichGridRenderer
@@ -81,6 +86,8 @@ namespace Innertube
"gridContinuation": ParseGridContinuation
"tvSurfaceContentContinuation": ParseTvSurfaceContentContinuation
' Ignored nodes:
' A playlist at the end of a video. We don't need that for now.
"endScreenPlaylistRenderer": ParseNotImplemented
' Posts not yet supported
"postRenderer": ParseNotImplemented
' a "View all posts" button
@@ -95,8 +102,18 @@ namespace Innertube
"officialCardViewModel": ParseNotImplemented
' Usually contains a "X unavailable video(s) are hidden" message. Ignored.
"messageRenderer": ParseNotImplemented
' Messages like "Videos you watch will be saved here"
"genericPromoRenderer": ParseNotImplemented
' "Sign in to see the latest videos tailored to your interests"
"feedNudgeRenderer": ParseNotImplemented
' "No results found, Try different keywords or remove search filters"
"backgroundPromoRenderer": ParseNotImplemented
"videoSurveyShelfRenderer": ParseNotImplemented
"searchBarRenderer": ParseNotImplemented
"clickTrackingParams": ParseNotImplemented
"promoShelfRenderer": ParseNotImplemented
"adSlotRenderer": ParseNotImplemented
"adsControlFlowOpportunityReceivedCommand": ParseNotImplemented
}
end function
@@ -104,6 +121,10 @@ namespace Innertube
return nodeData["primaryContents"]
end function
function ParseSingleColumnBrowseResultsRenderer(nodeData as object, _context as object) as object
return nodeData["tabs"]
end function
function ParseTwoColumnBrowseResultsRenderer(nodeData as object, _context as object) as object
return nodeData["tabs"]
end function
@@ -167,8 +188,25 @@ namespace Innertube
return nodeData["items"]
end function
function ParseHorizontalListRenderer(nodeData as object, _context as object) as object
' TODO: handle continuations
function ParseHorizontalListRenderer(nodeData as object, context as object) as object
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
if IsString(continuation)
if not StringUtils.IsNullOrEmpty(context.currentFeed.continuation)
StartNewFeed("", context)
end if
context.currentFeed.continuation = continuation
end if
return nodeData["items"]
end function
function ParseHorizontalListContinuation(nodeData as object, context as object) as object
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
if IsString(continuation)
if not StringUtils.IsNullOrEmpty(context.currentFeed.continuation)
StartNewFeed("", context)
end if
context.currentFeed.continuation = continuation
end if
return nodeData["items"]
end function
@@ -180,7 +218,19 @@ namespace Innertube
return nodeData["items"]
end function
function ParsePlaylistVideoListRenderer(nodeData as object, _context as object) as object
function ParsePlaylistVideoListRenderer(nodeData as object, context as object) as object
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
if IsString(continuation)
context.currentFeed.continuation = continuation
end if
return nodeData["contents"]
end function
function ParsePlaylistVideoListContinuation(nodeData as object, context as object) as object
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
if IsString(continuation)
context.currentFeed.continuation = continuation
end if
return nodeData["contents"]
end function
@@ -395,6 +445,7 @@ namespace Innertube
lengthText = ParseText(nodeData["lengthText"])
lengthSeconds = ValidString(nodeData["lengthSeconds"]).ToInt()
videoInfo = ParseText(nodeData["videoInfo"])
author = invalid
authorId = invalid
@@ -427,6 +478,7 @@ namespace Innertube
"index": ParseText(nodeData["index"]).ToInt()
"lengthText": lengthText
"lengthSeconds": lengthSeconds
"videoInfo": videoInfo
}
PushFeedItem(video, context)
@@ -674,6 +726,10 @@ namespace Innertube
return invalid
end function
function ParseGridShelfViewModel(nodeData as object, _context as object) as object
return nodeData["contents"]
end function
function ParseLockupViewModel(nodeData as object, context as object) as object
contentType = ValidString(nodeData["contentType"])
if contentType = "LOCKUP_CONTENT_TYPE_PLAYLIST"
@@ -684,7 +740,7 @@ namespace Innertube
return LockupViewModelTypeAlbum(nodeData, context)
end if
LogWarn("Unknown content type:", contentType, `\n`, nodeData)
LogWarn("Unknown content type:", contentType, `\n`, FormatJson(nodeData))
#if THROW_ON_UNKNOWN_NODES
#if DEBUG
throw "Unknown content type: " + contentType
@@ -866,15 +922,31 @@ namespace Innertube
return nodeData["tabs"]
end function
function ParseTwoColumnRenderer(nodeData as object, context as object) as object
' twoColumnRenderer is used for Playlists on TV.
' The right column has the videos (and continuation)
' The left column has the playlist info (title, description, etc) which was already parsed
return nodeData["rightColumn"]
end function
function ParseTileRenderer(nodeData as object, context as object) as object
contentType = ValidString(nodeData["contentType"])
' A tileRenderer can be without a contentType, such as a
' button that says "Open YouTube Kids" or similar CTAs
if contentType = ""
LogWarn(`TileRenderer without contentType:\n`, nodeData)
return invalid
end if
if contentType = "TILE_CONTENT_TYPE_VIDEO"
return TileRendererTypeVideo(nodeData, context)
else if contentType = "TILE_CONTENT_TYPE_SHORTS"
return TileRendererTypeShorts(nodeData, context)
else if contentType = "TILE_CONTENT_TYPE_PLAYLIST"
return TileRendererTypePlaylist(nodeData, context)
end if
LogWarn("Unknown content type:", contentType, `\n`, nodeData)
LogWarn("Unknown content type:", contentType, `\n`, FormatJson(nodeData))
#if THROW_ON_UNKNOWN_NODES
#if DEBUG
throw "Unknown content type: " + contentType
@@ -902,6 +974,7 @@ namespace Innertube
lengthText = ""
isUpcoming = false
liveNow = false
percentDurationWatched = 0
thumbnailOverlays = ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnailOverlays"])
if IsArray(thumbnailOverlays)
for each overlay in thumbnailOverlays
@@ -909,6 +982,10 @@ namespace Innertube
if maybeLengthText <> ""
lengthText = maybeLengthText
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
@@ -917,6 +994,17 @@ namespace Innertube
end if
end if
renderedLines = []
lines = ObjectUtils.Dig(nodeData, ["metadata", "tileMetadataRenderer", "lines"])
if IsArray(lines)
for each line in lines
if not IsAssociativeArray(line)
continue for
end if
renderedLines.Push(ParseLineRenderer(line["lineRenderer"]))
end for
end if
video = {
"type": "video"
"videoId": videoId
@@ -925,6 +1013,46 @@ namespace Innertube
"lengthText": lengthText
"liveNow": liveNow
"isUpcoming": isUpcoming
"lines": renderedLines
"percentDurationWatched": percentDurationWatched
}
PushFeedItem(video, context)
return invalid
end function
function TileRendererTypeShorts(nodeData as object, context as object) as object
videoId = nodeData["contentId"]
if not IsString(videoId)
LogWarn("Invalid video ID", nodeData)
return invalid
end if
if context.generateVideoThumbnails = true
videoThumbnails = GenerateVideoThumbnails(videoId)
else
videoThumbnails = ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnail", "thumbnails"])
if videoThumbnails = invalid
videoThumbnails = GenerateVideoThumbnails(videoId)
end if
end if
title = ""
thumbnailOverlays = ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnailOverlays"])
if IsArray(thumbnailOverlays)
for each overlay in thumbnailOverlays
title = ParseText(ObjectUtils.Dig(overlay, ["tileMetadataRenderer", "title"]))
if title <> ""
exit for
end if
end for
end if
video = {
"type": "video"
"videoId": videoId
"title": title
"videoThumbnails": videoThumbnails
}
PushFeedItem(video, context)
@@ -949,12 +1077,24 @@ namespace Innertube
end for
end if
renderedLines = []
lines = ObjectUtils.Dig(nodeData, ["metadata", "tileMetadataRenderer", "lines"])
if IsArray(lines)
for each line in lines
if not IsAssociativeArray(line)
continue for
end if
renderedLines.Push(ParseLineRenderer(line["lineRenderer"]))
end for
end if
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": ParseText(ObjectUtils.Dig(nodeData, ["metadata", "tileMetadataRenderer", "title"]))
"playlistThumbnail": ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnail", "thumbnails", 0, "url"])
"videoCountText": videoCountText
"lines": renderedLines
}
PushFeedItem(playlist, context)
@@ -1026,6 +1166,44 @@ namespace Innertube
return ""
end function
function ParseLineRenderer(data as object) as string
if data = invalid
return ""
end if
if IsString(data)
return data
end if
if not IsAssociativeArray(data) or not data.DoesExist("items")
return ""
end if
items = data["items"]
if not IsArray(items)
return ""
end if
texts = []
for each item in items
if IsString(item)
texts.Push(item)
else if IsAssociativeArray(item) and item.DoesExist("lineItemRenderer")
texts.Push(ParseLineItemRenderer(item["lineItemRenderer"]))
end if
end for
return texts.Join(" ")
end function
function ParseLineItemRenderer(data as object) as string
if data = invalid
return ""
end if
if IsString(data)
return data
end if
if not IsAssociativeArray(data) or not data.DoesExist("text")
return ""
end if
return ParseText(data["text"])
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 = ""
@@ -184,44 +184,85 @@ namespace Innertube
}
end if
playlistId = invalid
title = invalid
author = invalid
authorId = invalid
description = invalid
videoCount = -1
thumbnail = invalid
statsText = invalid
playlistSidebarRendererItems = ObjectUtils.Dig(responseData, ["sidebar", "playlistSidebarRenderer", "items"])
if playlistSidebarRendererItems <> invalid
primaryInfo = ObjectUtils.Dig(playlistSidebarRendererItems, [0, "playlistSidebarPrimaryInfoRenderer"])
secondaryInfo = ObjectUtils.Dig(playlistSidebarRendererItems, [1, "playlistSidebarSecondaryInfoRenderer"])
primaryInfo = ObjectUtils.Dig(playlistSidebarRendererItems, [0, "playlistSidebarPrimaryInfoRenderer"])
secondaryInfo = ObjectUtils.Dig(playlistSidebarRendererItems, [1, "playlistSidebarSecondaryInfoRenderer"])
playlistId = ObjectUtils.Dig(primaryInfo, ["navigationEndpoint", "watchEndpoint", "playlistId"])
title = ParseText(ObjectUtils.Dig(primaryInfo, ["title"]))
description = ParseText(ObjectUtils.Dig(primaryInfo, ["description"]))
videoCount = ParseText(ObjectUtils.Dig(primaryInfo, ["stats", 0, "runs", 0, "text"])).ToInt()
thumbnail = ObjectUtils.Dig(primaryInfo, ["thumbnailRenderer", "playlistVideoThumbnailRenderer", "thumbnail", "thumbnails", 0, "url"])
playlistId = ObjectUtils.Dig(primaryInfo, ["navigationEndpoint", "watchEndpoint", "playlistId"])
title = ParseText(ObjectUtils.Dig(primaryInfo, ["title"]))
description = ParseText(ObjectUtils.Dig(primaryInfo, ["description"]))
videoCount = ParseText(ObjectUtils.Dig(primaryInfo, ["stats", 0, "runs", 0, "text"])).ToInt()
thumbnail = ObjectUtils.Dig(primaryInfo, ["thumbnailRenderer", "playlistVideoThumbnailRenderer", "thumbnail", "thumbnails", 0, "url"])
author = ParseText(ObjectUtils.Dig(secondaryInfo, ["videoOwner", "videoOwnerRenderer", "title"]))
authorId = ObjectUtils.Dig(secondaryInfo, ["videoOwner", "videoOwnerRenderer", "navigationEndpoint", "browseEndpoint", "browseId"])
stats = ObjectUtils.Dig(primaryInfo, ["stats"])
if IsArray(stats)
statsTexts = []
for each stat in stats
statText = ParseText(stat)
if statText <> ""
statsTexts.Push(statText)
end if
end for
statsText = statsTexts.Join(" • ")
end if
end if
author = ParseText(ObjectUtils.Dig(secondaryInfo, ["videoOwner", "videoOwnerRenderer", "title"]))
authorId = ObjectUtils.Dig(secondaryInfo, ["videoOwner", "videoOwnerRenderer", "navigationEndpoint", "browseEndpoint", "browseId"])
statsText = ""
stats = ObjectUtils.Dig(primaryInfo, ["stats"])
if IsArray(stats)
statsTexts = []
for each stat in stats
statText = ParseText(stat)
if statText <> ""
statsTexts.Push(statText)
twoColumnRenderer = ObjectUtils.Dig(responseData, ["contents", "tvBrowseRenderer", "content", "tvSurfaceContentRenderer", "content", "twoColumnRenderer"])
if twoColumnRenderer <> invalid
entityMetadataRenderer = ObjectUtils.Dig(twoColumnRenderer, ["leftColumn", "entityMetadataRenderer"])
if entityMetadataRenderer <> invalid
if title = invalid
title = ParseText(entityMetadataRenderer["title"])
end if
end for
statsText = statsTexts.Join(" • ")
if statsText = invalid
statsText = ParseLineRenderer(ObjectUtils.Dig(entityMetadataRenderer, ["bylines", 0, "lineRenderer"]))
end if
if description = invalid
description = ParseText(entityMetadataRenderer["description"])
end if
if playlistId = invalid
playlistId = ObjectUtils.Dig(twoColumnRenderer, ["rightColumn", "playlistVideoListRenderer", "playlistId"])
end if
end if
end if
playlist = {
"playlistId": playlistId
"title": title
"author": author
"authorId": authorId
"description": description
"videoCount": videoCount
"thumbnail": thumbnail
"videos": []
"statsText": statsText
}
if playlistId <> invalid
playlist["playlistId"] = playlistId
end if
if title <> invalid
playlist["title"] = title
end if
if author <> invalid
playlist["author"] = author
end if
if authorId <> invalid
playlist["authorId"] = authorId
end if
if description <> invalid
playlist["description"] = description
end if
if thumbnail <> invalid
playlist["thumbnail"] = thumbnail
end if
if statsText <> invalid
playlist["statsText"] = statsText
end if
feeds = ParseResponseDataForFeeds(responseData)
if feeds.Count() > 0
@@ -231,6 +272,10 @@ namespace Innertube
end if
end if
if playlist["thumbnail"] = invalid and playlist["videos"].Count() > 0
playlist["thumbnail"] = ObjectUtils.Dig(playlist, ["videos", 0, "thumbnails", 0, "url"])
end if
return playlist
end function
@@ -6,12 +6,12 @@ import "pkg:/source/utils/Types.bs"
namespace Innertube
function CreatePlayerRequest(videoId as string, ctt as string, visitorData as string) as object
function CreatePlayerRequest(videoId as string, ctt as string, visitorData as string, client as Innertube.ClientType) as object
deviceInfo = CreateObject("roDeviceInfo")
payload = {
"videoId": videoId
"context": Innertube.CreateContext(Innertube.ClientType.IOS, deviceInfo, ctt, visitorData)
"context": Innertube.CreateContext(client, deviceInfo, ctt, visitorData)
"playbackContext": {
"contentPlaybackContext": {
"vis": 0
@@ -36,7 +36,7 @@ namespace Innertube
"accept": "*/*"
"accept-language": "*"
}
headers.Append(Innertube.CreateHeaders(Innertube.ClientType.IOS))
headers.Append(Innertube.CreateHeaders(client))
request.Headers(headers)
return request
@@ -92,6 +92,7 @@ namespace Innertube
end if
lengthSeconds = videoDetails["lengthSeconds"].ToInt()
videoInfo = {
"type": "video"
"title": videoDetails["title"]
@@ -35,6 +35,10 @@ namespace Innertube
})
request.Cancellation(cancellation)
if raw
request.NoCache()
request.LogCurlCommand()
end if
response = request.Await()
if not response.IsSuccess()
@@ -9,7 +9,7 @@ import "pkg:/source/utils/TimeUtils.bs"
namespace Innertube
const SESSION_DATA_VERSION = 1
const INNERTUBE_VISITOR_DATA_LIFESPAN = 1000 * 60 * 60 * 24
const INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS = 60 * 60 * 24
function GetSessionData() as object
sessionData = ReadSessionDataFromRegistry()
@@ -81,7 +81,7 @@ namespace Innertube
timestamp = sessionData.timestamp
nowSeconds = TimeUtils.Now().AsSeconds()
if nowSeconds - timestamp > INNERTUBE_VISITOR_DATA_LIFESPAN
if nowSeconds - timestamp > INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS
RegistryUtils.Delete(RegistryUtils.INNERTUBE_SESSION_DATA)
return invalid
end if
@@ -0,0 +1,60 @@
import "pkg:/components/Services/Innertube/Context.bs"
import "pkg:/source/utils/Types.bs"
namespace Innertube
function CreateSubscribeRequest(channelIds as dynamic, params as string) as object
deviceInfo = CreateObject("roDeviceInfo")
payload = {
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, "", "")
}
if IsString(channelIds)
channelIds = [channelIds]
end if
payload["channelIds"] = channelIds
if not StringUtils.IsNullOrEmpty(params)
payload["params"] = params
end if
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/subscription/subscribe?prettyPrint=false&alt=json", payload)
headers = {
"accept": "*/*"
"accept-language": "*"
}
headers.Append(Innertube.CreateHeaders(Innertube.ClientType.Tv))
request.Headers(headers)
return request
end function
function CreateUnsubscribeRequest(channelIds as dynamic, params as string) as object
deviceInfo = CreateObject("roDeviceInfo")
payload = {
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, "", "")
}
if IsString(channelIds)
channelIds = [channelIds]
end if
payload["channelIds"] = channelIds
if not StringUtils.IsNullOrEmpty(params)
payload["params"] = params
end if
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/subscription/unsubscribe?prettyPrint=false&alt=json", payload)
headers = {
"accept": "*/*"
"accept-language": "*"
}
headers.Append(Innertube.CreateHeaders(Innertube.ClientType.Tv))
request.Headers(headers)
return request
end function
end namespace
@@ -14,18 +14,3 @@ end function
function GetAuthorizeTokenLink(_unused as dynamic) as dynamic
return m.service.GetAuthorizeTokenLink()
end function
function OnAuthTokenChange() as void
m.top.refreshSubscribtions = true
end function
function GetSubscriptions() as void
if m.subscriptionsTask <> invalid
m.subscriptionsTask.cancel = true
end if
if m.top.authToken = invalid
m.top.subscriptions = invalid
return
end if
m.subscriptionsTask = AsyncTask.Start(Tasks.InvidiousSubscriptionsTask, { invidious: m.top })
end function
@@ -5,10 +5,8 @@
<field id="webServer" type="node" />
<field id="profilesService" type="node" />
<field id="authToken" type="assocarray" onChange="OnAuthTokenChange" />
<field id="authToken" type="assocarray" />
<field id="apiDefinitions" type="assocarray" />
<field id="refreshSubscribtions" type="boolean" alwaysNotify="true" onChange="GetSubscriptions" />
<field id="subscriptions" type="assocarray" />
<function name="GetCurrentInstance" />
<function name="GetAuthorizeTokenLink" />
@@ -6,6 +6,8 @@ import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/services/HttpClient.bs"
import "pkg:/source/utils/CryptoUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MessagePortUtils.bs"
import "pkg:/source/utils/OptionUtils.bs"
import "pkg:/source/utils/RegistryUtils.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/TimeUtils.bs"
@@ -68,21 +70,22 @@ namespace Invidious
if m.preferences = invalid
m.preferences = m.invidiousNode.preferences
end if
instance = m.preferences["invidious.instance"]
if not StringUtils.IsNullOrEmpty(instance)
return instance
backend = m.preferences["backend.selected"]
if backend = "invidious"
instance = m.preferences["invidious.instance"]
if not StringUtils.IsNullOrEmpty(instance)
return instance
end if
end if
instance = DEFAULT_INSTANCE
if instance.StartsWith("http://127.0.0.1:8888")
address = m.invidiousNode.webServer@.GetServerAddress()
instance = instance.Replace("http://127.0.0.1:8888", address)
end if
address = m.invidiousNode.webServer@.GetServerAddress()
instance = instance.Replace("http://127.0.0.1:8888", address)
return instance
end function
function MarkVideoWatched(videoId as dynamic) as void
function MarkVideoWatched(videoId as dynamic, cancellation = invalid as object) as void
if StringUtils.IsNullOrEmpty(videoId)
return
end if
@@ -95,6 +98,7 @@ namespace Invidious
url = `${authToken.instance}${Invidious.HISTORY_ENDPOINT}/${videoId}`
request = HttpClient.Post(url, "")
request.Headers(m.GetAuthenticationHeaders(authToken.token))
request.Cancellation(cancellation)
request.Await()
end function
@@ -177,9 +181,7 @@ namespace Invidious
function GetPlaylist(playlistId as string, index = 0 as integer, continuation = "" as string, cancellation = invalid as object) as object
authToken = m.invidiousNode.authToken
' There's no need to use auth, unless the playlist is from Invidious
' (starts with "IV") because it can be a private playlist from logged user.
if playlistId.StartsWith("IV") and authToken <> invalid
if authToken <> invalid
url = `${authToken.instance}${Invidious.AUTH_PLAYLISTS}/${playlistId}`
request = HttpClient.Get(url)
request.Headers(m.GetAuthenticationHeaders(authToken.token))
@@ -258,7 +260,11 @@ namespace Invidious
return feedSource
end function
function MakeRequest(feedSource as object, additionalQueryParams = invalid as object, cancellation = invalid as object) as object
function MakeRequest(feedSource as object, options = invalid as dynamic) as object
additionalQueryParams = OptionUtils.Get(options, "additionalQueryParams")
cancellation = OptionUtils.Get(options, "cancellation")
httpServer = OptionUtils.Get(options, "httpServer")
if m.endpoints = invalid
m.endpoints = m.invidiousNode.apiDefinitions
end if
@@ -285,6 +291,20 @@ namespace Invidious
error: ERROR_NOT_AUTHENTICATED
}
end if
profileNode = authToken.profileNode
' This is not the right place for a token refresh,
' but it needs a refactor to be done properly.
if not profileNode@.HasValidAccessToken()
messagePort = CreateObject("roMessagePort")
MessagePortUtils.ObserveFieldScopedExSafe(profileNode, "accessToken", messagePort)
msg = wait(10000, messagePort)
profileNode.unobserveFieldScoped("accessToken")
if msg <> invalid
authToken.token = profileNode.accessToken
m.invidiousNode.authToken = authToken
end if
end if
request.Url(authToken.instance + endpoint.url)
request.Headers(m.GetAuthenticationHeaders(authToken.token))
end if
@@ -334,7 +354,7 @@ namespace Invidious
request.Cancellation(cancellation)
response = request.Await()
response = m.SendRequest(request, httpServer)
responseHandler = invalid
if IsString(endpoint.responseHandler) and m.DoesExist(endpoint.responseHandler)
@@ -358,10 +378,39 @@ namespace Invidious
return {
success: false
error: response.ErrorMessage()
cancelled: response.IsCancelled()
}
end if
end function
function SendRequest(request as HttpClient.HttpRequest, httpServer as dynamic) as dynamic
if httpServer = invalid
return request.Await()
end if
url = request.BuildUrl()
isUrlToLocalServer = url.StartsWith("http://127.0.0.1:8888") or url.StartsWith(m.invidiousNode.webServer@.GetServerAddress())
if not isUrlToLocalServer
return request.Await()
end if
parsedUrl = UrlUtils.ParseUrl(url)
method = request.GetMethod()
uri = parsedUrl.path
headers = request.GetHeaders()
body = ValidString(request.GetBody())
responseObj = httpServer.ProcessRequestLocal(method, uri, headers, body)
response = new HttpClient.HttpResponse(request, invalid)
response.OverrideStatusCode(responseObj.http_code)
response.OverrideHeaders(responseObj.headers)
body = ""
if responseObj.body <> invalid
body = responseObj.body.ToAsciiString()
end if
response.OverrideText(body)
return response
end function
function DefaultHandler(context as object) as object
response = context.response
@@ -1,42 +0,0 @@
import "InvidiousService.bs"
import "pkg:/source/utils/Logging.bs"
@asynctask
function InvidiousSubscriptionsTask(input as object) as object
invidiousNode = input.invidious
service = new Invidious.InvidiousService(invidiousNode)
response = service.GetSubscriptions(m.top.cancellation)
if m.top.cancel
return invalid
end if
subscriptions = response.Json()
if not response.IsSuccess() or subscriptions = invalid
error = response.ErrorMessage()
LogError("Error getting subscriptions:", error)
return {
success: false
error: response.ErrorMessage()
}
end if
if m.top.cancel
return invalid
end if
subscriptionsDict = {}
for each subscription in subscriptions
subscriptionsDict[subscription.authorId] = true
end for
invidiousNode.subscriptions = subscriptionsDict
return {
success: true
}
end function
@@ -51,6 +51,9 @@ namespace InvidiousContent
SetIfExists(node, "videoId", item, "videoId")
node.viewCountText = VideoGetViewCountText(item)
SetIfExists(node, "index", item, "index")
SetIfExists(node, "lines", item, "lines")
SetIfExists(node, "videoInfo", item, "videoInfo")
SetIfExists(node, "percentDurationWatched", item, "percentDurationWatched")
return node
end function
@@ -77,20 +80,40 @@ namespace InvidiousContent
SetIfExists(node, "updated", item, "updated")
node.updatedText = PlaylistGetUpdatedText(item)
SetIfExists(node, "statsText", item, "statsText")
SetIfExists(node, "lines", item, "lines")
if item.videos <> invalid
if IsArray(item.videos) and item.videos.Count() > 0
childCount = node.getChildCount()
' Innertube's TV client doesn't return the index for videos in playlists.
' So we rely on video ids to detect duplicates.
videosHasIndex = IsInt(item.videos[0].index)
videoIds = invalid
if not videosHasIndex
videoIds = {}
childVideos = node.getChildren(-1, 0)
for each child in childVideos
videoIds[child.videoId] = true
end for
end if
newNodes = []
for each video in item.videos
' TODO:P1 sometimes we're parsing "recommended playlists" that
' show up in the end of the playlist. We should ignore them,
' until the parsing is fixed.
' Sometimes we're parsing "recommended playlists" that show up
' in the end of the playlist. In this context they are ignored.
if ValidString(video.type) = "playlist"
continue for
end if
video.type = "video"
videoNode = ToVideoContentNode(invalid, video, instance)
if videoNode <> invalid
if not videosHasIndex
if videoIds[video.videoId] = true
continue for
end if
end if
index = video.index
if index <> invalid and index > -1 and index < childCount
node.replaceChild(videoNode, index)
@@ -99,6 +122,7 @@ namespace InvidiousContent
end if
end if
end for
if newNodes.Count() > 0
node.appendChildren(newNodes)
end if
@@ -307,6 +331,10 @@ namespace InvidiousContent
node.videoCountText = videoCountText
return
end if
' If we already have this information, we should not override it.
if not StringUtils.IsNullOrEmpty(node.videoCountText)
return
end if
videoCount = ValidInt(item.videoCount)
if videoCount = -1
return
@@ -49,7 +49,7 @@ class LongPoller
LogInfo(`Sending long polling GET ${url}`, "ID:", socket.GetID())
#if DEBUG
? `════════ curl command ════════\n${m.ToCurlCommand()}\n══════════════════════════════`
? `======== curl command ========\n${m.ToCurlCommand()}\n==============================`
#end if
message = `GET ${urlObject.path} HTTP/1.1\r\n`
@@ -122,7 +122,44 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
isDirty = true
end if
if userPrefs.__version = 2
if IsArray(userPrefs["misc.home_screen_layout"])
homeScreenLayout = userPrefs["misc.home_screen_layout"]
hasRecommended = false
for each item in homeScreenLayout
if item.id = "recommended"
hasRecommended = true
exit for
end if
end for
if not hasRecommended
homeScreenLayout.Unshift({
id: "recommended"
enabled: true
})
end if
end if
userPrefs.__version = 3
isDirty = true
end if
if userPrefs.__version = 3
if IsString(userPrefs["playback.backend"])
backend = userPrefs["playback.backend"]
userPrefs.Delete("playback.backend")
userPrefs["backend.selected"] = backend
end if
userPrefs.__version = 4
isDirty = true
end if
' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded)
#if DEBUG
if userPrefs.__version <> m.top.__version
throw "Preferences version mismatch. Expected: " + m.top.__version + ", found: " + userPrefs.__version
end if
#end if
return isDirty
end function
@@ -5,7 +5,7 @@
user prefs saved need to be migrated. If the version is less than the
current version, a migration is needed.
-->
<field id="__version" type="integer" value="2" />
<field id="__version" type="integer" value="4" />
<field id="prefsModel" type="array" />
<field id="preferenceFields" type="assocarray" />
<function name="GetUserPreferences" />
@@ -39,7 +39,7 @@ function LoadProfilesFromRegistry()
' Step 3: Save user preferences (if needed)
if isDirty
SaveUserProfilesToRegistry()
SaveUserProfilesToRegistry(invalid)
end if
' Step 4: Load user profiles into content nodes
@@ -127,7 +127,7 @@ function MigrateExistingProfiles(userProfiles as object) as boolean
return true
end function
function SaveUserProfilesToRegistry() as void
function SaveUserProfilesToRegistry(_unused as dynamic) as void
if m.disableSavingToRegistry
return
end if
@@ -322,7 +322,7 @@ function SetCurrentProfile(newActiveProfile as object) as void
m.top.currentProfile = invalid
m.invidious.authToken = invalid
LogInfo("Current profile set to <invalid>")
SaveUserProfilesToRegistry()
SaveUserProfilesToRegistry(invalid)
return
end if
@@ -333,9 +333,10 @@ function SetCurrentProfile(newActiveProfile as object) as void
token: newActiveProfile.accessToken
instance: newActiveProfile.serverUrl
username: newActiveProfile.username
profileNode: newActiveProfile
}
LogInfo("Current profile set to", newActiveProfile.username, "@", newActiveProfile.serverUrl)
SaveUserProfilesToRegistry()
SaveUserProfilesToRegistry(invalid)
end function
function RefreshActiveProfileState(activeProfile as object) as void
@@ -18,6 +18,7 @@
<function name="LogoutWithProfiles" />
<function name="LogoutWithAccessToken" />
<function name="SetCurrentProfile" />
<function name="SaveUserProfilesToRegistry" />
</interface>
<children>
<!-- Note: two content nodes because we're rendering profiles in a RowList on the ProfilesScreen -->
@@ -1,3 +1,4 @@
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
@@ -13,9 +14,24 @@ function OnContentSet() as void
end if
m.top.title = content.title
lines = content.lines
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.top.author = content._author
m.top.updated = content.updatedText
author = content._author
if StringUtils.IsNullOrEmpty(author)
if IsArray(lines) and lines.Count() > 0
author = lines[0]
end if
end if
m.top.author = author
updatedText = content.updatedText
if StringUtils.IsNullOrEmpty(updatedText)
if IsArray(lines) and lines.Count() > 1
updatedText = lines[1]
end if
end if
m.top.updated = updatedText
m.top.thumbnailUri = content.thumbnail
@@ -1,4 +1,5 @@
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/TimeUtils.bs"
import "pkg:/source/utils/Types.bs"
@@ -8,6 +9,7 @@ function Init()
m.durationLabel = m.top.FindNode("durationLabel")
m.smallestSystemFont = m.top.FindNode("smallestSystemFont")
m.smallestBoldSystemFont = m.top.FindNode("smallestBoldSystemFont")
m.progressRect = m.top.FindNode("progressRect")
end function
function OnContentSet() as void
@@ -18,11 +20,20 @@ function OnContentSet() as void
end if
m.top.title = content.title
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.top.author = content._author
lines = content.lines
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
author = content._author
if StringUtils.IsNullOrEmpty(author)
if IsArray(lines) and lines.Count() > 0
author = lines[0]
end if
end if
m.top.author = author
viewCountDate = ""
if content.isUpcoming = true
m.top.viewCountDate = content.premiereTimestampText
viewCountDate = content.premiereTimestampText
else
publishedText = content.publishedText
viewCountText = content.viewCountText
@@ -33,11 +44,19 @@ function OnContentSet() as void
end if
label += viewCountText
m.top.viewCountDate = label
viewCountDate = label
end if
if StringUtils.IsNullOrEmpty(viewCountDate)
if IsArray(lines) and lines.Count() > 1
viewCountDate = lines[1]
end if
end if
m.top.viewCountDate = viewCountDate
m.top.thumbnailUri = content.thumbnail
m.top.percentDurationWatched = content.percentDurationWatched
if not StringUtils.IsNullOrEmpty(content.lengthText)
SetDurationLabel(content.lengthText, "#161616FF", 0.8, m.smallestSystemFont)
m.top.durationRectVisible = true
@@ -75,3 +94,11 @@ function SetDurationLabel(text as string, bgColor as string, bgOpacity as float,
rect.opacity = bgOpacity
end function
function OnPercentDurationWatched() as void
if m.progressRect = invalid
return
end if
percent = MathUtils.Clamp(m.top.percentDurationWatched, 0, 100) / 100.0
m.progressRect.scale = [percent, 1]
end function
@@ -8,6 +8,7 @@
<field id="durationRectVisible" type="boolean" alias="durationRect.visible" />
<field id="duration" type="string" alias="durationLabel.text" />
<field id="thumbnailUri" type="string" alias="thumbnail.uri" />
<field id="percentDurationWatched" type="float" onChange="OnPercentDurationWatched" />
</interface>
<children>
<Font id="smallestSystemFont" uri="font:SystemFontFile" size="18" />
@@ -36,6 +37,14 @@
font="font:SmallestSystemFont"
translation="[8, 0]" />
</Rectangle>
<Rectangle
id="progressRect"
width="350"
height="5"
color="#FF0000"
translation="[0, 192]"
scale="[0, 1]">
</Rectangle>
</Poster>
<Label
id="titleLabel"
@@ -57,7 +57,10 @@ function VideoRowListRowContentTask(input as object) as object
feedSource = service.MarkFeedPagination(feedContentNode)
hadContinuation = not StringUtils.IsNullOrEmpty(feedSource.state.continuation)
response = service.MakeRequest(feedSource, feedSource.state.queryParams, m.top.cancellation)
response = service.MakeRequest(feedSource, {
additionalQueryParams: feedSource.state.queryParams
cancellation: m.top.cancellation
})
if not response.success
if response.error = Invidious.ERROR_NOT_AUTHENTICATED
@@ -93,7 +96,8 @@ function VideoRowListRowContentTask(input as object) as object
feedContentNode.title += " (Failed to load)"
end if
HandleFeedLoadErrorDialog(response.error, rowList)
isCancelled = response.cancelled = true
HandleFeedLoadErrorDialog(response.error, isCancelled, rowList)
continue while
end if
@@ -107,12 +111,23 @@ function VideoRowListRowContentTask(input as object) as object
end for
RemovePlaceHolderItems(feedContentNode)
feedContentNode.appendChildren(itemNodes)
addedItemCount = 0
' For some reason, Innertube's "FEplaylist_aggregation" (which maps to "inv_auth_playlists"
' aka Authenticated user playlists) returns continuation for the next page, but returns
' items from the first page. So we deduplicate to avoid loading this feed infnitely,
' with the same items repeating.
if feedSource.id = "inv_auth_playlists"
addedItemCount = DeduplicateAppendAuthPlaylists(feedContentNode, itemNodes)
else
feedContentNode.appendChildren(itemNodes)
addedItemCount = itemNodes.Count()
end if
hasContinuation = not StringUtils.IsNullOrEmpty(response.result.continuation)
feedSource.state.continuation = ValidString(response.result.continuation)
if response.result.items.Count() > 0
if addedItemCount > 0
pageType = feedSource.state.paginationType
if response.result.isLastPage = true or (hadContinuation and not hasContinuation)
feedSource.state.loadState = FeedLoadState.Loaded
@@ -136,19 +151,19 @@ function VideoRowListRowContentTask(input as object) as object
feedContentNode.loadState = FeedLoadState.LoadedPage
end if
if itemNodes.Count() > 0 and not someContentReadySet
if addedItemCount > 0 and not someContentReadySet
someContentReadySet = true
rowList.someContentReady = true
end if
totalfetchedItems += response.result.items.Count()
totalfetchedItems += addedItemCount
if totalfetchedItems > 3
exit while
end if
end while
catch error
HandleFeedLoadErrorDialog(error, rowList)
HandleFeedLoadErrorDialog(error, false, rowList)
return {
success: false
error: error
@@ -183,13 +198,57 @@ function RemovePlaceHolderItems(contentNode as object)
end if
end function
function HandleFeedLoadErrorDialog(error as object, rowList as object) as void
function DeduplicateAppendAuthPlaylists(feedContentNode as object, itemNodes as object) as integer
if itemNodes.Count() = 0
return 0
end if
currentChildCount = feedContentNode.getChildCount()
if currentChildCount = 0
feedContentNode.appendChildren(itemNodes)
return itemNodes.Count()
end if
currentChildren = feedContentNode.getChildren(-1, 0)
currentChildrenMap = {}
for i = 0 to currentChildCount - 1
playlistId = currentChildren[i].playlistId
if StringUtils.IsNullOrEmpty(playlistId)
continue for
end if
currentChildrenMap[playlistId] = true
end for
nodesToAdd = []
for i = 0 to itemNodes.Count() - 1
itemNode = itemNodes[i]
playlistId = itemNode.playlistId
if StringUtils.IsNullOrEmpty(playlistId)
continue for
end if
if currentChildrenMap[playlistId] = true
continue for
end if
currentChildrenMap[playlistId] = true
nodesToAdd.Push(itemNode)
end for
if nodesToAdd.Count() = 0
return 0
end if
feedContentNode.appendChildren(nodesToAdd)
return nodesToAdd.Count()
end function
function HandleFeedLoadErrorDialog(error as object, isCancelled as boolean, rowList as object) as void
error = ErrorUtils.Format(error)
LogError(error)
rowList.onError = error
if rowList.hasField("dispose") and rowList.dispose
return
end if
if isCancelled
return
end if
DialogUtils.ShowDialogEx({
message: error
title: "Failed to load feed"
@@ -1,12 +1,74 @@
import "pkg:/components/Services/Innertube/InnertubeService.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/source/utils/MessagePortUtils.bs"
@asynctask
function MarkVideoWatchedTask(input as object) as object
videoId = input.videoId
invidiousNode = input.invidious
authToken = input.authToken
profileType = input.profileType
cancellation = m.top.cancellation
service = new Invidious.InvidiousService(invidiousNode)
service.MarkVideoWatched(videoId)
if profileType = "invidious"
service = new Invidious.InvidiousService(invidiousNode)
service.MarkVideoWatched(videoId, cancellation)
return invalid
end if
if profileType <> "youtube"
LogError("MarkVideoWatchedTask: Unsupported profile type:", profileType)
return invalid
end if
playbackTrackingUrls = InnertubeService.AuthGetPlaybackTrackingUrls(videoId, {
accessToken: authToken.token
cancellation: cancellation
})
if playbackTrackingUrls.error <> invalid
LogError("MarkVideoWatchedTask: Failed to get playback tracking URLs:", playbackTrackingUrls.error)
return invalid
end if
if StringUtils.IsNullOrEmpty(playbackTrackingUrls.videostatsPlaybackUrl)
LogError("MarkVideoWatchedTask: videostatsPlaybackUrl is empty")
return invalid
end if
markedAsWatched = InnertubeService.AuthMarkVideoWatched(playbackTrackingUrls.videostatsPlaybackUrl, {
accessToken: authToken.token
cancellation: cancellation
})
if not markedAsWatched
return invalid
end if
if StringUtils.IsNullOrEmpty(playbackTrackingUrls.videostatsWatchtimeUrl)
LogError("MarkVideoWatchedTask: videostatsWatchtimeUrl is empty")
return invalid
end if
if CancellationUtils.IsCancelled(cancellation)
return invalid
end if
port = CreateObject("roMessagePort")
MessagePortUtils.ObserveFieldScopedExSafe(m.top, "watchTime", port)
CancellationUtils.ObserveCancellationScoped(cancellation, port)
while true
message = wait(60000, port)
if CancellationUtils.IsCancellationEvent(cancellation, message)
return invalid
end if
if message = invalid
continue while
end if
watchTime = message.getData()
InnertubeService.AuthMarkVideoWatchTime(watchTime, playbackTrackingUrls.videostatsWatchtimeUrl, {
accessToken: authToken.token
cancellation: cancellation
})
end while
return invalid
end function
@@ -140,7 +140,6 @@ namespace SponsorBlock
m.top.trickPlayBar.filledBarBlendColor = "#FF000080"
end if
m.top.UnobserveFieldScoped("position")
m.top.ObserveFieldScoped("position", FuncName(OnPositionChangeSkipSponsorBlockSections))
end function
@@ -20,7 +20,7 @@ function VideoContentTask(input as object) as object
service = new Invidious.InvidiousService(invidiousNode)
backend = preferencesNode["playback.backend"]
backend = preferencesNode["backend.selected"]
if backend = "playlet"
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
"cancellation": m.top.cancellation
@@ -31,6 +31,13 @@ function VideoContentTask(input as object) as object
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
end if
if metadata = invalid
return {
success: false
error: "Failed to get video metadata"
}
end if
if m.top.cancel
return invalid
end if
@@ -21,6 +21,7 @@ function Init()
m.fullScreenHintTimer.ObserveField("fire", FuncName(OnFullScreenHintTimer))
m.trickplayUITimer = m.top.findNode("trickplayUITimer")
m.trickplayUITimer.ObserveField("fire", FuncName(OnTrickplayUITimer))
m.top.notificationInterval = 1
' videoPlayingSuccess indicates if we started playing a video successfully
' We use it to detect if we should try another link for a video, or if another error
@@ -126,6 +127,8 @@ function PlayWithContent(contentNode as object)
end if
if ValidInt(contentNode.timestamp) <> -1
videoContentNode.AddFields({ timestamp: contentNode.timestamp })
else if contentNode.percentDurationWatched > 0 and contentNode.percentDurationWatched < 100
videoContentNode.AddFields({ percentDurationWatched: contentNode.percentDurationWatched })
end if
if not StringUtils.IsNullOrEmpty(contentNode.title)
videoContentNode.title = contentNode.title
@@ -144,8 +147,6 @@ function StartVideoContentTask(videoContentNode as object)
m.videoContentTask.cancel = true
end if
MarkVideoWatched(videoContentNode.videoId)
m.top.content = videoContentNode
m.videoContentTask = AsyncTask.Start(Tasks.VideoContentTask, {
@@ -194,22 +195,25 @@ function OnVideoContentTaskResults(output as object) as void
SponsorBlock.FetchSponsorBlock(content.metadata)
timestamp = content.timestamp
percentDurationWatched = content.percentDurationWatched
hasTimestamp = IsInt(timestamp)
hasPercentDurationWatched = IsFloat(percentDurationWatched)
if IsLiveVideo() and not hasTimestamp
duration = m.top.duration
if duration > 0
SeekToEndOfStream()
else
m.top.ObserveField("duration", FuncName(SeekToEndOfStream))
if IsLiveVideo() and not hasTimestamp and not hasPercentDurationWatched
' If live, seek to end of stream
m.seekToPercent = 100.0
SeekToPercentOfDuration()
else
if hasTimestamp and timestamp > 0
m.top.seek = content.timestamp
else if hasPercentDurationWatched
m.seekToPercent = percentDurationWatched
SeekToPercentOfDuration()
end if
end if
PlayAfterPreviousPlayerHasStopped()
if hasTimestamp and timestamp > 0
m.top.seek = content.timestamp
end if
MarkVideoWatched(content.videoId)
end function
function PlayAfterPreviousPlayerHasStopped() as void
@@ -272,12 +276,48 @@ function MarkVideoWatched(videoId as dynamic) as void
return
end if
if m.top.invidious.authToken <> invalid
AsyncTask.Start(Tasks.MarkVideoWatchedTask, {
videoId: videoId
invidious: m.top.invidious
})
invidious = m.top.invidious
authToken = invidious.authToken
if authToken = invalid
return
end if
if m.markVideoWatchedTask <> invalid
m.markVideoWatchedTask.cancel = true
end if
profileType = authToken.profileNode.type
m.markVideoWatchedTask = AsyncTask.Create(Tasks.MarkVideoWatchedTask, {
videoId: videoId
invidious: invidious
authToken: authToken
profileType: profileType
})
m.markVideoWatchedTask.addField("watchTime", "float", false)
m.markVideoWatchedTask.control = "RUN"
if profileType <> "youtube"
return
end if
' Progress reported to Innertube. It is the position in seconds,
' with 20 second steps.
m.watchTimeMarker = -1
m.top.ObserveFieldScoped("position", FuncName(OnPositionChangeMarkWatchTime))
end function
function OnPositionChangeMarkWatchTime() as void
if m.markVideoWatchedTask = invalid
return
end if
currentPosition = m.top.position
currentWatchTimeMarker = m.watchTimeMarker
m.watchTimeMarker = (currentPosition \ 20) * 20
if currentWatchTimeMarker = currentPosition
return
end if
m.markVideoWatchedTask.watchTime = m.watchTimeMarker
end function
function OnClose()
@@ -285,6 +325,10 @@ function OnClose()
m.top.previousPlayer = invalid
if m.markVideoWatchedTask <> invalid
m.markVideoWatchedTask.cancel = true
m.markVideoWatchedTask = invalid
end if
if m.videoContentTask <> invalid
m.videoContentTask.cancel = true
m.videoContentTask = invalid
@@ -408,13 +452,43 @@ function OnVideoPlayerStateChange() as void
end if
end function
function SeekToEndOfStream()
function SeekToEndOfStream() as void
m.top.UnobserveField("duration")
duration = m.top.duration
' If the stream is less than 30 seconds, it's not worth seeking to the end
if duration > 30
LogInfo("Seeking to end of live stream", duration)
m.top.seek = duration
' If the stream is less than 30 seconds, it's not worth seeking
if duration < 30
return
end if
LogInfo("Seeking to end of live stream", duration)
m.top.seek = duration
end function
function SeekToPercentOfDuration() as void
m.top.UnobserveField("duration")
seekToPercent = m.seekToPercent
if seekToPercent = invalid
return
end if
duration = m.top.duration
if duration = 0
' If the duration is not available, wait for it to be set
m.top.ObserveField("duration", FuncName(SeekToPercentOfDuration))
return
end if
' If the stream is less than 30 seconds, it's not worth seeking
if duration < 30
return
end if
m.seekToPercent = invalid
seek = (MathUtils.Clamp(seekToPercent, 0, 100) / 100.0) * duration
if seek > 0
LogInfo("Seeking to percent duration watched", seek)
m.top.seek = seek
end if
end function
@@ -25,7 +25,7 @@ function VideoContentTaskDev(input as object) as object
backgroundPoster.uri = `${instance}/vi/${videoId}/maxresdefault.jpg`
backend = preferencesNode["playback.backend"]
backend = preferencesNode["backend.selected"]
if backend = "playlet"
metadata = InnertubeService.GetVideoMetadata(videoId, { cancellation: m.top.cancellation })
else
@@ -16,7 +16,7 @@ function VideoQueueViewContentTask(input as object) as object
index = MathUtils.Clamp(input.index - 2, 0, videoNodes.Count() - 1)
backend = preferencesNode["playback.backend"]
backend = preferencesNode["backend.selected"]
requestOptions = {
cacheSeconds: 8640000 ' 100 days
@@ -9,6 +9,7 @@ namespace Http
function new(server as object)
super()
m.server = server
task = server.task
m.profilesNode = task.profilesService
m.invidiousNode = task.invidious
@@ -72,12 +73,15 @@ namespace Http
return true
end if
additionalQueryParams = invalid
options = {
httpServer: m.server
}
if feedSource.state <> invalid and feedSource.state.queryParams <> invalid
additionalQueryParams = feedSource.state.queryParams
options.additionalQueryParams = feedSource.state.queryParams
end if
invResponse = m.invidiousService.MakeRequest(feedSource, additionalQueryParams)
invResponse = m.invidiousService.MakeRequest(feedSource, options)
if not invResponse.success
response.Default(500, `Failed to make request: ${invResponse.error}`)
return true
@@ -16,7 +16,7 @@ namespace Http
response = context.response
response.Json({
"error": "Playlet built-in Invidious backend is not a real Invidious instance, and does not support accounts."
"error": "Playlet built-in Invidious backend is not a real Invidious instance, and does not support accounts. Please use the login with YouTube option instead."
})
response.http_code = 400
return true
@@ -71,27 +71,35 @@ namespace Http
options.continuation = continuation
end if
feeds = InnertubeService.GetSubscriptions(options)
if feeds = invalid
response.Json({
"error": "Failed to get auth feed"
})
result = InnertubeService.GetSubscriptions(options)
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
result = {
"videos": []
if not IsArray(result.feeds) or result.feeds.Count() = 0
' Not an error, just no subscriptions
response.Json({
"videos": []
})
return true
end if
responseBody = {
"videos": ValidArray(result.feeds[0].items)
}
if result.feeds[0].DoesExist("continuation")
responseBody.continuation = result.feeds[0].continuation
end if
response.Json(responseBody)
if feeds.Count() > 0
result["videos"] = ValidArray(feeds[0].items)
if feeds[0].DoesExist("continuation")
result["continuation"] = feeds[0].continuation
end if
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
response.Json(result)
return true
end function
@@ -135,8 +143,14 @@ namespace Http
options.continuation = continuation
end if
feeds = InnertubeService.GetPlaylists(options)
if feeds = invalid
result = InnertubeService.GetPlaylists(options)
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if not IsArray(result.feeds) or result.feeds.Count() = 0
response.Json({
"error": "Failed to get auth playlists"
})
@@ -144,14 +158,12 @@ namespace Http
return true
end if
if feeds.Count() > 0
response.Json(feeds[0])
return true
response.Json(result.feeds[0])
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
response.Json({
"items": []
})
return true
end function
@@ -172,28 +184,41 @@ namespace Http
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
}
continuation = request.query.continuation
if not StringUtils.IsNullOrEmpty(continuation)
hasContinuation = not StringUtils.IsNullOrEmpty(continuation)
if hasContinuation
options.continuation = continuation
end if
feeds = InnertubeService.GetWatchHistory(options)
if feeds = invalid
response.Json({
"error": "Failed to get auth history"
})
if not hasContinuation
page = ValidString(request.query.page).ToInt()
if page > 1
LogError("Playlet backend does not use history pagination (use continuation instead)")
response.Json({
"items": []
})
return true
end if
end if
result = InnertubeService.GetWatchHistory(options)
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if feeds.Count() > 0
response.Json(feeds[0])
if not IsArray(result.feeds) or result.feeds.Count() = 0
' Not an error, just no history
response.Json({
"items": []
})
return true
end if
response.Json({
"items": []
})
response.Json(result.feeds[0])
return true
end function
@@ -214,6 +239,11 @@ namespace Http
request = context.request
response = context.response
isRecommended = request.query.recommended = "true"
if isRecommended
return m.GetAuthRecommended(context)
end if
raw = request.query.raw <> invalid
options = {
@@ -242,6 +272,53 @@ namespace Http
end if
response.Json(ValidArray(result.feeds[0].items))
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
return true
end function
function GetAuthRecommended(context as object) as boolean
request = context.request
response = context.response
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
}
continuation = request.query.continuation
if not StringUtils.IsNullOrEmpty(continuation)
options.continuation = continuation
end if
result = InnertubeService.GetHome(options)
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if not IsArray(result.feeds) or result.feeds.Count() = 0
' Not an error, just no recommended videos, usually when there's no history
response.Json({
"items": []
})
return true
end if
response.Json(result.feeds[0])
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
@@ -316,20 +393,21 @@ namespace Http
end if
result = InnertubeService.Search(query, options)
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if raw
response.Json(result)
return true
end if
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if not IsArray(result.feeds) or result.feeds.Count() = 0
response.Json({
"error": "Failed to search"
"error": "Failed to search: no results found"
})
response.http_code = 500
return true
@@ -434,6 +512,8 @@ namespace Http
return m.GetVideo(context)
else if route.StartsWith("/playlet-invidious-backend/api/v1/playlists/")
return m.GetPlaylist(context)
else if route.StartsWith("/playlet-invidious-backend/api/v1/auth/playlists/")
return m.GetAuthPlaylist(context)
else if route.StartsWith("/playlet-invidious-backend/api/v1/channels/")
return m.GetChannel(context)
else if route.StartsWith("/playlet-invidious-backend/channel")
@@ -443,6 +523,18 @@ namespace Http
return false
end function
@post("*")
function PostAll(context as object) as boolean
request = context.request
route = request.route
if route.StartsWith("/playlet-invidious-backend/api/v1/auth/subscriptions/")
return m.SubscribeToChannel(context)
end if
return false
end function
function GetVideo(context as object) as boolean
request = context.request
response = context.response
@@ -474,9 +566,12 @@ namespace Http
response = context.response
route = request.route
playlistId = route.Mid("/playlet-invidious-backend/api/v1/playlists/".Len())
if playlistId.InStr("?") > 0
playlistId = playlistId.Left(playlistId.InStr("?"))
playlistId = context.playlistId
if StringUtils.IsNullOrEmpty(playlistId)
playlistId = route.Mid("/playlet-invidious-backend/api/v1/playlists/".Len())
if playlistId.InStr("?") > 0
playlistId = playlistId.Left(playlistId.InStr("?"))
end if
end if
continuation = request.query.continuation
raw = request.query.raw <> invalid
@@ -485,6 +580,11 @@ namespace Http
raw: raw
}
accessToken = request.headers["authorization"]
if not StringUtils.IsNullOrEmpty(accessToken) and accessToken.StartsWith("Bearer ")
options["accessToken"] = accessToken.Mid("Bearer ".Len())
end if
if playlistId.StartsWith("RD")
if not StringUtils.IsNullOrEmpty(continuation)
options.videoId = continuation
@@ -528,6 +628,29 @@ namespace Http
return true
end function
function GetAuthPlaylist(context as object) as boolean
request = context.request
response = context.response
route = request.route
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
return true
end if
playlistId = route.Mid("/playlet-invidious-backend/api/v1/auth/playlists/".Len())
if playlistId.InStr("?") > 0
playlistId = playlistId.Left(playlistId.InStr("?"))
end if
context.playlistId = playlistId
return m.GetPlaylist(context)
end function
function GetChannel(context as object) as boolean
request = context.request
response = context.response
@@ -621,6 +744,104 @@ namespace Http
return false
end function
function SubscribeToChannel(context as object) as boolean
request = context.request
response = context.response
route = request.route
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
return true
end if
channelId = route.Mid("/playlet-invidious-backend/api/v1/auth/subscriptions/".Len())
if channelId.InStr("?") > 0
channelId = channelId.Left(channelId.InStr("?"))
end if
if StringUtils.IsNullOrEmpty(channelId)
response.Json({
"error": "Missing 'channelId' path parameter"
})
response.http_code = 400
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
}
result = InnertubeService.SubscribeToChannel(channelId, options)
if result.success <> true
response.Json(result)
response.http_code = 500
return true
end if
response.Default(204, "OK")
return true
end function
@delete("*")
function DeleteAll(context as object) as boolean
request = context.request
route = request.route
if route.StartsWith("/playlet-invidious-backend/api/v1/auth/subscriptions/")
return m.UnsubscribeFromChannel(context)
end if
return false
end function
function UnsubscribeFromChannel(context as object) as boolean
request = context.request
response = context.response
route = request.route
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
return true
end if
channelId = route.Mid("/playlet-invidious-backend/api/v1/auth/subscriptions/".Len())
if channelId.InStr("?") > 0
channelId = channelId.Left(channelId.InStr("?"))
end if
if StringUtils.IsNullOrEmpty(channelId)
response.Json({
"error": "Missing 'channelId' path parameter"
})
response.http_code = 400
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
}
result = InnertubeService.UnsubscribeFromChannel(channelId, options)
if result.success <> true
response.Json(result)
response.http_code = 500
return true
end if
response.Default(204, "OK")
return true
end function
@get("/playlet-invidious-backend/watch")
function RedirectWatch(context as object) as boolean
request = context.request
@@ -55,7 +55,12 @@ namespace Http
end if
if keysDict["device"] = true
state["device"] = m.applicationInfoNode@.GetDeviceInfo()
deviceInfo = m.applicationInfoNode@.GetDeviceInfo()
' We do not currently have translations for en_CA
if deviceInfo.current_locale = "en_CA"
deviceInfo.current_locale = "en_US"
end if
state["device"] = deviceInfo
end if
if keysDict["invidious"] = true
@@ -44,6 +44,12 @@ namespace Http
return true
end if
if IsString(payload.timestamp)
payload.timestamp = payload.timestamp.toInt()
else if IsString(payload.percentDurationWatched)
payload.percentDurationWatched = payload.percentDurationWatched.toFloat()
end if
instance = m.invidiousService.GetInstance()
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
@@ -79,6 +85,8 @@ namespace Http
if IsString(payload.timestamp)
payload.timestamp = payload.timestamp.toInt()
else if IsString(payload.percentDurationWatched)
payload.percentDurationWatched = payload.percentDurationWatched.toFloat()
end if
instance = m.invidiousService.GetInstance()
@@ -36,7 +36,10 @@ function GetServerAddress(_unused as dynamic) as dynamic
end function
function SetupRoutes(server as object)
server.UseRouter(new Http.CorsMiddleware())
#if DEBUG
'CORS is mostly for developing the web app
server.UseRouter(new Http.CorsMiddleware())
#end if
if server.settings.WebSocketsEnabled
server.UseRouter(new Http.WebSocketMiddleware())
end if
@@ -34,6 +34,15 @@ namespace Http
m.headers = CreateObject("roAssociativeArray")
end function
function FromParsedData(method as string, uri as string, headers as object, body as string)
m.method = method
m.uri = uri
m.ProcessOperation()
m.headers = headers
m.body = body
m.state = Http.HttpRequestState.DONE
end function
function Add(incoming as string, maybeUnicode as boolean)
if IsString(m.buffer)
m.buffer = m.buffer + incoming
@@ -20,7 +20,7 @@ namespace Http
m.routes = []
end function
private function OnRequest(request as object, response as HttpResponse, connection as HttpConnection) as boolean
function OnRequest(request as object, response as HttpResponse, connection as HttpConnection) as boolean
for each route in m.routes
if m.RouteMatchesRequest(route, request)
try
@@ -195,6 +195,22 @@ namespace Http
stats = stats + " Bytes" + Stri(m.total_in) + " in," + Stri(m.total_out) + " out"
return stats
end function
function ProcessRequestLocal(method as string, uri as string, headers as object, body as string) as object
LogInfo(`Processing request locally ${method} ${uri}`)
request = new HttpRequest()
request.FromParsedData(method, uri, headers, body)
response = new HttpResponse(request, m, m.settings)
response.Process({})
return {
http_code: response.http_code
headers: response.headers
body: response.body_buffer
}
end function
end class
end namespace
@@ -6,6 +6,14 @@
apiType: Invidious
endpoint: auth_feed
- title: Recommended
id: recommended
feedSources:
- id: inv_auth_recommended
title: Recommended
apiType: Invidious
endpoint: auth_recommended
- title: Trending
id: trending
feedSources:
@@ -187,3 +187,16 @@ watch_history:
authenticated: true
paginationType: Pages
responseHandler: WatchHistoryHandler
# Recommended is not a thing for Invidious, but we can use
# /api/v1/popular?recommended=true and handle it in Playlet
# backend. Invidious will just ignore the query param.
auth_recommended:
title: Recommended
url: /api/v1/popular
authenticated: true
paginationType: Continuation
queryParams:
recommended:
type: boolean
default: true
+18 -7
View File
@@ -27,21 +27,28 @@
visibility: "web",
svelteComponent: "EditQualityControl",
},
],
},
{
displayText: "Backend",
key: "backend",
description: "Backend preferences",
children: [
{
displayText: "Backend",
key: "playback.backend",
description: "The backend used for fetching video data. The Playlet backend is experimental",
displayText: "Selected backend",
key: "backend.selected",
description: "The backend used for browsing and playing videos.",
type: "radio",
defaultValue: "playlet",
options: [
{
displayText: "Invidious",
value: "invidious",
},
{
displayText: "Playlet (local)",
value: "playlet",
},
{
displayText: "Invidious",
value: "invidious",
},
],
},
],
@@ -152,6 +159,10 @@
id: "subscriptions",
enabled: true,
},
{
id: "recommended",
enabled: true,
},
{
id: "trending",
enabled: true,
+5 -1
View File
@@ -1266,7 +1266,7 @@
</message>
<message>
<source>Buffering</source>
<translation type="unfinished">Puffert</translation>
<translation>Pufferung</translation>
</message>
<message>
<source>Do not show again</source>
@@ -1280,5 +1280,9 @@
<source>Playlet built-in backend</source>
<translation>Playlet eingebautes Backend</translation>
</message>
<message>
<source>Recommended</source>
<translation>Empfohlen</translation>
</message>
</context>
</TS>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_CA" sourcelanguage="en_US">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>default</name>
</context>
</TS>
@@ -76,6 +76,10 @@
<source>Subscriptions</source>
<translation>Subscriptions</translation>
</message>
<message>
<source>Recommended</source>
<translation>Recommended</translation>
</message>
<message>
<source>Playlists</source>
<translation>Playlists</translation>
@@ -748,6 +752,22 @@
<source>Auto</source>
<translation>Auto</translation>
</message>
<message>
<source>Backend</source>
<translation>Backend</translation>
</message>
<message>
<source>Backend preferences</source>
<translation>Backend preferences</translation>
</message>
<message>
<source>Selected backend</source>
<translation>Selected backend</translation>
</message>
<message>
<source>The backend used for browsing and playing videos.</source>
<translation>The backend used for browsing and playing videos.</translation>
</message>
<message>
<source>Invidious preferences</source>
<translation>Invidious preferences</translation>
@@ -1268,5 +1268,17 @@
<source>Add to %1 bookmark</source>
<translation>Adicionar %1 ao marcadores</translation>
</message>
<message>
<source>Courses</source>
<translation>Cursos</translation>
</message>
<message>
<source>Playlet built-in backend</source>
<translation>Back-end integrado do playlet</translation>
</message>
<message>
<source>Do not show again</source>
<translation>Não mostrar novamente</translation>
</message>
</context>
</TS>
+3 -3
View File
@@ -2,8 +2,8 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=36
build_version=00003
minor_version=38
build_version=00002
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
@@ -13,4 +13,4 @@ hidden=1
git_commit_sha=unknown
bs_const=DEBUG=false;YT_OAUTH_SUPPORT=false
bs_const=DEBUG=false
+38 -14
View File
@@ -149,6 +149,10 @@ namespace HttpClient
return m
end function
function GetMethod() as string
return m._method
end function
function Url(url as string) as HttpRequest
m._url = url
return m
@@ -221,11 +225,22 @@ namespace HttpClient
return m
end function
function GetHeaders() as object
if m._headers = invalid
m._headers = {}
end if
return m._headers
end function
function Body(body as dynamic) as HttpRequest
m._body = ValidString(body)
return m
end function
function GetBody() as dynamic
return m._body
end function
function Json(body as object) as HttpRequest
m.Body(FormatJson(body))
m.Header("Content-Type", "application/json")
@@ -279,6 +294,11 @@ namespace HttpClient
return m
end function
function LogCurlCommand() as HttpRequest
m._logCurlCommand = true
return m
end function
function ToCurlCommand() as string
command = `curl "${m.BuildUrl()}"`
if m._method = "HEAD"
@@ -301,7 +321,15 @@ namespace HttpClient
if m._headers <> invalid
for each key in m._headers
command += ` \\\n -H '${key}: ${m._headers[key]}'`
#if DEBUG
command += ` \\\n -H '${key}: ${m._headers[key]}'`
#else
if LCase(key) = "authorization"
command += ` \\\n -H '${key}: <REDACTED>'`
else
command += ` \\\n -H '${key}: ${m._headers[key]}'`
end if
#end if
end for
end if
@@ -350,9 +378,13 @@ namespace HttpClient
LogInfo("Sending", m._method, m.urlTransfer.GetURL(), "ID:", m.urlTransfer.GetIdentity())
#if DEBUG
? `════════ curl command ════════\n${m.ToCurlCommand()}\n══════════════════════════════`
m._logCurlCommand = true
#end if
if m._logCurlCommand = true
LogInfo(`======== curl command ========\n${m.ToCurlCommand()}\n==============================`)
end if
if m._method = "POST"
body = m._body
if body = invalid
@@ -603,6 +635,10 @@ namespace HttpClient
m._json = json
end function
function OverrideHeaders(headers as object)
m._headers = headers
end function
function OverrideErrorMessage(errorMessage as string)
m._errorMessage = errorMessage
end function
@@ -652,18 +688,6 @@ namespace HttpClient
return invalid
end if
m._json = ParseJson(text)
' TODO:P2 remove workaround (fix landed, but remove after March 2025 as a precaution)
if m._json = invalid and m.IsSuccess() and not m._json_workaround_tried = true
' A bug was introduced in Roku OS 14.1 that causes ParseJson to return invalid parsing some unicode characters.
' So we filter out \uXXXX characters and try to parse again.
' These characters are mostly emojis, and can't render anyway.
' Update: a fix has landed in 14.1 (tested on 14.1.4.7709)
m._json_workaround_tried = true
filter = /\\u[0-9a-fA-F]{4}/
text = filter.ReplaceAll(text, "")
m._json = ParseJson(text)
LogWarn("Failed to parse JSON. Workaround applied. Success:", m._json <> invalid)
end if
return m._json
end function
+8 -1
View File
@@ -14,8 +14,15 @@ namespace ErrorUtils
result = `${error.message} (0x${StrI(error.number, 16)}). backtrace:`
for i = error.backtrace.count() - 1 to 0 step -1
backtrace = error.backtrace[i]
result += `\n ${backtrace.function} @${backtrace.filename}:${backtrace.line_number}\n`
result += `\n ${backtrace.function} @${backtrace.filename}:${backtrace.line_number}`
end for
#if DEBUG
' make paths start with pkg:/ so that they can be source mapped
' to the original source files
result = result.replace("playletlib:/", "pkg:/")
#end if
return result
end if
+6
View File
@@ -38,6 +38,7 @@ namespace Locale
@locale
enum Feed
Subscriptions = "Subscriptions"
Recommended = "Recommended"
Playlists = "Playlists"
WatchHistory = "Watch history"
Trending = "Trending"
@@ -244,6 +245,11 @@ namespace Locale
PreferredQualityDescription = "Preferred video quality"
AutoQuality = "Auto"
Backend = "Backend"
BackendPreferences = "Backend preferences"
SelectedBackend = "Selected backend"
SelectedBackendDescription = "The backend used for browsing and playing 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"
@@ -1,6 +1,6 @@
namespace MessagePortUtils
function ObserveFieldScopedExSafe(node as dynamic, field as string, port as dynamic)
function ObserveFieldScopedExSafe(node as dynamic, field as string, port as dynamic) as void
' ObserveFieldScopedEx was added in 12.0
if FindMemberFunction(node, "ObserveFieldScopedEx") <> invalid
' bs:disable-next-line NO_OBSERVE_FIELD_SCOPED_EX
@@ -0,0 +1,25 @@
namespace OptionUtils
function Get(opts as object, key as string, passthroughFunction = invalid as dynamic) as dynamic
if opts = invalid
if passthroughFunction = invalid
return invalid
end if
return passthroughFunction(invalid)
end if
value = opts[key]
if value = invalid
if passthroughFunction = invalid
return invalid
end if
return passthroughFunction(invalid)
end if
if passthroughFunction <> invalid
return passthroughFunction(value)
end if
return value
end function
end namespace
+24
View File
@@ -246,4 +246,28 @@ namespace UrlUtils
}
end function
function BuildUrlFromParts(parts as object) as string
url = ""
if not StringUtils.IsNullOrEmpty(parts.protocol)
url += parts.protocol + "://"
end if
if not StringUtils.IsNullOrEmpty(parts.host)
url += parts.host
end if
if (not StringUtils.IsNullOrEmpty(parts.port)) and ((parts.protocol = "http" and parts.port <> "80") or (parts.protocol = "https" and parts.port <> "443") or (parts.protocol <> "http" and parts.protocol <> "https"))
url += ":" + parts.port
end if
if not StringUtils.IsNullOrEmpty(parts.path)
if not parts.path.StartsWith("/")
url += "/"
end if
url += parts.path
end if
return url
end function
end namespace
+404 -113
View File
@@ -1,30 +1,30 @@
{
"name": "playlet-web",
"version": "0.36.3",
"version": "0.38.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.36.3",
"version": "0.38.2",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/typography": "^0.5.16",
"@tsconfig/svelte": "^5.0.4",
"@vitejs/plugin-legacy": "^6.0.2",
"@vitejs/plugin-legacy": "^6.1.1",
"autoprefixer": "^10.4.21",
"daisyui": "^4.12.23",
"dotenv": "^16.4.7",
"dotenv": "^16.5.0",
"ip": "^2.0.1",
"postcss": "^8.5.3",
"svelte": "^5.25.3",
"svelte-check": "^4.1.5",
"svelte": "^5.30.1",
"svelte-check": "^4.2.1",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^3.4.17",
"terser": "^5.39.0",
"terser": "^5.39.2",
"tslib": "^2.8.1",
"typescript": "^5.8.2",
"vite": "^6.2.3",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vite-plugin-compression": "^0.5.1",
"vite-tsconfig-paths": "^5.1.4"
}
@@ -79,22 +79,22 @@
}
},
"node_modules/@babel/core": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.9.tgz",
"integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==",
"version": "7.26.10",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz",
"integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.26.2",
"@babel/generator": "^7.26.9",
"@babel/generator": "^7.26.10",
"@babel/helper-compilation-targets": "^7.26.5",
"@babel/helper-module-transforms": "^7.26.0",
"@babel/helpers": "^7.26.9",
"@babel/parser": "^7.26.9",
"@babel/helpers": "^7.26.10",
"@babel/parser": "^7.26.10",
"@babel/template": "^7.26.9",
"@babel/traverse": "^7.26.9",
"@babel/types": "^7.26.9",
"@babel/traverse": "^7.26.10",
"@babel/types": "^7.26.10",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@@ -110,14 +110,14 @@
}
},
"node_modules/@babel/generator": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz",
"integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==",
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz",
"integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.26.9",
"@babel/types": "^7.26.9",
"@babel/parser": "^7.27.0",
"@babel/types": "^7.27.0",
"@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.25",
"jsesc": "^3.0.2"
@@ -374,27 +374,27 @@
}
},
"node_modules/@babel/helpers": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz",
"integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==",
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz",
"integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/template": "^7.26.9",
"@babel/types": "^7.26.9"
"@babel/template": "^7.27.0",
"@babel/types": "^7.27.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/parser": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz",
"integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==",
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz",
"integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.26.9"
"@babel/types": "^7.27.0"
},
"bin": {
"parser": "bin/babel-parser.js"
@@ -1499,32 +1499,32 @@
}
},
"node_modules/@babel/template": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz",
"integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==",
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz",
"integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.26.2",
"@babel/parser": "^7.26.9",
"@babel/types": "^7.26.9"
"@babel/parser": "^7.27.0",
"@babel/types": "^7.27.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz",
"integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==",
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz",
"integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.26.2",
"@babel/generator": "^7.26.9",
"@babel/parser": "^7.26.9",
"@babel/template": "^7.26.9",
"@babel/types": "^7.26.9",
"@babel/generator": "^7.27.0",
"@babel/parser": "^7.27.0",
"@babel/template": "^7.27.0",
"@babel/types": "^7.27.0",
"debug": "^4.3.1",
"globals": "^11.1.0"
},
@@ -1533,9 +1533,9 @@
}
},
"node_modules/@babel/types": {
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz",
"integrity": "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==",
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz",
"integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2091,19 +2091,286 @@
"node": ">=14"
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz",
"integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz",
"integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz",
"integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.30.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.30.1.tgz",
"integrity": "sha512-x78BavIwSH6sqfP2xeI1hd1GpHL8J4W2BXcVM/5KYKoAD3nNsfitQhvWSw+TFtQTLZ9OmlF+FEInEHyubut2OA==",
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz",
"integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@rollup/rollup-freebsd-arm64": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz",
"integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
]
},
"node_modules/@rollup/rollup-freebsd-x64": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz",
"integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz",
"integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz",
"integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz",
"integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz",
"integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-loongarch64-gnu": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz",
"integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==",
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz",
"integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz",
"integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-riscv64-musl": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz",
"integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz",
"integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==",
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz",
"integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz",
"integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz",
"integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz",
"integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz",
"integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@sveltejs/acorn-typescript": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz",
@@ -2174,23 +2441,24 @@
"dev": true
},
"node_modules/@types/estree": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
"integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
"dev": true
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
"integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
"dev": true,
"license": "MIT"
},
"node_modules/@vitejs/plugin-legacy": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-6.0.2.tgz",
"integrity": "sha512-b/a6ARuJ1yCoIH/lSjpwPMyqo3NSCoqyxYtff7VCC6cnJfvBTzd7PthcrbomhLZnMsp/eW41b6TrbNSQvHW2lA==",
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-6.1.1.tgz",
"integrity": "sha512-BvusL+mYZ0q5qS5Rq3D70QxZBmhyiHRaXLtYJHH5AEsAmdSqJR4xe5KwMi1H3w8/9lVJwhkLYqFQ9vmWYWy6kA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/core": "^7.26.9",
"@babel/core": "^7.26.10",
"@babel/preset-env": "^7.26.9",
"browserslist": "^4.24.4",
"browserslist-to-esbuild": "^2.1.1",
"core-js": "^3.40.0",
"core-js": "^3.41.0",
"magic-string": "^0.30.17",
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.15.1"
@@ -2579,11 +2847,12 @@
"dev": true
},
"node_modules/core-js": {
"version": "3.40.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.40.0.tgz",
"integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==",
"version": "3.41.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.41.0.tgz",
"integrity": "sha512-SJ4/EHwS36QMJd6h/Rg+GyR4A5xE0FSI3eZ+iBVpfqf1x0eTSg1smWLHrA+2jQThZSh97fmSgFSU8B61nxosxA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
@@ -2706,10 +2975,11 @@
"dev": true
},
"node_modules/dotenv": {
"version": "16.4.7",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz",
"integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
@@ -2792,9 +3062,9 @@
"dev": true
},
"node_modules/esrap": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.3.tgz",
"integrity": "sha512-Xddc1RsoFJ4z9nR7W7BFaEPIp4UXoeQ0+077UdWLxbafMQFyU79sQJMk7kxNgRwQ9/aVgaKacCHC2pUACGwmYw==",
"version": "1.4.6",
"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.6.tgz",
"integrity": "sha512-F/D2mADJ9SHY3IwksD4DAXjTt7qt7GWUf3/8RhCNWmC/67tyb55dpimHmy7EplakFaflV0R/PC+fdSPqrRHAQw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2855,10 +3125,11 @@
}
},
"node_modules/fdir": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz",
"integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==",
"version": "6.4.4",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz",
"integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"picomatch": "^3 || ^4"
},
@@ -3469,8 +3740,6 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
"dev": true,
"optional": true,
"peer": true,
"engines": {
"node": ">=12"
},
@@ -3814,12 +4083,13 @@
}
},
"node_modules/rollup": {
"version": "4.30.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.30.1.tgz",
"integrity": "sha512-mlJ4glW020fPuLi7DkM/lN97mYEZGWeqBnrljzN0gs7GLctqX3lNWxKQ7Gl712UAX+6fog/L3jh4gb7R6aVi3w==",
"version": "4.40.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz",
"integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "1.0.6"
"@types/estree": "1.0.7"
},
"bin": {
"rollup": "dist/bin/rollup"
@@ -3829,25 +4099,26 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.30.1",
"@rollup/rollup-android-arm64": "4.30.1",
"@rollup/rollup-darwin-arm64": "4.30.1",
"@rollup/rollup-darwin-x64": "4.30.1",
"@rollup/rollup-freebsd-arm64": "4.30.1",
"@rollup/rollup-freebsd-x64": "4.30.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.30.1",
"@rollup/rollup-linux-arm-musleabihf": "4.30.1",
"@rollup/rollup-linux-arm64-gnu": "4.30.1",
"@rollup/rollup-linux-arm64-musl": "4.30.1",
"@rollup/rollup-linux-loongarch64-gnu": "4.30.1",
"@rollup/rollup-linux-powerpc64le-gnu": "4.30.1",
"@rollup/rollup-linux-riscv64-gnu": "4.30.1",
"@rollup/rollup-linux-s390x-gnu": "4.30.1",
"@rollup/rollup-linux-x64-gnu": "4.30.1",
"@rollup/rollup-linux-x64-musl": "4.30.1",
"@rollup/rollup-win32-arm64-msvc": "4.30.1",
"@rollup/rollup-win32-ia32-msvc": "4.30.1",
"@rollup/rollup-win32-x64-msvc": "4.30.1",
"@rollup/rollup-android-arm-eabi": "4.40.0",
"@rollup/rollup-android-arm64": "4.40.0",
"@rollup/rollup-darwin-arm64": "4.40.0",
"@rollup/rollup-darwin-x64": "4.40.0",
"@rollup/rollup-freebsd-arm64": "4.40.0",
"@rollup/rollup-freebsd-x64": "4.40.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.40.0",
"@rollup/rollup-linux-arm-musleabihf": "4.40.0",
"@rollup/rollup-linux-arm64-gnu": "4.40.0",
"@rollup/rollup-linux-arm64-musl": "4.40.0",
"@rollup/rollup-linux-loongarch64-gnu": "4.40.0",
"@rollup/rollup-linux-powerpc64le-gnu": "4.40.0",
"@rollup/rollup-linux-riscv64-gnu": "4.40.0",
"@rollup/rollup-linux-riscv64-musl": "4.40.0",
"@rollup/rollup-linux-s390x-gnu": "4.40.0",
"@rollup/rollup-linux-x64-gnu": "4.40.0",
"@rollup/rollup-linux-x64-musl": "4.40.0",
"@rollup/rollup-win32-arm64-msvc": "4.40.0",
"@rollup/rollup-win32-ia32-msvc": "4.40.0",
"@rollup/rollup-win32-x64-msvc": "4.40.0",
"fsevents": "~2.3.2"
}
},
@@ -4100,9 +4371,9 @@
}
},
"node_modules/svelte": {
"version": "5.25.3",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.25.3.tgz",
"integrity": "sha512-J9rcZ/xVJonAoESqVGHHZhrNdVbrCfkdB41BP6eiwHMoFShD9it3yZXApVYMHdGfCshBsZCKsajwJeBbS/M1zg==",
"version": "5.30.1",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.30.1.tgz",
"integrity": "sha512-QIYtKnJGkubWXtNkrUBKVCvyo9gjcccdbnvXfwsGNhvbeNNdQjRDTa/BiQcJ2kWXbXPQbWKyT7CUu53KIj1rfw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4115,7 +4386,7 @@
"axobject-query": "^4.1.0",
"clsx": "^2.1.1",
"esm-env": "^1.2.1",
"esrap": "^1.4.3",
"esrap": "^1.4.6",
"is-reference": "^3.0.3",
"locate-character": "^3.0.0",
"magic-string": "^0.30.11",
@@ -4126,9 +4397,9 @@
}
},
"node_modules/svelte-check": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.1.5.tgz",
"integrity": "sha512-Gb0T2IqBNe1tLB9EB1Qh+LOe+JB8wt2/rNBDGvkxQVvk8vNeAoG+vZgFB/3P5+zC7RWlyBlzm9dVjZFph/maIg==",
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.2.1.tgz",
"integrity": "sha512-e49SU1RStvQhoipkQ/aonDhHnG3qxHSBtNfBRb9pxVXoa+N7qybAo32KgA9wEb2PCYFNaDg7bZCdhLD1vHpdYA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4321,14 +4592,14 @@
}
},
"node_modules/terser": {
"version": "5.39.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz",
"integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==",
"version": "5.39.2",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz",
"integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"@jridgewell/source-map": "^0.3.3",
"acorn": "^8.8.2",
"acorn": "^8.14.0",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
},
@@ -4366,6 +4637,23 @@
"node": ">=0.8"
}
},
"node_modules/tinyglobby": {
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz",
"integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==",
"dev": true,
"license": "MIT",
"dependencies": {
"fdir": "^6.4.4",
"picomatch": "^4.0.2"
},
"engines": {
"node": ">=12.0.0"
},
"funding": {
"url": "https://github.com/sponsors/SuperchupuDev"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -4411,9 +4699,9 @@
"dev": true
},
"node_modules/typescript": {
"version": "5.8.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -4514,15 +4802,18 @@
"dev": true
},
"node_modules/vite": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.2.3.tgz",
"integrity": "sha512-IzwM54g4y9JA/xAeBPNaDXiBF8Jsgl3VBQ2YQ/wOY6fyW3xMdSoltIV3Bo59DErdqdE6RxUfv8W69DvUorE4Eg==",
"version": "6.3.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.4.4",
"picomatch": "^4.0.2",
"postcss": "^8.5.3",
"rollup": "^4.30.1"
"rollup": "^4.34.9",
"tinyglobby": "^0.2.13"
},
"bin": {
"vite": "bin/vite.js"
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.36.3",
"version": "0.38.2",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,20 +12,20 @@
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/typography": "^0.5.16",
"@tsconfig/svelte": "^5.0.4",
"@vitejs/plugin-legacy": "^6.0.2",
"@vitejs/plugin-legacy": "^6.1.1",
"autoprefixer": "^10.4.21",
"daisyui": "^4.12.23",
"dotenv": "^16.4.7",
"dotenv": "^16.5.0",
"ip": "^2.0.1",
"postcss": "^8.5.3",
"svelte": "^5.25.3",
"svelte-check": "^4.1.5",
"svelte": "^5.30.1",
"svelte-check": "^4.2.1",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^3.4.17",
"terser": "^5.39.0",
"terser": "^5.39.2",
"tslib": "^2.8.1",
"typescript": "^5.8.2",
"vite": "^6.2.3",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vite-plugin-compression": "^0.5.1",
"vite-tsconfig-paths": "^5.1.4"
}
+5 -2
View File
@@ -69,8 +69,11 @@
<LinkDragDrop />
<NavBar />
<!-- TODO:P2 a better way to make the BottomNavigation not hide screens -->
<div style="margin-bottom: 4rem">
<!--
Bottom navigation is of 4rem height, plus the safe area at the bottom.
Added so that bottom navigation does not overlap with the content.
-->
<div style="margin-bottom: calc(4rem + env(safe-area-inset-bottom))">
<SearchScreen visibility={currentScreen == "search"} />
<HomeScreen visibility={currentScreen == "home"} />
+14
View File
@@ -78,6 +78,13 @@ export class PlayletApi {
args.timestamp = parseInt(args.timestamp);
}
}
if (args.percentDurationWatched !== undefined) {
if (typeof args.percentDurationWatched === "string") {
args.percentDurationWatched = parseFloat(args.percentDurationWatched);
}
}
await PlayletApi.postJson(`${PlayletApi.host()}/api/queue/play`, args);
}
@@ -99,6 +106,13 @@ export class PlayletApi {
args.timestamp = parseInt(args.timestamp);
}
}
if (args.percentDurationWatched !== undefined) {
if (typeof args.percentDurationWatched === "string") {
args.percentDurationWatched = parseFloat(args.percentDurationWatched);
}
}
await PlayletApi.postJson(`${PlayletApi.host()}/api/queue`, args);
}
+2 -1
View File
@@ -49,7 +49,8 @@
}
</script>
<div class="btm-nav">
<!-- https://github.com/saadeghi/daisyui/issues/1732#issuecomment-1747818200 -->
<div class="btm-nav box-content">
<button
on:click={() => setScreen("search")}
class={$appStateStore.screen === "search" ? "active" : ""}
+5 -1
View File
@@ -67,7 +67,11 @@
<ThemeSelect />
{#if currentProfile && currentProfile.username}
<div class="badge badge-outline">
<span>{currentProfile.username}</span>
<span>
{currentProfile.username.length > 5
? `${currentProfile.username.slice(0, 5)}…`
: currentProfile.username}
</span>
</div>
{/if}
<button
+7 -3
View File
@@ -19,9 +19,13 @@
class="rounded-full w-8 ring ring-offset-base-100 ring-offset-2"
style="background-color: {currentProfile.color}"
>
<span class="text-xl font-medium text-gray-200"
>{currentProfile.username.substring(0, 1).toUpperCase()}</span
>
{#if currentProfile.type === "youtube" && currentProfile.thumbnail}
<img src={currentProfile.thumbnail} alt="Avatar" />
{:else}
<span class="text-xl font-medium text-gray-200"
>{currentProfile.username.substring(0, 1).toUpperCase()}</span
>
{/if}
</div>
</div>
{:else}
+36 -17
View File
@@ -67,13 +67,17 @@
refreshProfiles();
}
function login() {
function loginToInvidious() {
if (!authUrl) {
alert("Error with login, please refresh the page.");
return;
}
window.location = authUrl;
}
function loginToYoutube() {
alert("Please use your Roku device to login to YouTube.");
}
</script>
<dialog bind:this={modal} class="modal" on:close={onClose}>
@@ -98,9 +102,13 @@
: ''} "
style="background-color: {profile.color}"
>
<span class="text-xl font-medium text-gray-200"
>{profile.username.substring(0, 1).toUpperCase()}</span
>
{#if profile.type === "youtube" && profile.thumbnail}
<img src={profile.thumbnail} alt="Avatar" />
{:else}
<span class="text-xl font-medium text-gray-200"
>{profile.username.substring(0, 1).toUpperCase()}</span
>
{/if}
</div>
</div>
</div>
@@ -109,12 +117,16 @@
{profile.username}
</div>
<div class="text-xs font-light">
<a
class="link"
href={profile.serverUrl}
target="_blank"
rel="noopener noreferrer">{profile.serverUrl}</a
>
{#if profile.type === "youtube"}
<div>YouTube</div>
{:else}
<a
class="link"
href={profile.serverUrl}
target="_blank"
rel="noopener noreferrer">{profile.serverUrl}</a
>
{/if}
</div>
</div>
</div>
@@ -133,13 +145,20 @@
</div>
{/each}
<div class="flex items-center">
<button class="btn btn-primary" on:click={login}>
<div class="">
<div class="text-m">{$translate("Login to Invidious")}</div>
<div class="text-xs font-light">{currentInstanceName}</div>
</div>
</button>
<button class="btn m-6">{$translate("Close")}</button>
<div class="flex flex-col">
<button class="btn btn-primary m-2" on:click={loginToYoutube}>
<div class="">
<div class="text-m">{$translate("Login to YouTube")}</div>
</div>
</button>
<button class="btn btn-primary m-2" on:click={loginToInvidious}>
<div class="">
<div class="text-m">{$translate("Login to Invidious")}</div>
<div class="text-xs font-light">{currentInstanceName}</div>
</div>
</button>
</div>
<button class="btn m-2">{$translate("Close")}</button>
</div>
</div>
</form>
@@ -12,6 +12,7 @@
export let videoCountText: string | undefined = undefined;
export let videos: any[] | undefined = undefined;
export let updated: number | undefined = undefined;
export let lines: string[] | undefined = undefined;
// svelte-ignore unused-export-let
export let type: string = undefined;
@@ -96,8 +97,10 @@
/>
<div class="card-body">
<h3 class="card-title text-base line-clamp-2 min-h-12">{title}</h3>
<div class="font-semibold">{author}</div>
<div>{getUpdatedText()}</div>
<div class="font-semibold">
{author || (lines?.length > 0 ? lines[0] : "")}
</div>
<div>{getUpdatedText() || (lines?.length > 1 ? lines[1] : "")}</div>
</div>
</div>
</button>
@@ -14,6 +14,7 @@
export let viewCount: number | undefined = undefined;
export let isUpcoming: boolean = undefined;
export let premiereTimestamp: number | undefined = undefined;
export let percentDurationWatched: number | undefined = undefined;
export let videoStartAtChecked;
export let videoStartAtTimestamp;
@@ -69,6 +70,7 @@
liveNow,
viewCount,
timestamp,
percentDurationWatched,
};
}
@@ -103,6 +105,7 @@
bind:isUpcoming
bind:premiereTimestamp
bind:invidiousInstance
bind:percentDurationWatched
/>
</div>
<div class="m-4">{title || ""}</div>
+15 -4
View File
@@ -18,6 +18,8 @@
export let lengthSeconds: number = undefined;
export let lengthText: string | undefined = undefined;
export let liveNow: boolean = undefined;
export let lines: string[] | undefined = undefined;
export let percentDurationWatched: number | undefined = undefined;
// svelte-ignore unused-export-let
export let type: string = undefined;
@@ -179,6 +181,13 @@
return trFn("1 minute ago");
}
}
function openChannelModal() {
if (!authorId) {
return;
}
channelModal.show();
}
</script>
<button
@@ -199,6 +208,7 @@
bind:lengthText
bind:viewCount
bind:invidiousInstance
bind:percentDurationWatched
/>
<div class="card-body">
<h3 class="card-title text-base line-clamp-2 min-h-12">{title || ""}</h3>
@@ -208,18 +218,18 @@
tabindex="0"
on:click={(e) => {
e.stopPropagation();
channelModal.show();
openChannelModal();
}}
on:keydown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
channelModal.show();
openChannelModal();
}
}}
>
{author || ""}
{author || (lines?.length > 0 ? lines[0] : "")}
</span>
<div>{getViewCountDateText()}</div>
<div>{getViewCountDateText() || (lines?.length > 1 ? lines[1] : "")}</div>
</div>
</div>
</button>
@@ -235,6 +245,7 @@
bind:isUpcoming
bind:premiereTimestamp
bind:viewCount
bind:percentDurationWatched
videoStartAtChecked={false}
videoStartAtTimestamp={0}
/>
@@ -171,7 +171,13 @@
let hasContinuation = !!result.continuation;
feedSource.state.continuation = result.continuation || "";
if (result.items.length > 0) {
// See brightscript version for the "inv_auth_playlists" case
const items =
feedSource.id === "inv_auth_playlists"
? deduplicateAuthPlaylists(result.items)
: result.items || [];
if (items.length > 0) {
const paginationType = feedSource.state.paginationType;
if (hadContinuation && !hasContinuation) {
feedSource.state.loadState = FeedLoadState.Loaded;
@@ -195,32 +201,30 @@
feedLoadState = FeedLoadState.LoadedPage;
}
if (result && result.items) {
const newVideos = result.items;
const newVideos = items;
newVideos.forEach((item) => {
if (item.videoId) {
item.type = "video";
} else if (item.playlistId) {
item.type = "playlist";
}
});
const newItemWidths = newVideos.map((video) => {
if (video.type === "channel") {
return channelItemWidth;
} else {
return videoItemWidth;
}
});
itemWidths = [...itemWidths, ...newItemWidths];
videos = [...(videos || []), ...newVideos];
totalFetchedItems += result.items.length;
if (totalFetchedItems >= 6) {
break;
newVideos.forEach((item) => {
if (item.videoId) {
item.type = "video";
} else if (item.playlistId) {
item.type = "playlist";
}
});
const newItemWidths = newVideos.map((video) => {
if (video.type === "channel") {
return channelItemWidth;
} else {
return videoItemWidth;
}
});
itemWidths = [...itemWidths, ...newItemWidths];
videos = [...(videos || []), ...newVideos];
totalFetchedItems += items.length;
if (totalFetchedItems >= 6) {
break;
}
} catch (error) {
// TODO:P0 handle case of unauthenticated calls
@@ -232,6 +236,28 @@
}
}
function deduplicateAuthPlaylists(items) {
if (!items || items.length === 0) {
return [];
}
if (videos.length === 0) {
return items;
}
const existingPlaylistIds = new Set(
videos.map((video) => video.playlistId).filter((id) => id)
);
const newItems = items.filter((item) => {
if (item.playlistId && existingPlaylistIds.has(item.playlistId)) {
return false;
}
return true;
});
return newItems;
}
function recalculateVisibileCells() {
let scrollLeft = carouselElement.scrollLeft;
const clientWidth = carouselElement.clientWidth || window.innerWidth;
@@ -10,6 +10,7 @@
export let viewCount: number | undefined = undefined;
export let isUpcoming: boolean | undefined = undefined;
export let premiereTimestamp: number | undefined = undefined;
export let percentDurationWatched: number | undefined = undefined;
export let invidiousInstance;
@@ -92,4 +93,10 @@
{getFormattedTime(lengthText, lengthSeconds)}
</div>
{/if}
{#if percentDurationWatched}
<div
class="absolute left-0 bottom-0 h-1 bg-red-600 rounded-box"
style="width: {Math.min(percentDurationWatched, 100)}%;"
></div>
{/if}
</figure>
+2 -1
View File
@@ -3,7 +3,8 @@ import { CompilerPlugin, Program, SourceObj } from "brighterscript";
const types = [
{ name: 'Bool', interface: 'ifBoolean', type: 'boolean', defaultValue: 'false' },
{ name: 'Int', interface: 'ifInt', type: 'integer', defaultValue: '0' },
{ name: 'Int', interface: 'ifInt', type: 'integer', defaultValue: '0%' },
{ name: 'Float', interface: 'ifFloat', type: 'float', defaultValue: '0!' },
{ name: 'Double', interface: 'ifDouble', type: 'double', defaultValue: '0#' },
{ name: 'String', interface: 'ifString', type: 'string', defaultValue: '""' },
{ name: 'Array', interface: 'ifArray', type: 'object', defaultValue: '[]' },
-7
View File
@@ -30,10 +30,3 @@ const parsedVersion = semverParse(version);
[".", "playlet-app", "playlet-lib", "playlet-web"].forEach(function (packageFolder) {
execSync(`npm version ${version} --allow-same-version --no-git-tag-version`, { cwd: packageFolder });
});
const webApi = "docs/playlet-web-api.yml"
let webApiContent = fs.readFileSync(webApi, { encoding: 'utf8', flag: 'r' });
// replace version in web api with regex
const webApiVersionPattern = /version: (\d+\.\d+\.\d+)/;
webApiContent = webApiContent.replace(webApiVersionPattern, `version: ${version}`);
fs.writeFileSync(webApi, webApiContent);