Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ ADD --checksum=sha256:5600024376f572a557870a5eb0afb1e5961636bef4e1e22132025467d0
CMD ["node", ".output/worker/index.mjs"]

FROM scratch AS media-tools
ADD --checksum=sha256:58162f9bfdc27458ea47bfcb311cf47028f17d8154a8bf7d689861d46399230a \
https://github.com/yt-dlp/yt-dlp/releases/download/2026.08.19/yt-dlp_linux \
ADD --checksum=sha256:249ddb058234276bc449b9cd9492aad9f133bda5923c61a9e39983ae114ef17d \
https://github.com/yt-dlp/yt-dlp/releases/download/2026.11.23/yt-dlp_linux \
/yt-dlp-amd64
ADD --checksum=sha256:b16e4dab368a816cd05d477d698a605a6ae87ccee1c8ffd38fa21d7254141fcc \
https://github.com/yt-dlp/yt-dlp/releases/download/2026.08.19/yt-dlp_linux_aarch64 \
ADD --checksum=sha256:fb847a2e4a9ddc8cf5fcfb4bb7f42ba8969ecf72068def0278074f9d300bd13c \
https://github.com/yt-dlp/yt-dlp/releases/download/2026.11.23/yt-dlp_linux_aarch64 \
/yt-dlp-arm64

FROM runtime AS media-worker
Expand Down
2 changes: 1 addition & 1 deletion docs/media-downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Live streams, authenticated sources, private playlists, ZIP exports, and subscri

## Running the worker

Compose builds the `media-worker` target for amd64 or arm64. It includes yt-dlp 2026.08.19, ffmpeg, ffprobe, and Node. yt-dlp release downloads are checksum-verified. Update the version and both checksums in `Dockerfile` together when upgrading.
Compose builds the `media-worker` target for amd64 or arm64. It includes yt-dlp 2026.11.23, ffmpeg, ffprobe, and Node. yt-dlp release downloads are checksum-verified. Update the version and both checksums in `Dockerfile` together when upgrading.

The worker has a separate disk volume, `media_scratch`, and does not load the background-removal model. Budget at least 16 GB of free disk for scratch data plus space for RustFS outputs. The scratch limit is monitored per task; the named volume does not impose a filesystem quota. The worker runs as `nobody` with a 2 GB memory limit and two CPUs in Compose.

Expand Down
5 changes: 4 additions & 1 deletion src/modules/mediaDownloads/components/DownloadSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export function BatchSettings(props: {
simple?: boolean;
}) {
return (
<fieldset disabled={props.disabled} class="grid gap-3 disabled:opacity-60 sm:grid-cols-3">
<fieldset
disabled={props.disabled}
class="grid min-w-0 grid-cols-1 gap-3 disabled:opacity-60 sm:grid-cols-3"
>
<label class="flex flex-col gap-1 text-sm">
Download
<select
Expand Down
3 changes: 2 additions & 1 deletion src/modules/mediaDownloads/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ export class MediaError extends Error {
constructor(
public readonly code: "unavailable" | "needs_selection" | "limit" | "network" | "worker_lost",
message: string,
options?: ErrorOptions,
) {
super(message);
super(message, options);
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/modules/mediaDownloads/ytDlpAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ export function normalizeMetadata(value: unknown): MediaMetadata {
};
}

/** Maps process stderr to a user-facing error, keeping the raw tail as `cause` for worker logs. */
function failureFromOutput(output: string) {
const options = { cause: output.trim() };
if (/Requested format is not available/i.test(output))
return new MediaError(
"needs_selection",
"The selected format is no longer available. Refresh formats and choose again.",
options,
);
if (
/unavailable|private video|removed|not available|sign in|unsupported url|no video formats|copyright|HTTP Error 403|HTTP Error 404/i.test(
Expand All @@ -103,12 +106,18 @@ function failureFromOutput(output: string) {
return new MediaError(
"unavailable",
"The source is unavailable, unsupported, or requires authentication.",
options,
);
if (/larger than max|File too large|No space left/i.test(output))
return new MediaError("limit", "The media exceeds the download or scratch-disk limit.");
return new MediaError(
"limit",
"The media exceeds the download or scratch-disk limit.",
options,
);
return new MediaError(
"network",
"The source could not be downloaded. It may be temporarily unavailable or rate limited.",
options,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/routes/_auth/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Route = createFileRoute("/_auth/sign-in")({

function RouteComponent() {
return (
<div class="flex h-full items-center justify-center p-4">
<div class="flex min-h-dvh items-center justify-center p-4">
<div class="max-w-sm grow">
<LoginForm />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/_auth/sign-up.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Route = createFileRoute("/_auth/sign-up")({

function RouteComponent() {
return (
<div class="flex h-full items-center justify-center p-4">
<div class="flex min-h-dvh items-center justify-center p-4">
<div class="max-w-sm grow">
<SignupForm />
</div>
Expand Down
Loading