Остання активність 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
metube-install.sh Неформатований
1# metube.install: $app_domain $app_port $@
2alias 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
4metube.install(){
5
6# Config #
7app_name="mt" # App Name
8app_repo_url="https://github.com/alexta69/metube" # App Codebase
9app_version="latest"
10app_domain="${1:-"$app_name.$org_domain"}" # Unique app domain
11app_port="${2:-"8081"}" # App Port
12db_port="$((app_port - 1))" # DB Port
13container_name="$app_name-$app_port"
14app_domain_filename="$(echo $app_domain | tr "." "-")"
15app_path="/data/${app_domain_filename}"
16data_path="${3:-"$app_path/${app_name}_data"}"
17code_path="$app_path/$(basename $app_repo_url)"
18app_container_config="$code_path/docker-compose.yml"
19
20# Setup paths #
21mkdir -p "$app_path"
22echo cd "$app_path"
23cd "$app_path"
24if [ ! $? == "0" ];then
25 err "Failed to cd \"$app_path\""
26 return 1
27fi
28
29# Install App #
30echo git clone "$app_repo_url"
31git clone "$app_repo_url"
32cd "$code_path"
33if [ ! $? == "0" ];then
34 err "Failed to cd \"$code_path\""
35 return 1
36fi
37
38# Create folder $data_path
39echo sudo mkdir -p "$data_path"
40sudo mkdir -p "$data_path"
41sudo mkdir -p "$data_path/Audio"
42sudo 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
54tee "$app_container_config" > /dev/null <<EOF
55services:
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"
79EOF
80
81tee "$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}
88EOF
89
90echo cat ./docker-compose.yml
91cat ./docker-compose.yml
92
93echo cat "$app_path/ytdl-options.json"
94cat "$app_path/ytdl-options.json"
95
96# Run App. LIVE!
97echo Running $app_name container in the background.
98
99echo sudo docker-compose pull
100sudo docker-compose pull
101
102echo sudo docker-compose down
103sudo docker-compose down
104
105rm -v $MEDIA_PATH/YT/Download/.metube/pending
106rm -v $MEDIA_PATH/YT/Download/.metube/queue
107rm -v $MEDIA_PATH/YT/Download/.metube/queue-shm
108rm -v $MEDIA_PATH/YT/Download/.metube/queue-wal
109
110echo open http://$(host.ip):$app_port
111
112echo sudo docker-compose up -d
113sudo docker-compose up -d
114
115}
116# ---
117