From d76935314e963876f376284305652ee565dace83 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Fri, 13 Feb 2026 17:31:32 +1300 Subject: [PATCH 01/55] Started support for Materialious with backend --- materialious/android/app/build.gradle | 4 +- .../electron/materialious.metainfo.xml | 6 +- materialious/electron/package.json | 2 +- materialious/package-lock.json | 143 +++++++++++++++++- materialious/package.json | 3 +- materialious/src/routes/+layout.svelte | 1 + materialious/src/routes/+layout.ts | 1 - .../static/localApi/ghContributors.json | 2 +- materialious/svelte.config.js | 26 ++-- materialious/vite.config.ts | 2 +- update_versions.py | 2 +- 11 files changed, 168 insertions(+), 24 deletions(-) diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 82c7dff7..6692166c 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 208 - versionName "1.14.4" + versionCode 209 + versionName "1.15.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml index dd4c57c1..796892f7 100644 --- a/materialious/electron/materialious.metainfo.xml +++ b/materialious/electron/materialious.metainfo.xml @@ -73,7 +73,11 @@ - + + + https://github.com/Materialious/Materialious/releases/tag/1.15.0 + + https://github.com/Materialious/Materialious/releases/tag/1.14.4 diff --git a/materialious/electron/package.json b/materialious/electron/package.json index 434fc421..03a274a2 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.14.4", + "version": "1.15.0", "description": "Modern material design for YouTube and Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/package-lock.json b/materialious/package-lock.json index 69807d81..bf2297c5 100644 --- a/materialious/package-lock.json +++ b/materialious/package-lock.json @@ -1,12 +1,12 @@ { "name": "materialious", - "version": "1.13.17", + "version": "1.14.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "materialious", - "version": "1.13.17", + "version": "1.14.4", "hasInstallScript": true, "dependencies": { "@capacitor-community/electron": "^5.0.1", @@ -50,6 +50,7 @@ "@capacitor/assets": "^3.0.5", "@capacitor/cli": "^8.0.0", "@sveltejs/adapter-auto": "^7.0.0", + "@sveltejs/adapter-node": "^5.5.3", "@sveltejs/adapter-static": "^3.0.10", "@sveltejs/kit": "^2.50.0", "@sveltejs/vite-plugin-svelte": "^6.2.1", @@ -3372,6 +3373,96 @@ "prettier": ">=2.4.0" } }, + "node_modules/@rollup/plugin-commonjs": { + "version": "29.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.0.tgz", + "integrity": "sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/plugin-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", + "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.3.1.tgz", @@ -3819,6 +3910,47 @@ "@sveltejs/kit": "^2.0.0" } }, + "node_modules/@sveltejs/adapter-node": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-5.5.3.tgz", + "integrity": "sha512-yeWbKXBL9vqDb/7R8ebvRHeuBHN4cRYYBSquNJSMQtS6rIYkXxsVSveaMTUaLvHYQsb1zNa+nH2iLTOMawBohA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/plugin-commonjs": "^29.0.0", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.0", + "rollup": "^4.9.5" + }, + "peerDependencies": { + "@sveltejs/kit": "^2.4.0" + } + }, + "node_modules/@sveltejs/adapter-node/node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", + "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@sveltejs/adapter-static": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.10.tgz", @@ -5651,6 +5783,13 @@ "node": ">=4.0.0" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", diff --git a/materialious/package.json b/materialious/package.json index 0a7e67b3..52f1cbc1 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.14.4", + "version": "1.15.0", "private": true, "scripts": { "dev": "npm run patch:github && vite dev", @@ -19,6 +19,7 @@ "@capacitor/assets": "^3.0.5", "@capacitor/cli": "^8.0.0", "@sveltejs/adapter-auto": "^7.0.0", + "@sveltejs/adapter-node": "^5.5.3", "@sveltejs/adapter-static": "^3.0.10", "@sveltejs/kit": "^2.50.0", "@sveltejs/vite-plugin-svelte": "^6.2.1", diff --git a/materialious/src/routes/+layout.svelte b/materialious/src/routes/+layout.svelte index 9e8a82ee..1a07ff10 100644 --- a/materialious/src/routes/+layout.svelte +++ b/materialious/src/routes/+layout.svelte @@ -1,6 +1,7 @@ -{#if Capacitor.isNativePlatform()} +{#if isUnrestrictedPlatform()}
{/if} -{#if Capacitor.isNativePlatform()} +{#if isUnrestrictedPlatform()}
@@ -408,7 +382,7 @@
{/if} -
+
arrow_drop_down
-
+
arrow_drop_down
-
+
{#if isUnrestrictedPlatform() && !isYTBackend()} -
+
- diff --git a/materialious/src/lib/components/settings/SponsorBlock.svelte b/materialious/src/lib/components/settings/SponsorBlock.svelte index 0de8a602..da4bbe76 100644 --- a/materialious/src/lib/components/settings/SponsorBlock.svelte +++ b/materialious/src/lib/components/settings/SponsorBlock.svelte @@ -48,7 +48,7 @@ )} > @@ -119,7 +119,7 @@

