From 26883e56b90740cc6d416dd204cac2dde0964dca Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 18:46:34 +0000 Subject: [PATCH] Add youtarr (ct) --- ct/youtarr.sh | 74 ++++++++++++++++++++++++++++++++ install/youtarr-install.sh | 86 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 ct/youtarr.sh create mode 100644 install/youtarr-install.sh diff --git a/ct/youtarr.sh b/ct/youtarr.sh new file mode 100644 index 000000000..f22b9d653 --- /dev/null +++ b/ct/youtarr.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/DialmasterOrg/Youtarr + +APP="Youtarr" +var_tags="${var_tags:-media;youtube;downloader}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-20}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_arm64="${var_arm64:-yes}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/youtarr ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Updating yt-dlp" + $STD yt-dlp -U + msg_ok "Updated yt-dlp" + + if check_for_gh_release "youtarr" "DialmasterOrg/Youtarr"; then + msg_info "Stopping Youtarr" + systemctl stop youtarr + msg_ok "Stopped Youtarr" + + NODE_VERSION="24" setup_nodejs + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "youtarr" "DialmasterOrg/Youtarr" "tarball" + + msg_info "Building Youtarr" + cd /opt/youtarr/client + $STD npm ci --ignore-scripts + $STD npm run build + rm -rf /opt/youtarr/client/node_modules + cd /opt/youtarr + $STD npm ci --omit=dev --ignore-scripts + mv /opt/youtarr/config/config.example.json /opt/youtarr/server/ + rm -rf /opt/youtarr/config + ln -sfn /opt/youtarr_data/config /opt/youtarr/config + msg_ok "Built Youtarr" + + msg_info "Starting Youtarr" + systemctl start youtarr + msg_ok "Started Youtarr" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Access it using the following URL:${CL}" +echo -e "${GATEWAY}${BGN}http://${IP}:3011${CL}" +echo -e "${INFO}${YW}First login asks for the setup token in /opt/youtarr_data/config/setup-token${CL}" diff --git a/install/youtarr-install.sh b/install/youtarr-install.sh new file mode 100644 index 000000000..b996571aa --- /dev/null +++ b/install/youtarr-install.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/DialmasterOrg/Youtarr + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + atomicparsley \ + python3 +msg_ok "Installed Dependencies" + +setup_ffmpeg +setup_mariadb +MARIADB_DB_NAME="youtarr" MARIADB_DB_USER="youtarr" setup_mariadb_db +NODE_VERSION="24" setup_nodejs +setup_uv + +msg_info "Installing Apprise" +UV_TOOL_BIN_DIR=/usr/local/bin $STD uv tool install apprise +msg_ok "Installed Apprise" + +fetch_and_deploy_gh_release "deno" "denoland/deno" "prebuild" "latest" "/usr/local/bin" "deno-$(arch_resolve "x86_64" "aarch64")-unknown-linux-gnu.zip" +fetch_and_deploy_gh_release "yt-dlp" "yt-dlp/yt-dlp" "singlefile" "latest" "/usr/local/bin" "yt-dlp_$(arch_resolve "linux" "linux_aarch64")" +fetch_and_deploy_gh_release "youtarr" "DialmasterOrg/Youtarr" "tarball" + +msg_info "Building Youtarr" +cd /opt/youtarr/client +$STD npm ci --ignore-scripts +$STD npm run build +rm -rf /opt/youtarr/client/node_modules +cd /opt/youtarr +$STD npm ci --omit=dev --ignore-scripts +msg_ok "Built Youtarr" + +msg_info "Configuring Youtarr" +mkdir -p /opt/youtarr_data/config /opt/youtarr_data/videos +# config/ is hard-wired next to the app and, with DATA_PATH set, also holds images/ and jobs/ - one symlink keeps all state out of the update wipe +mv /opt/youtarr/config/config.example.json /opt/youtarr/server/ +rm -rf /opt/youtarr/config +ln -sfn /opt/youtarr_data/config /opt/youtarr/config +cat </opt/youtarr_data/.env +PORT=3011 +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_NAME=youtarr +DB_USER=youtarr +DB_PASSWORD=${MARIADB_DB_PASS} +DATA_PATH=/opt/youtarr_data/videos +EOF +chmod 600 /opt/youtarr_data/.env +msg_ok "Configured Youtarr" + +msg_info "Creating Service" +cat </etc/systemd/system/youtarr.service +[Unit] +Description=Youtarr +After=network.target mariadb.service + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/youtarr +EnvironmentFile=/opt/youtarr_data/.env +ExecStart=/usr/bin/node server/server.js +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now youtarr +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc