Add Piped backend: translation router + client wiring
- PipedBackendRouter serves Invidious-shaped /api/v1 JSON on the local web server at /playlet-piped-backend, translating from a real Piped instance (trending/search/suggestions/videos/comments/channels/ playlists/stats; auth endpoints return unsupported for now). - PipedToInvidious converters incl. HLS-first playback metadata (Piped's hls master via proxy.piped instance; muxed mp4 fallback) and previewFrames -> Playlet storyboard shape. - preferences: backend.selected gains 'piped'; new piped.instance (default https://api.piped.spaghet.io). - InvidiousService.GetInstance routes backend=piped to the local translation router; ResolveBackendId returns 'piped'.
This commit is contained in:
1 parent
4bd5c11f42
commit
ee36c76e8f
7 files changed
+965
-1
No files matched your search
@@ -16,6 +16,7 @@ namespace Invidious
|
||||
const INSTANCES_API = "https://api.invidious.io/instances.json?sort_by=type,users"
|
||||
|
||||
const PLAYLET_BUILT_IN_INSTANCE = "http://127.0.0.1:8888/playlet-invidious-backend"
|
||||
const PLAYLET_PIPED_BUILT_IN_INSTANCE = "http://127.0.0.1:8888/playlet-piped-backend"
|
||||
const INSTANCE_EXAMPLE = "https://invidious.example.com"
|
||||
|
||||
const TOKEN_CALLBACK = "/invidious/token_callback"
|
||||
@@ -82,6 +83,11 @@ namespace Invidious
|
||||
end if
|
||||
|
||||
backend = m.preferences["backend.selected"]
|
||||
if backend = "piped"
|
||||
' Piped speaks its own API, not Invidious's; route through the
|
||||
' local translation router that presents an Invidious-shaped facade.
|
||||
return PLAYLET_PIPED_BUILT_IN_INSTANCE
|
||||
end if
|
||||
if backend = "invidious"
|
||||
instance = m.GetInvidiousInstance()
|
||||
if not StringUtils.IsNullOrEmpty(instance)
|
||||
|
||||
Reference in new issue
Block a user