diff --git a/ct/yt-dlp-webui.sh b/ct/yt-dlp-webui.sh index 6e2240533..0b0e8d0bb 100644 --- a/ct/yt-dlp-webui.sh +++ b/ct/yt-dlp-webui.sh @@ -28,21 +28,20 @@ function update_script() { exit fi - msg_info "Updating yt-dlp" - $STD yt-dlp -U - msg_ok "Updated yt-dlp" + RELEASE=$(curl -fsSL https://api.github.com/repos/marcopiovanello/yt-dlp-web-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat /opt/yt-dlp-webui_version.txt)" ]] || [[ ! -f /opt/yt-dlp-webui_version.txt ]]; then + if [[ "${RELEASE}" != "$(cat ~/.yt-dlp-webui)" ]] || [[ ! -f ~/.yt-dlp-webui ]]; then msg_info "Stopping $APP" systemctl stop yt-dlp-webui msg_ok "Stopped $APP" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating yt-dlp" + $STD yt-dlp -U + msg_ok "Updated yt-dlp" + rm -rf /usr/local/bin/yt-dlp-webui -curl -fsSL "https://github.com/marcopiovanello/yt-dlp-web-ui/releases/download/v${RELEASE}/yt-dlp-webui_linux-amd64" -o "/usr/local/bin/yt-dlp-webui" - chmod +x /usr/local/bin/yt-dlp-webui - msg_ok "Updated $APP LXC" + fetch_and_deploy_gh_release "yt-dlp-webui" "marcopiovanello/yt-dlp-web-ui" "singlefile" "latest" "/usr/local/bin" "yt-dlp-webui_linux-amd64" msg_info "Starting $APP" systemctl start yt-dlp-webui @@ -60,4 +59,4 @@ 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 "${TAB}${GATEWAY}${BGN}http://${IP}:3033${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3033${CL}" diff --git a/install/yt-dlp-webui-install.sh b/install/yt-dlp-webui-install.sh index bf60599ac..cc04f2c52 100644 --- a/install/yt-dlp-webui-install.sh +++ b/install/yt-dlp-webui-install.sh @@ -17,17 +17,8 @@ msg_info "Installing Dependencies" $STD apt-get install -y ffmpeg msg_ok "Installed Dependencies" -msg_info "Installing ${APPLICATION}" -RELEASE=$(curl -fsSL https://api.github.com/repos/marcopiovanello/yt-dlp-web-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -curl -fsSL "https://github.com/marcopiovanello/yt-dlp-web-ui/releases/download/v${RELEASE}/yt-dlp-webui_linux-amd64" -o "/usr/local/bin/yt-dlp-webui" -chmod +x /usr/local/bin/yt-dlp-webui -echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" -msg_ok "Installed ${APPLICATION}" - -msg_info "Installing yt-dlp" -curl -fsSL "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp" -o "/usr/local/bin/yt-dlp" -chmod a+rx /usr/local/bin/yt-dlp -msg_ok "Installed yt-dlp" +fetch_and_deploy_gh_release "yt-dlp-webui" "marcopiovanello/yt-dlp-web-ui" "singlefile" "latest" "/usr/local/bin" "yt-dlp-webui_linux-amd64" +fetch_and_deploy_gh_release "yt-dlp" "yt-dlp/yt-dlp" "singlefile" "latest" "/usr/local/bin" "yt-dlp" msg_info "Setting up ${APPLICATION}" mkdir -p /opt/yt-dlp-webui