Skip to content

Commit a0c1243

Browse files
MeTube (#9671)
* 'Add new script' * Update metube.json * Update metube.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Tobias <[email protected]>
1 parent 2799201 commit a0c1243

File tree

3 files changed

+244
-0
lines changed

3 files changed

+244
-0
lines changed

ct/metube.sh

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/alexta69/metube
7+
8+
APP="MeTube"
9+
var_tags="${var_tags:-media;youtube}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-10}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/metube ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
if [[ $(echo ":$PATH:" != *":/usr/local/bin:"*) ]]; then
33+
echo -e "\nexport PATH=\"/usr/local/bin:\$PATH\"" >>~/.bashrc
34+
source ~/.bashrc
35+
if ! command -v deno &>/dev/null; then
36+
export DENO_INSTALL="/usr/local"
37+
curl -fsSL https://deno.land/install.sh | $STD sh -s -- -y
38+
else
39+
$STD deno upgrade
40+
fi
41+
fi
42+
43+
if check_for_gh_release "metube" "alexta69/metube"; then
44+
msg_info "Stopping Service"
45+
systemctl stop metube
46+
msg_ok "Stopped Service"
47+
48+
msg_info "Backing up Old Installation"
49+
if [[ -d /opt/metube_bak ]]; then
50+
rm -rf /opt/metube_bak
51+
fi
52+
mv /opt/metube /opt/metube_bak
53+
msg_ok "Backup created"
54+
55+
fetch_and_deploy_gh_release "metube" "alexta69/metube" "tarball" "latest"
56+
57+
msg_info "Building Frontend"
58+
cd /opt/metube/ui
59+
$STD npm install
60+
$STD node_modules/.bin/ng build
61+
msg_ok "Built Frontend"
62+
63+
PYTHON_VERSION="3.13" setup_uv
64+
65+
msg_info "Installing Backend Requirements"
66+
cd /opt/metube
67+
$STD uv sync
68+
msg_ok "Installed Backend"
69+
70+
msg_info "Restoring .env"
71+
if [[ -f /opt/metube_bak/.env ]]; then
72+
cp /opt/metube_bak/.env /opt/metube/.env
73+
fi
74+
rm -rf /opt/metube_bak
75+
msg_ok "Restored .env"
76+
77+
if grep -q 'pipenv' /etc/systemd/system/metube.service; then
78+
msg_info "Patching systemd Service"
79+
cat <<EOF >/etc/systemd/system/metube.service
80+
[Unit]
81+
Description=Metube - YouTube Downloader
82+
After=network.target
83+
[Service]
84+
Type=simple
85+
WorkingDirectory=/opt/metube
86+
EnvironmentFile=/opt/metube/.env
87+
ExecStart=/opt/metube/.venv/bin/python3 app/main.py
88+
Restart=always
89+
User=root
90+
[Install]
91+
WantedBy=multi-user.target
92+
EOF
93+
msg_ok "Patched systemd Service"
94+
fi
95+
$STD systemctl daemon-reload
96+
msg_ok "Service Updated"
97+
98+
msg_info "Starting Service"
99+
systemctl start metube
100+
msg_ok "Started Service"
101+
msg_ok "Updated successfully!"
102+
fi
103+
exit
104+
}
105+
106+
start
107+
build_container
108+
description
109+
110+
msg_ok "Completed Successfully!\n"
111+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
112+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
113+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8081${CL}"

frontend/public/json/metube.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "MeTube",
3+
"slug": "metube",
4+
"categories": [
5+
11
6+
],
7+
"date_created": "2025-12-05",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8081,
12+
"documentation": "https://github.com/alexta69/metube/blob/master/README.md",
13+
"website": "https://github.com/alexta69/metube",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icon@master/webp/metube.webp",
15+
"config_path": "/opt/metube/.env",
16+
"description": "MeTube allows you to download videos from YouTube and dozens of other sites.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/metube.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 2048,
24+
"hdd": 10,
25+
"os": "debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": []
35+
}

install/metube-install.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/alexta69/metube
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt install -y \
18+
build-essential \
19+
aria2 \
20+
coreutils \
21+
musl-dev \
22+
ffmpeg
23+
msg_ok "Installed Dependencies"
24+
25+
PYTHON_VERSION="3.13" setup_uv
26+
NODE_VERSION="24" setup_nodejs
27+
28+
msg_info "Installing Deno"
29+
export DENO_INSTALL="/usr/local"
30+
curl -fsSL https://deno.land/install.sh | $STD sh -s -- -y
31+
[[ ":$PATH:" != *":/usr/local/bin:"* ]] &&
32+
echo -e "\nexport PATH=\"/usr/local/bin:\$PATH\"" >>~/.bashrc &&
33+
source ~/.bashrc
34+
msg_ok "Installed Deno"
35+
36+
fetch_and_deploy_gh_release "metube" "alexta69/metube" "tarball" "latest"
37+
38+
msg_info "Installing MeTube"
39+
cd /opt/metube/ui
40+
$STD npm ci
41+
$STD node_modules/.bin/ng build --configuration production
42+
cd /opt/metube
43+
$STD uv sync
44+
mkdir -p /opt/metube_downloads /opt/metube_downloads/.metube /opt/metube_downloads/music /opt/metube_downloads/videos
45+
cat <<EOF >/opt/metube/.env
46+
# Storage & Directories
47+
DOWNLOAD_DIR=/opt/metube_downloads
48+
AUDIO_DOWNLOAD_DIR=/opt/metube_downloads/music
49+
STATE_DIR=/opt/metube_downloads/.metube
50+
TEMP_DIR=/opt/metube_downloads
51+
52+
# Download Behavior
53+
DOWNLOAD_MODE=limited
54+
MAX_CONCURRENT_DOWNLOADS=3
55+
DELETE_FILE_ON_TRASHCAN=false
56+
DEFAULT_OPTION_PLAYLIST_STRICT_MODE=false
57+
DEFAULT_OPTION_PLAYLIST_ITEM_LIMIT=0
58+
59+
# File Naming & yt-dlp
60+
OUTPUT_TEMPLATE=%(title)s.%(ext)s
61+
OUTPUT_TEMPLATE_CHAPTER=%(title)s - %(section_number)s %(section_title)s.%(ext)s
62+
OUTPUT_TEMPLATE_PLAYLIST=%(playlist_title)s/%(title)s.%(ext)s
63+
YTDL_OPTIONS={"trim_file_name":200,"extractor_args":{"youtube":{"player_client":["default","-tv_simply"]}}}
64+
65+
# Custom Directories
66+
CUSTOM_DIRS=true
67+
CREATE_CUSTOM_DIRS=true
68+
69+
# Basic Setup
70+
DEFAULT_THEME=auto
71+
LOGLEVEL=INFO
72+
ENABLE_ACCESSLOG=false
73+
EOF
74+
msg_ok "Installed MeTube"
75+
76+
msg_info "Creating Service"
77+
cat <<EOF >/etc/systemd/system/metube.service
78+
[Unit]
79+
Description=Metube - YouTube Downloader
80+
After=network.target
81+
[Service]
82+
Type=simple
83+
WorkingDirectory=/opt/metube
84+
EnvironmentFile=/opt/metube/.env
85+
ExecStart=/opt/metube/.venv/bin/python3 app/main.py
86+
Restart=always
87+
User=root
88+
[Install]
89+
WantedBy=multi-user.target
90+
EOF
91+
systemctl enable -q --now metube
92+
msg_ok "Created Service"
93+
94+
motd_ssh
95+
customize
96+
cleanup_lxc

0 commit comments

Comments
 (0)