mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-07 14:23:07 +00:00
streamlink-webui (#4262)
* 'Add new script' * Update streamlink-webui.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
This commit is contained in:
parent
0f19440864
commit
e7d4630fa5
73
ct/streamlink-webui.sh
Normal file
73
ct/streamlink-webui.sh
Normal file
@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/CrazyWolf13/streamlink-webui
|
||||
|
||||
APP="streamlink-webui"
|
||||
var_tags="${var_tags:-download,streaming}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-10}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /opt/streamlink-webui ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/CrazyWolf13/streamlink-webui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop ${APP}
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
rm -rf /opt/${APP}
|
||||
NODE_VERSION="22"
|
||||
NODE_MODULE="npm@latest,yarn@latest"
|
||||
install_node_and_modules
|
||||
setup_uv
|
||||
fetch_and_deploy_gh_release "CrazyWolf13/streamlink-webui"
|
||||
|
||||
msg_info "Updating $APP to v${RELEASE}"
|
||||
$STD uv venv /opt/"${APPLICATION}"/backend/src/.venv
|
||||
source /opt/"${APPLICATION}"/backend/src/.venv/bin/activate
|
||||
$STD uv pip install -r /opt/streamlink-webui/backend/src/requirements.txt --python=/opt/"${APPLICATION}"/backend/src/.venv
|
||||
cd /opt/"${APPLICATION}"/frontend/src
|
||||
$STD yarn install
|
||||
$STD yarn build
|
||||
chmod +x /opt/"${APPLICATION}"/start.sh
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
|
||||
msg_info "Starting $APP"
|
||||
systemctl start ${APP}
|
||||
msg_ok "Started $APP"
|
||||
|
||||
msg_ok "Update Successful"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||
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 "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}"
|
40
frontend/public/json/streamlink-webui.json
Normal file
40
frontend/public/json/streamlink-webui.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "Streamlink WebUI",
|
||||
"slug": "streamlink-webui",
|
||||
"categories": [
|
||||
11
|
||||
],
|
||||
"date_created": "2025-05-05",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8000,
|
||||
"documentation": "https://github.com/CrazyWolf13/streamlink-webui",
|
||||
"config_path": "/opt/streamlink-webui.env",
|
||||
"website": "https://github.com/CrazyWolf13/streamlink-webui",
|
||||
"logo": null,
|
||||
"description": "a simple web-ui to the well-known streamlink cli application, which allows you to save twitch streams to your local disk.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/streamlink-webui.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 5,
|
||||
"os": "Debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": "null",
|
||||
"password": "null"
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "This app requires a Twitch cliend_ID and client_secret, set it in the config file. Look in the application documentation on how to obtain it.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
66
install/streamlink-webui-install.sh
Normal file
66
install/streamlink-webui-install.sh
Normal file
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/CrazyWolf13/streamlink-webui
|
||||
|
||||
# Import Functions und Setup
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
NODE_VERSION="22"
|
||||
NODE_MODULE="npm@latest,yarn@latest"
|
||||
install_node_and_modules
|
||||
setup_uv
|
||||
fetch_and_deploy_gh_release "CrazyWolf13/streamlink-webui"
|
||||
|
||||
msg_info "Setup ${APPLICATION}"
|
||||
mkdir -p "/opt/${APPLICATION}-download"
|
||||
$STD uv venv /opt/"${APPLICATION}"/backend/src/.venv
|
||||
source /opt/"${APPLICATION}"/backend/src/.venv/bin/activate
|
||||
$STD uv pip install -r /opt/streamlink-webui/backend/src/requirements.txt --python=/opt/"${APPLICATION}"/backend/src/.venv
|
||||
cd /opt/"${APPLICATION}"/frontend/src
|
||||
$STD yarn install
|
||||
$STD yarn build
|
||||
chmod +x /opt/"${APPLICATION}"/start.sh
|
||||
msg_ok "Setup ${APPLICATION}"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/opt/"${APPLICATION}".env
|
||||
CLIENT_ID='your_client_id'
|
||||
CLIENT_SECRET='your_client_secret'
|
||||
DOWNLOAD_PATH='/opt/streamlink-webui-download'
|
||||
# BASE_URL='https://sub.domain.com' \
|
||||
# REVERSE_PROXY=True \
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/"${APPLICATION}".service
|
||||
[Unit]
|
||||
Description=${APPLICATION} Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/opt/${APPLICATION}.env
|
||||
WorkingDirectory=/opt/${APPLICATION}/backend/src
|
||||
ExecStart=/bin/bash -c 'source /opt/${APPLICATION}/backend/src/.venv/bin/activate && exec /opt/${APPLICATION}/start.sh'
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now "${APPLICATION}"
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
Loading…
x
Reference in New Issue
Block a user