[Spike] ytjs and botguard in web app (#638)

* [Spike] ytjs and boguard in web app

* storyboards and captions

* cache potoken

* captions fix

* Increase session data to 7 days

* changelog

* Fix missing timestamp issue
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2025-06-04 17:34:56 -04:00
1 parent 002307c45b
commit 03679b781c
12 files changed
+628 -20

No files matched your search

@@ -3,6 +3,7 @@
import { playletStateStore, translate } from "lib/Stores";
import VideoStartAt from "./VideoStartAt.svelte";
import VideoThumbnail from "./VideoThumbnail.svelte";
import { YoutubeJs } from "lib/Api/YoutubeJs";
export let videoId: string | undefined = undefined;
export let title: string | undefined = undefined;
@@ -42,11 +43,26 @@
});
async function playOnTv() {
await PlayletApi.playVideo(getVideoInfo());
const videoInfo = getVideoInfo();
await PlayletApi.playVideo(videoInfo);
}
async function playOnTvYtjs() {
const videoInfo = getVideoInfo() as any;
// measure length of time it takes to get video info
const start = performance.now();
const metadata = await YoutubeJs.getVideoInfo(videoId);
const end = performance.now();
console.log(`Time to get video info: ${end - start}ms`);
videoInfo.metadata = metadata;
await PlayletApi.playVideo(videoInfo);
}
async function queueOnTv() {
await PlayletApi.queueVideo(getVideoInfo());
const videoInfo = getVideoInfo();
await PlayletApi.queueVideo(videoInfo);
}
function openInvidious() {
@@ -121,6 +137,9 @@
<button class="btn join-item hover:btn-accent" on:click={playOnTv}>
{$translate("Play on %1").replace("%1", tvName)}
</button>
<button class="btn join-item hover:btn-accent" on:click={playOnTvYtjs}>
{$translate("Play on %1").replace("%1", tvName)} (ytjs)
</button>
<button class="btn join-item hover:btn-accent" on:click={queueOnTv}>
{$translate("Queue on %1").replace("%1", tvName)}
</button>