Last active 1758735168

Web UI and updater for `yt-dlp`, since video sites regularly change their layouts, frequent updates of yt-dlp are required to keep up. Automatic nightly build of MeTube looks for a new version of `yt-dlp`, and if one exists, the build pulls it and publishes an updated docker image. Therefore, in order to keep up with the changes, it's recommended that you update your MeTube container regularly with the latest image. Install watchtower to auto update the Metube container, download queue will continue after container update.

App

Z revised this gist 1758735167. Go to revision

No changes

Z revised this gist 1758735105. Go to revision

No changes

Z revised this gist 1758735030. Go to revision

No changes

Z revised this gist 1758734757. Go to revision

No changes

Z revised this gist 1758734693. Go to revision

No changes

Z revised this gist 1758734611. Go to revision

No changes

Z revised this gist 1758734442. Go to revision

No changes

Z revised this gist 1758734421. Go to revision

No changes

Z revised this gist 1758734374. Go to revision

1 file changed, 116 insertions

metube-install.sh(file created)

@@ -0,0 +1,116 @@
1 + # metube.install: $app_domain $app_port $@
2 + alias mt.install="metube.install mt.$org_domain 8081 $MEDIA_PATH/YT/Download/"
3 + # uses yt-dlp - A feature-rich command-line audio/video downloader - https://github.com/yt-dlp/yt-dlp
4 + metube.install(){
5 +
6 + # Config #
7 + app_name="mt" # App Name
8 + app_repo_url="https://github.com/alexta69/metube" # App Codebase
9 + app_version="latest"
10 + app_domain="${1:-"$app_name.$org_domain"}" # Unique app domain
11 + app_port="${2:-"8081"}" # App Port
12 + db_port="$((app_port - 1))" # DB Port
13 + container_name="$app_name-$app_port"
14 + app_domain_filename="$(echo $app_domain | tr "." "-")"
15 + app_path="/data/${app_domain_filename}"
16 + data_path="${3:-"$app_path/${app_name}_data"}"
17 + code_path="$app_path/$(basename $app_repo_url)"
18 + app_container_config="$code_path/docker-compose.yml"
19 +
20 + # Setup paths #
21 + mkdir -p "$app_path"
22 + echo cd "$app_path"
23 + cd "$app_path"
24 + if [ ! $? == "0" ];then
25 + err "Failed to cd \"$app_path\""
26 + return 1
27 + fi
28 +
29 + # Install App #
30 + echo git clone "$app_repo_url"
31 + git clone "$app_repo_url"
32 + cd "$code_path"
33 + if [ ! $? == "0" ];then
34 + err "Failed to cd \"$code_path\""
35 + return 1
36 + fi
37 +
38 + # Create folder $data_path
39 + echo sudo mkdir -p "$data_path"
40 + sudo mkdir -p "$data_path"
41 + sudo mkdir -p "$data_path/Audio"
42 + sudo mkdir -p "${app_path}/cookies"
43 +
44 +
45 + # Set permissions $data_path
46 + #echo sudo chown -R 1000:1000 "$data_path"
47 + #sudo chown -R 1000:1000 "$data_path"
48 +
49 + # Make
50 + #echo sudo docker build -t $app_name-$app_version .
51 + #time sudo docker build -t $app_name-$app_version .
52 +
53 + # Contain App. Write docker-compose config. 4
54 + tee "$app_container_config" > /dev/null <<EOF
55 + services:
56 + metube:
57 + container_name: $container_name
58 + image: "ghcr.io/alexta69/metube"
59 + environment:
60 + DEFAULT_THEME: "auto"
61 + DOWNLOAD_DIR: "/downloads"
62 + AUDIO_DOWNLOAD_DIR: "/downloads/Audio"
63 + #PUBLIC_HOST_URL: "$app_domain"
64 + #PUBLIC_HOST_AUDIO_URL: "audio.$app_domain"
65 + ENABLE_ACCESSLOG: "true"
66 + YTDL_OPTIONS_FILE: "/downloads/ytdl-options.json"
67 + MAX_CONCURRENT_DOWNLOADS: "1"
68 + DOWNLOAD_DIRS_INDEXABLE: true
69 + ports:
70 + - "$app_port:8081"
71 + restart: always
72 + volumes:
73 + - "${data_path}:/downloads"
74 + - "${app_path}/cookies:/cookies"
75 + - "${app_path}/ytdl-options.json:/downloads/ytdl-options.json"
76 + labels:
77 + - "com.centurylinklabs.watchtower.enable=true"
78 + - "com.centurylinklabs.watchtower.monitor-only=true"
79 + EOF
80 +
81 + tee "$app_path/ytdl-options.json" > /dev/null <<EOF
82 + {
83 + "sleep_interval":0,
84 + "max_sleep_interval":0,
85 + "sleep_interval_requests":0,
86 + "cookiefile":"/cookies/cookies.txt"
87 + }
88 + EOF
89 +
90 + echo cat ./docker-compose.yml
91 + cat ./docker-compose.yml
92 +
93 + echo cat "$app_path/ytdl-options.json"
94 + cat "$app_path/ytdl-options.json"
95 +
96 + # Run App. LIVE!
97 + echo Running $app_name container in the background.
98 +
99 + echo sudo docker-compose pull
100 + sudo docker-compose pull
101 +
102 + echo sudo docker-compose down
103 + sudo docker-compose down
104 +
105 + rm -v $MEDIA_PATH/YT/Download/.metube/pending
106 + rm -v $MEDIA_PATH/YT/Download/.metube/queue
107 + rm -v $MEDIA_PATH/YT/Download/.metube/queue-shm
108 + rm -v $MEDIA_PATH/YT/Download/.metube/queue-wal
109 +
110 + echo open http://$(host.ip):$app_port
111 +
112 + echo sudo docker-compose up -d
113 + sudo docker-compose up -d
114 +
115 + }
116 + # ---
Newer Older