{sponsor.name}

-
+
+ + {#if !invidiousInstanceValid && invidiousInstance !== ''} + {$_('invalidInstance')} + {/if} +
+ + {#if invidiousInstanceValid} +
+ + + {/if} + {/if} + {/if} + diff --git a/materialious/src/routes/(app)/setup/+page.ts b/materialious/src/routes/(app)/setup/+page.ts new file mode 100644 index 00000000..7d60f7af --- /dev/null +++ b/materialious/src/routes/(app)/setup/+page.ts @@ -0,0 +1,11 @@ +import { goto } from '$app/navigation'; +import { resolve } from '$app/paths'; +import { isYTBackend } from '$lib/misc'; +import { instanceStore } from '$lib/store'; +import { get } from 'svelte/store'; + +export async function load() { + if (isYTBackend() || get(instanceStore)) { + goto(resolve('/', {}), { replaceState: true }); + } +} diff --git a/materialious/src/routes/+layout.ts b/materialious/src/routes/+layout.ts index 5348685d..aca23844 100644 --- a/materialious/src/routes/+layout.ts +++ b/materialious/src/routes/+layout.ts @@ -17,6 +17,7 @@ import { get, type Writable } from 'svelte/store'; import { Capacitor } from '@capacitor/core'; import { Preferences } from '@capacitor/preferences'; import { deserialize } from '@macfja/serializer'; +import { isYTBackend } from '$lib/misc.js'; export const ssr = false; @@ -42,6 +43,10 @@ export async function load({ url }) { } } + if (!get(instanceStore) && !isYTBackend() && !url.pathname.startsWith('/setup')) { + goto(resolve('/setup', {}), { replaceState: true }); + } + const resolvedRoot = resolve('/', {}); if (url.pathname.startsWith(resolvedRoot + '@')) { const username = url.pathname.substring(resolvedRoot.length).split('/')[0]; diff --git a/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts b/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts index 0d2ada67..22ab2077 100644 --- a/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts +++ b/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts @@ -1,9 +1,3 @@ -function copyHeader(header: string, targetHeaders: Headers, sourceHeaders: Headers) { - if (sourceHeaders.has(header)) { - targetHeaders.set(header, sourceHeaders.get(header)!); - } -} - async function proxyRequest(request: Request, urlToProxy: string): Promise { let urlToProxyObj: URL; try { @@ -12,6 +6,13 @@ async function proxyRequest(request: Request, urlToProxy: string): Promise Date: Fri, 13 Feb 2026 21:12:03 +1300 Subject: [PATCH 08/55] Implemented whitelist for proxy --- materialious/package-lock.json | 14 +++++++++ materialious/package.json | 1 + materialious/src/lib/misc.ts | 6 ++-- .../routes/api/proxy/[urlToProxy]/+server.ts | 31 +++++++++++++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/materialious/package-lock.json b/materialious/package-lock.json index 1416b589..811849ee 100644 --- a/materialious/package-lock.json +++ b/materialious/package-lock.json @@ -66,6 +66,7 @@ "patch-package": "^8.0.1", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", + "psl": "^1.15.0", "svelte": "^5.47.0", "svelte-awesome-color-picker": "^4.1.1", "svelte-check": "^4.3.3", @@ -11409,6 +11410,19 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "license": "MIT" }, + "node_modules/psl": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, "node_modules/pump": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", diff --git a/materialious/package.json b/materialious/package.json index 056ac529..7e27eb65 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -35,6 +35,7 @@ "patch-package": "^8.0.1", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", + "psl": "^1.15.0", "svelte": "^5.47.0", "svelte-awesome-color-picker": "^4.1.1", "svelte-check": "^4.3.3", diff --git a/materialious/src/lib/misc.ts b/materialious/src/lib/misc.ts index be7a7ac8..a805dfed 100644 --- a/materialious/src/lib/misc.ts +++ b/materialious/src/lib/misc.ts @@ -234,16 +234,14 @@ export type IsOwnBackend = { builtWithBackend: boolean; internalAuth: boolean; requireAuth: boolean; - proxyWithoutAuth: boolean; }; export function isOwnBackend(): IsOwnBackend | false { if (import.meta.env.VITE_BUILD_WITH_BACKEND !== 'true') return false; return { builtWithBackend: true, - internalAuth: import.meta.env.VITE_INTERNAL_AUTH === 'true', - requireAuth: import.meta.env.VITE_REQUIRE_AUTH === 'true', - proxyWithoutAuth: import.meta.env.VITE_PROXY_WITHOUT_AUTH === 'true' + internalAuth: import.meta.env.VITE_INTERNAL_AUTH === 'false', + requireAuth: import.meta.env.VITE_REQUIRE_AUTH === 'false' }; } diff --git a/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts b/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts index 22ab2077..cf08cae9 100644 --- a/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts +++ b/materialious/src/routes/api/proxy/[urlToProxy]/+server.ts @@ -1,3 +1,30 @@ +import psl from 'psl'; + +const allowedDomains: string[] = [ + 'youtube.com', + 'ytimg.com', + 'googlevideo.com', + 'returnyoutubedislike.com', + 'sponsor.ajay.app', + 'dearrow-thumb.ajay.app', + 'materialio.us' +]; + +const dynamicAllowDomains = [ + process.env.VITE_DEFAULT_DEARROW_THUMBNAIL_INSTANCE, + process.env.VITE_DEFAULT_DEARROW_INSTANCE, + process.env.VITE_DEFAULT_INVIDIOUS_INSTANCE, + process.env.VITE_DEFAULT_RETURNYTDISLIKES_INSTANCE, + process.env.VITE_DEFAULT_API_EXTENDED_INSTANCE, + process.env.VITE_DEFAULT_SYNCIOUS_INSTANCE +]; + +dynamicAllowDomains.forEach((domain) => { + if (domain) { + allowedDomains.push(domain); + } +}); + async function proxyRequest(request: Request, urlToProxy: string): Promise { let urlToProxyObj: URL; try { @@ -6,6 +33,10 @@ async function proxyRequest(request: Request, urlToProxy: string): Promise Date: Fri, 13 Feb 2026 21:39:16 +1300 Subject: [PATCH 09/55] Started login checks --- materialious/src/lib/backend.ts | 15 +++++++++++++++ materialious/src/lib/misc.ts | 18 ++---------------- materialious/src/routes/(app)/+layout.svelte | 11 +++++++++-- .../routes/api/proxy/[urlToProxy]/+server.ts | 11 +++++++++++ 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 materialious/src/lib/backend.ts diff --git a/materialious/src/lib/backend.ts b/materialious/src/lib/backend.ts new file mode 100644 index 00000000..b4ccbed0 --- /dev/null +++ b/materialious/src/lib/backend.ts @@ -0,0 +1,15 @@ +export type IsOwnBackend = { + builtWithBackend: boolean; + internalAuth: boolean; + requireAuth: boolean; +}; + +export function isOwnBackend(): IsOwnBackend | null { + if (import.meta.env.VITE_BUILD_WITH_BACKEND !== 'true') return null; + + return { + builtWithBackend: true, + internalAuth: import.meta.env.VITE_INTERNAL_AUTH !== 'false', + requireAuth: import.meta.env.VITE_REQUIRE_AUTH !== 'false' + }; +} diff --git a/materialious/src/lib/misc.ts b/materialious/src/lib/misc.ts index a805dfed..92dea445 100644 --- a/materialious/src/lib/misc.ts +++ b/materialious/src/lib/misc.ts @@ -28,6 +28,7 @@ import { page } from '$app/state'; import { Capacitor } from '@capacitor/core'; import { Share } from '@capacitor/share'; import { Clipboard } from '@capacitor/clipboard'; +import { isOwnBackend } from './backend'; export function isMobile(): boolean { const userAgent = navigator.userAgent; @@ -230,23 +231,8 @@ export function findElementForTime( return null; } -export type IsOwnBackend = { - builtWithBackend: boolean; - internalAuth: boolean; - requireAuth: boolean; -}; -export function isOwnBackend(): IsOwnBackend | false { - if (import.meta.env.VITE_BUILD_WITH_BACKEND !== 'true') return false; - - return { - builtWithBackend: true, - internalAuth: import.meta.env.VITE_INTERNAL_AUTH === 'false', - requireAuth: import.meta.env.VITE_REQUIRE_AUTH === 'false' - }; -} - export function isUnrestrictedPlatform(): boolean { - return isOwnBackend() !== false || Capacitor.isNativePlatform(); + return isOwnBackend() !== null || Capacitor.isNativePlatform(); } export function isYTBackend(): boolean { diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index 7b272735..bba76f3e 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -42,9 +42,12 @@ import { isYTBackend, clearCaches, truncate } from '$lib/misc'; import Author from '$lib/components/Author.svelte'; import Toast from '$lib/components/Toast.svelte'; + import { isOwnBackend } from '$lib/backend'; let { children } = $props(); + const showLogin = !isYTBackend() || isOwnBackend()?.internalAuth; + let mobileSearchShow = $state(false); let isLoggedIn = $state(false); @@ -112,6 +115,10 @@ }); async function login() { + if (isOwnBackend()?.internalAuth) { + return; + } + if (!$isAndroidTvStore) { // eslint-disable-next-line svelte/prefer-svelte-reactivity const path = new URL(`${get(instanceStore)}/authorize_token`); @@ -281,7 +288,7 @@ settings
{$_('layout.settings')}
- {#if !isYTBackend()} + {#if showLogin} {#if !isLoggedIn} login @@ -367,7 +374,7 @@
{$_('layout.settings')}
- {#if !isYTBackend()} + {#if showLogin} {#if !isLoggedIn} + + + + + + + + diff --git a/materialious/src/routes/(app)/internal/login/+page.ts b/materialious/src/routes/(app)/internal/login/+page.ts new file mode 100644 index 00000000..fc89ddbd --- /dev/null +++ b/materialious/src/routes/(app)/internal/login/+page.ts @@ -0,0 +1,9 @@ +import { goto } from '$app/navigation'; +import { resolve } from '$app/paths'; +import { isOwnBackend } from '$lib/shared'; + +export async function load() { + if (!isOwnBackend()?.internalAuth) { + goto(resolve('/', {}), { replaceState: true }); + } +} From 032a9000570a4a3a625364605890b8a08cddeb20 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Sat, 14 Feb 2026 01:25:24 +1300 Subject: [PATCH 21/55] Show logout option in logged in with backend --- materialious/src/routes/(app)/+layout.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index 131671ef..33767789 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -190,7 +190,7 @@ function logout() { if (isOwnBackend()?.internalAuth) { rawSubscriptionKeyStore.set(undefined); - fetch('/api/user/logout'); + fetch('/api/user/logout', { method: 'DELETE' }); } authStore.set(null); @@ -382,7 +382,7 @@ {#if showLogin} - {#if !isLoggedIn} + {#if !isLoggedIn && !$rawSubscriptionKeyStore}
{#if showLogin} - {#if !isLoggedIn && !$rawSubscriptionKeyStore} + {#if !isLoggedIn && !$rawMasterKeyStore}
+
+ { + const { payload, state } = ev.detail; + if (state === 'verified' && payload) { + captchaPayload = payload; + } + }} + > +
+
+
+ password + + + {#if failed && !needToRegister} + {$_('invalidPassword')} + {/if} +
- - - - - +
+ { + const { payload, state } = ev.detail; + if (state === 'verified' && payload) { + captchaPayload = payload; + } + }} + > +
+ + + + + +{/if} From a6d89b58b6412bed456b97bbbf7042156424e93f Mon Sep 17 00:00:00 2001 From: WardPearce Date: Sun, 15 Feb 2026 02:27:04 +1300 Subject: [PATCH 53/55] Update +page.svelte --- materialious/src/routes/(app)/setup/+page.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/materialious/src/routes/(app)/setup/+page.svelte b/materialious/src/routes/(app)/setup/+page.svelte index d82da6f2..0d7384f8 100644 --- a/materialious/src/routes/(app)/setup/+page.svelte +++ b/materialious/src/routes/(app)/setup/+page.svelte @@ -24,7 +24,6 @@ clearCaches(); goto(resolve('/', {}), { replaceState: true }); - location.reload(); } function setYTBackend() { From 68c7c094ae0347c189c12c90999f7310a9ec9cb7 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Sun, 15 Feb 2026 02:36:07 +1300 Subject: [PATCH 54/55] Update +layout.ts --- materialious/src/routes/+layout.ts | 33 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/materialious/src/routes/+layout.ts b/materialious/src/routes/+layout.ts index a67b4515..4bb7c72a 100644 --- a/materialious/src/routes/+layout.ts +++ b/materialious/src/routes/+layout.ts @@ -61,27 +61,26 @@ export async function load({ url }) { } } + const defaultPage = get(interfaceDefaultPage); + + if ( + defaultPage && + defaultPage !== '/' && + defaultPage.startsWith('/') && + url.pathname === resolvedRoot && + window.history.length < 3 + ) { + getPages().forEach((page) => { + if (page.href === defaultPage && (!page.requiresAuth || get(invidiousAuthStore))) { + goto(resolve(defaultPage, {})); + } + }); + } + const isLoginPage = url.pathname.endsWith('/internal/login'); const isSetupPage = url.pathname.endsWith('/setup'); if (!isLoginPage) { - const defaultPage = get(interfaceDefaultPage); - - if ( - defaultPage && - defaultPage !== '/' && - defaultPage.startsWith('/') && - url.pathname === resolvedRoot && - window.history.length < 3 && - !isSetupPage - ) { - getPages().forEach((page) => { - if (page.href === defaultPage && (!page.requiresAuth || get(invidiousAuthStore))) { - goto(resolve(defaultPage, {})); - } - }); - } - if (isOwnBackend()?.requireAuth && !get(rawMasterKeyStore)) { goto(resolve('/internal/login', {}), { replaceState: true }); } else if (!get(invidiousInstanceStore) && !isYTBackend() && !isSetupPage) { From 9c44bf517a71030d43c8334b98c5ff915c6a147e Mon Sep 17 00:00:00 2001 From: WardPearce Date: Sun, 15 Feb 2026 02:39:37 +1300 Subject: [PATCH 55/55] Minor fixes --- materialious/src/routes/(app)/channel/[slug]/+page.ts | 4 ++-- materialious/src/routes/(app)/search/[slug]/+page.svelte | 2 +- materialious/src/routes/(app)/watch/[slug]/+page.svelte | 4 ++-- materialious/src/routes/+layout.ts | 4 ++-- materialious/src/routes/api/poToken/+server.ts | 2 +- materialious/src/routes/api/user/create/+server.ts | 4 ++-- materialious/src/routes/api/user/isLoggedIn/+server.ts | 2 +- materialious/src/routes/api/user/login/+server.ts | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/materialious/src/routes/(app)/channel/[slug]/+page.ts b/materialious/src/routes/(app)/channel/[slug]/+page.ts index b582fb44..8b09d6d7 100644 --- a/materialious/src/routes/(app)/channel/[slug]/+page.ts +++ b/materialious/src/routes/(app)/channel/[slug]/+page.ts @@ -1,7 +1,7 @@ import { getChannel, getChannelContent } from '$lib/api/index'; import type { ChannelContentVideos, Video } from '$lib/api/model'; -import { excludeDuplicateFeeds } from '$lib/misc.js'; -import { channelCacheStore } from '$lib/store.js'; +import { excludeDuplicateFeeds } from '$lib/misc'; +import { channelCacheStore } from '$lib/store'; import { error } from '@sveltejs/kit'; import { get } from 'svelte/store'; diff --git a/materialious/src/routes/(app)/search/[slug]/+page.svelte b/materialious/src/routes/(app)/search/[slug]/+page.svelte index 2e4c535e..86086d34 100644 --- a/materialious/src/routes/(app)/search/[slug]/+page.svelte +++ b/materialious/src/routes/(app)/search/[slug]/+page.svelte @@ -5,7 +5,7 @@ import { _ } from '$lib/i18n'; import InfiniteLoading, { type InfiniteEvent } from 'svelte-infinite-loading'; import ItemsList from '$lib/components/ItemsList.svelte'; - import type { SearchOptions, SearchResults } from '$lib/api/model.js'; + import type { SearchOptions, SearchResults } from '$lib/api/model'; let { data } = $props(); diff --git a/materialious/src/routes/(app)/watch/[slug]/+page.svelte b/materialious/src/routes/(app)/watch/[slug]/+page.svelte index 8a0dde58..c1d89904 100644 --- a/materialious/src/routes/(app)/watch/[slug]/+page.svelte +++ b/materialious/src/routes/(app)/watch/[slug]/+page.svelte @@ -39,8 +39,8 @@ import LikesDislikes from '$lib/components/watch/LikesDislikes.svelte'; import Comment from '$lib/components/watch/Comment.svelte'; import { expandSummery, isYTBackend } from '$lib/misc'; - import { humanizeSeconds, relativeTimestamp } from '$lib/time.js'; - import { getWatchDetails } from '$lib/watch.js'; + import { humanizeSeconds, relativeTimestamp } from '$lib/time'; + import { getWatchDetails } from '$lib/watch'; import { page } from '$app/state'; let { data = $bindable() } = $props(); diff --git a/materialious/src/routes/+layout.ts b/materialious/src/routes/+layout.ts index 4bb7c72a..4fd98fb5 100644 --- a/materialious/src/routes/+layout.ts +++ b/materialious/src/routes/+layout.ts @@ -18,8 +18,8 @@ import { get, type Writable } from 'svelte/store'; import { Capacitor } from '@capacitor/core'; import { Preferences } from '@capacitor/preferences'; import { deserialize } from '@macfja/serializer'; -import { isYTBackend } from '$lib/misc.js'; -import { isOwnBackend } from '$lib/shared/index.js'; +import { isYTBackend } from '$lib/misc'; +import { isOwnBackend } from '$lib/shared/index'; export const ssr = false; export const prerender = false; diff --git a/materialious/src/routes/api/poToken/+server.ts b/materialious/src/routes/api/poToken/+server.ts index 7f3263ce..fc6c1180 100644 --- a/materialious/src/routes/api/poToken/+server.ts +++ b/materialious/src/routes/api/poToken/+server.ts @@ -3,7 +3,7 @@ import type { IGetChallengeResponse } from 'youtubei.js'; import BG, { buildURL, GOOG_API_KEY, USER_AGENT, type WebPoSignalOutput } from 'bgutils-js'; import { error } from '@sveltejs/kit'; import z from 'zod'; -import { isOwnBackend } from '$lib/shared/index.js'; +import { isOwnBackend } from '$lib/shared/index'; const zPoTokenGenSchema = z.object({ requestKey: z.string(), diff --git a/materialious/src/routes/api/user/create/+server.ts b/materialious/src/routes/api/user/create/+server.ts index 25062b7a..c1cf418b 100644 --- a/materialious/src/routes/api/user/create/+server.ts +++ b/materialious/src/routes/api/user/create/+server.ts @@ -1,8 +1,8 @@ import { isOwnBackend } from '$lib/shared'; -import { createUser } from '$lib/server/user.js'; +import { createUser } from '$lib/server/user'; import { error } from '@sveltejs/kit'; import z from 'zod'; -import { setAuthCookie } from '$lib/server/misc.js'; +import { setAuthCookie } from '$lib/server/misc'; import { verifyCaptcha } from '$lib/server/captcha'; const zUserCreate = z.object({ diff --git a/materialious/src/routes/api/user/isLoggedIn/+server.ts b/materialious/src/routes/api/user/isLoggedIn/+server.ts index f43a8ad7..6071c783 100644 --- a/materialious/src/routes/api/user/isLoggedIn/+server.ts +++ b/materialious/src/routes/api/user/isLoggedIn/+server.ts @@ -1,4 +1,4 @@ -import { getUser } from '$lib/server/user.js'; +import { getUser } from '$lib/server/user'; import { error } from '@sveltejs/kit'; export async function GET({ locals }) { diff --git a/materialious/src/routes/api/user/login/+server.ts b/materialious/src/routes/api/user/login/+server.ts index e45b07a8..39f4817e 100644 --- a/materialious/src/routes/api/user/login/+server.ts +++ b/materialious/src/routes/api/user/login/+server.ts @@ -3,7 +3,7 @@ import { error, json } from '@sveltejs/kit'; import z from 'zod'; import { isOwnBackend } from '$lib/shared'; import { setAuthCookie } from '$lib/server/misc'; -import { verifyCaptcha } from '$lib/server/captcha.js'; +import { verifyCaptcha } from '$lib/server/captcha'; const zUserLogin = z.object({ username: z.string(),