2 Commits

Author SHA1 Message Date
Alex Shnitman
9df7776c79 add BgUtils POT Provider (closes #886) 2026-02-03 23:02:46 +02:00
AutoUpdater
c28cedacb7 upgrade yt-dlp from 2026.1.29 to 2026.1.31 2026-02-01 00:13:59 +00:00
4 changed files with 57 additions and 12 deletions

View File

@@ -3,10 +3,28 @@ FROM node:lts-alpine AS builder
WORKDIR /metube WORKDIR /metube
COPY ui ./ COPY ui ./
RUN corepack enable && corepack prepare pnpm --activate RUN corepack enable && corepack prepare pnpm --activate
RUN pnpm install && pnpm run build RUN CI=true pnpm install && pnpm run build
FROM python:3.13-alpine FROM rust:1.93-slim AS bgutil-builder
WORKDIR /src
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
ca-certificates \
build-essential \
pkg-config \
libssl-dev \
python3 && \
BGUTIL_TAG="$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases/latest | sed 's#.*/tag/##')" && \
curl -L "https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/archive/refs/tags/${BGUTIL_TAG}.tar.gz" \
| tar -xz --strip-components=1 && \
cargo build --release
FROM python:3.13-slim
WORKDIR /app WORKDIR /app
@@ -16,13 +34,36 @@ COPY pyproject.toml uv.lock docker-entrypoint.sh ./
# Install dependencies # Install dependencies
RUN sed -i 's/\r$//g' docker-entrypoint.sh && \ RUN sed -i 's/\r$//g' docker-entrypoint.sh && \
chmod +x docker-entrypoint.sh && \ chmod +x docker-entrypoint.sh && \
apk add --update ffmpeg aria2 coreutils shadow su-exec curl tini deno gdbm-tools sqlite file && \ apt-get update && \
apk add --update --virtual .build-deps gcc g++ musl-dev uv && \ apt-get install -y --no-install-recommends \
ca-certificates \
ffmpeg \
unzip \
aria2 \
coreutils \
gosu \
curl \
tini \
file \
gdbmtool \
sqlite3 \
build-essential && \
curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/local/bin sh && \
UV_PROJECT_ENVIRONMENT=/usr/local uv sync --frozen --no-dev --compile-bytecode && \ UV_PROJECT_ENVIRONMENT=/usr/local uv sync --frozen --no-dev --compile-bytecode && \
apk del .build-deps && \ curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh -s -- -y && \
rm -rf /var/cache/apk/* && \ apt-get purge -y --auto-remove build-essential && \
rm -rf /var/lib/apt/lists/* && \
mkdir /.cache && chmod 777 /.cache mkdir /.cache && chmod 777 /.cache
COPY --from=bgutil-builder /src/target/release/bgutil-pot /usr/local/bin/bgutil-pot
RUN BGUTIL_TAG="$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases/latest | sed 's#.*/tag/##')" && \
PLUGIN_DIR="$(python3 -c 'import site; print(site.getsitepackages()[0])')" && \
curl -L -o /tmp/bgutil-ytdlp-pot-provider-rs.zip \
"https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases/download/${BGUTIL_TAG}/bgutil-ytdlp-pot-provider-rs.zip" && \
unzip -q /tmp/bgutil-ytdlp-pot-provider-rs.zip -d "${PLUGIN_DIR}" && \
rm /tmp/bgutil-ytdlp-pot-provider-rs.zip
COPY app ./app COPY app ./app
COPY --from=builder /metube/dist/metube ./ui/dist/metube COPY --from=builder /metube/dist/metube ./ui/dist/metube
@@ -40,4 +81,4 @@ EXPOSE 8081
ARG VERSION=dev ARG VERSION=dev
ENV METUBE_VERSION=$VERSION ENV METUBE_VERSION=$VERSION
ENTRYPOINT ["/sbin/tini", "-g", "--", "./docker-entrypoint.sh"] ENTRYPOINT ["/usr/bin/tini", "-g", "--", "./docker-entrypoint.sh"]

View File

@@ -13,9 +13,13 @@ if [ `id -u` -eq 0 ] && [ `id -g` -eq 0 ]; then
echo "Changing ownership of download and state directories to ${UID}:${GID}" echo "Changing ownership of download and state directories to ${UID}:${GID}"
chown -R "${UID}":"${GID}" /app "${DOWNLOAD_DIR}" "${STATE_DIR}" "${TEMP_DIR}" chown -R "${UID}":"${GID}" /app "${DOWNLOAD_DIR}" "${STATE_DIR}" "${TEMP_DIR}"
fi fi
echo "Starting BgUtils POT Provider"
gosu "${UID}":"${GID}" bgutil-pot server >/tmp/bgutil-pot.log 2>&1 &
echo "Running MeTube as user ${UID}:${GID}" echo "Running MeTube as user ${UID}:${GID}"
exec su-exec "${UID}":"${GID}" python3 app/main.py exec gosu "${UID}":"${GID}" python3 app/main.py
else else
echo "User set by docker; running MeTube as `id -u`:`id -g`" echo "User set by docker; running MeTube as `id -u`:`id -g`"
echo "Starting BgUtils POT Provider"
bgutil-pot server >/tmp/bgutil-pot.log 2>&1 &
exec python3 app/main.py exec python3 app/main.py
fi fi

View File

@@ -6,7 +6,7 @@ requires-python = ">=3.13"
dependencies = [ dependencies = [
"aiohttp", "aiohttp",
"python-socketio>=5.0,<6.0", "python-socketio>=5.0,<6.0",
"yt-dlp[default,curl-cffi]", "yt-dlp[default,curl-cffi,deno]",
"mutagen", "mutagen",
"curl-cffi", "curl-cffi",
"watchfiles", "watchfiles",

6
uv.lock generated
View File

@@ -928,11 +928,11 @@ wheels = [
[[package]] [[package]]
name = "yt-dlp" name = "yt-dlp"
version = "2026.1.29" version = "2026.1.31"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/42/b6/b401777f2fb16cb35bfc352079b8c5a60fbc8189c655539f51a9847d1e0b/yt_dlp-2026.1.29.tar.gz", hash = "sha256:12b489eb16828cc3fff1723f244992ebae8a5bf1ad75c8e9f01d729ae237ebb9", size = 3098668, upload-time = "2026-01-29T17:18:03.394Z" } sdist = { url = "https://files.pythonhosted.org/packages/93/b3/025d41aa2b5b814c0898a4c5b2a9aa210192f616738aac5a86ef5780f0f6/yt_dlp-2026.1.31.tar.gz", hash = "sha256:16767a3172cbb7183199f4db19e34b77b19e030ab7101b8f26d6c9e6af6f42ae", size = 3099993, upload-time = "2026-02-01T00:12:20.886Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/0f/1d/696538eb18a9da3dd4b7772162cb3a6537723a56426a7452b98201c04bfd/yt_dlp-2026.1.29-py3-none-any.whl", hash = "sha256:08d0a25aead160c4787cbd0d2e82a269c75c8dbcfbfa729ce45ad52a8375fa1d", size = 3297510, upload-time = "2026-01-29T17:18:01.369Z" }, { url = "https://files.pythonhosted.org/packages/98/67/d76cddb63710f88fb53f287b713f268579a85bfc81caacbb1b6048b60b85/yt_dlp-2026.1.31-py3-none-any.whl", hash = "sha256:81f8e70c0d111b9572420cfea0ba9b4c2ae783fa1a4237fa767eeb777d4c5a58", size = 3298976, upload-time = "2026-02-01T00:12:18.835Z" },
] ]
[package.optional-dependencies] [package.optional-dependencies]