web: deprecate youtube HLS, enable it only via env variable
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run

it's now disabled by default because if we ever need HLS for youtube in the future, it'll be managed by the processing instance, not the web client. will probably be removed completely in next major release.
This commit is contained in:
wukko 2025-06-14 16:35:35 +06:00
parent 863d39db6f
commit 5ea170a5ac
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2
4 changed files with 30 additions and 21 deletions

View File

@ -13,10 +13,11 @@ them, you must specify them when building the frontend (or running a vite server
`WEB_DEFAULT_API` is **required** to run cobalt frontend. `WEB_DEFAULT_API` is **required** to run cobalt frontend.
| name | example | description | | name | example | description |
|:---------------------|:----------------------------|:--------------------------------------------------------------------------------------------| |:--------------------------------|:----------------------------|:--------------------------------------------------------------------------------------------------------|
| `WEB_HOST` | `cobalt.tools` | domain on which the frontend will be running. used for meta tags and configuring plausible. | | `WEB_HOST` | `cobalt.tools` | domain on which the frontend will be running. used for meta tags and configuring plausible. |
| `WEB_PLAUSIBLE_HOST` | `plausible.io`* | enables plausible analytics with provided hostname as receiver backend. | | `WEB_PLAUSIBLE_HOST` | `plausible.io`* | enables plausible analytics with provided hostname as receiver backend. |
| `WEB_DEFAULT_API` | `https://api.cobalt.tools/` | changes url which is used for api requests by frontend clients. | | `WEB_DEFAULT_API` | `https://api.cobalt.tools/` | changes url which is used for api requests by frontend clients. |
| `ENABLE_DEPRECATED_YOUTUBE_HLS` | `true` | enables the youtube HLS settings entry; allows sending the related variable to the processing instance. |
\* don't use plausible.io as receiver backend unless you paid for their cloud service. \* don't use plausible.io as receiver backend unless you paid for their cloud service.
use your own domain when hosting community edition of plausible. refer to their [docs](https://plausible.io/docs) when needed. use your own domain when hosting community edition of plausible. refer to their [docs](https://plausible.io/docs) when needed.

View File

@ -1,3 +1,4 @@
import env from "$lib/env";
import API from "$lib/api/api"; import API from "$lib/api/api";
import settings from "$lib/state/settings"; import settings from "$lib/state/settings";
import lazySettingGetter from "$lib/settings/lazy-get"; import lazySettingGetter from "$lib/settings/lazy-get";
@ -60,7 +61,7 @@ export const savingHandler = async ({ url, request, oldTaskId }: SavingHandlerAr
youtubeVideoCodec: getSetting("save", "youtubeVideoCodec"), youtubeVideoCodec: getSetting("save", "youtubeVideoCodec"),
videoQuality: getSetting("save", "videoQuality"), videoQuality: getSetting("save", "videoQuality"),
youtubeHLS: getSetting("save", "youtubeHLS"), youtubeHLS: env.ENABLE_DEPRECATED_YOUTUBE_HLS ? getSetting("save", "youtubeHLS") : undefined,
convertGif: getSetting("save", "convertGif"), convertGif: getSetting("save", "convertGif"),
allowH265: getSetting("save", "allowH265"), allowH265: getSetting("save", "allowH265"),

View File

@ -9,13 +9,17 @@ const getEnv = (_key: string) => {
} }
} }
const getEnvBool = (key: string) => {
return getEnv(key) === "true";
}
const variables = { const variables = {
HOST: getEnv('HOST'), HOST: getEnv('HOST'),
PLAUSIBLE_HOST: getEnv('PLAUSIBLE_HOST'), PLAUSIBLE_HOST: getEnv('PLAUSIBLE_HOST'),
PLAUSIBLE_ENABLED: getEnv('HOST') && getEnv('PLAUSIBLE_HOST'), PLAUSIBLE_ENABLED: getEnv('HOST') && getEnv('PLAUSIBLE_HOST'),
DEFAULT_API: getEnv('DEFAULT_API'), DEFAULT_API: getEnv('DEFAULT_API'),
// temporary variable until webcodecs features are ready for testing ENABLE_WEBCODECS: getEnvBool('ENABLE_WEBCODECS'),
ENABLE_WEBCODECS: !!getEnv('ENABLE_WEBCODECS'), ENABLE_DEPRECATED_YOUTUBE_HLS: getEnvBool('ENABLE_DEPRECATED_YOUTUBE_HLS'),
} }
const contacts = { const contacts = {

View File

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import env from "$lib/env";
import settings from "$lib/state/settings"; import settings from "$lib/state/settings";
import { t } from "$lib/i18n/translations"; import { t } from "$lib/i18n/translations";
@ -54,6 +55,7 @@
</Switcher> </Switcher>
</SettingsCategory> </SettingsCategory>
{#if env.ENABLE_DEPRECATED_YOUTUBE_HLS}
<SettingsCategory <SettingsCategory
sectionId="youtube-hls" sectionId="youtube-hls"
title={$t("settings.video.youtube.hls")} title={$t("settings.video.youtube.hls")}
@ -68,6 +70,7 @@
disabled={$settings.save.youtubeVideoCodec === "av1"} disabled={$settings.save.youtubeVideoCodec === "av1"}
/> />
</SettingsCategory> </SettingsCategory>
{/if}
<SettingsCategory sectionId="h265" title={$t("settings.video.h265")}> <SettingsCategory sectionId="h265" title={$t("settings.video.h265")}>
<SettingsToggle <SettingsToggle