From a18e75dae6ccebb7f3b355de8bfbc4e522a460f4 Mon Sep 17 00:00:00 2001 From: Key Date: Tue, 21 Apr 2026 21:09:43 +0100 Subject: [PATCH] FileUpload: add video proxy (#1005) --- src/equicordplugins/fileUpload/settings.tsx | 7 +++---- src/equicordplugins/fileUpload/utils/upload.ts | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/equicordplugins/fileUpload/settings.tsx b/src/equicordplugins/fileUpload/settings.tsx index d898d87a4..14980ea55 100644 --- a/src/equicordplugins/fileUpload/settings.tsx +++ b/src/equicordplugins/fileUpload/settings.tsx @@ -40,9 +40,8 @@ const litterboxOptions = [ ]; const embedProxyOptions = [ - { label: "x266.mov", value: "x266", default: true }, - { label: "discord.nfp.is", value: "nfp" }, - { label: "embeddr.top", value: "embeddr" } + { label: "CORS Proxy", value: "cors", default: true }, + { label: "discord.nfp.is", value: "nfp" } ]; export const settings = definePluginSettings({ @@ -213,7 +212,7 @@ export const settings = definePluginSettings({ type: OptionType.SELECT, description: "Embed helper service to wrap uploaded video links.", options: embedProxyOptions, - default: "x266", + default: "cors", hidden: true }, corsProxyUrl: { diff --git a/src/equicordplugins/fileUpload/utils/upload.ts b/src/equicordplugins/fileUpload/utils/upload.ts index a40413872..48ba36891 100644 --- a/src/equicordplugins/fileUpload/utils/upload.ts +++ b/src/equicordplugins/fileUpload/utils/upload.ts @@ -38,7 +38,7 @@ function toProxyUrl(url: string): string { let isUploading = false; type UploadPhase = "idle" | "preparing" | "uploading" | "retrying" | "success" | "failed" | "cancelled"; -type EmbedProxyService = "x266" | "nfp" | "embeddr"; +type EmbedProxyService = "cors" | "nfp"; export interface UploadProgressState { phase: UploadPhase; @@ -699,7 +699,7 @@ const EXE_BLOCKED_SERVICES = new Set([ function getEmbedProxyService(): EmbedProxyService { const service = settings.store.embedProxyService; - return service === "nfp" || service === "embeddr" ? service : "x266" + return service === "nfp" ? service : "cors"; } @@ -723,13 +723,12 @@ function applyEmbedProxy(url: string): string { } switch (service) { - case "x266": - return `https://x266.mov/e/${url}`; + case "cors": + return toProxyUrl(url); case "nfp": return `https://discord.nfp.is/?v=${encodeURIComponent(url)}`; - case "embeddr": default: - return `https://embeddr.top/${url}`; + return toProxyUrl(url); } }