mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-17 02:22:49 +02:00
Add youtarr (ct)
This commit is contained in:
1 parent
769cf5f4b5
commit
26883e56b9
2 files changed
+160
No files matched your search
@@ -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}"
|
||||
@@ -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 <<EOF >/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 <<EOF >/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
|
||||
Reference in new issue
Block a user