-
Notifications
You must be signed in to change notification settings - Fork 4
/
thewicklowwolf-init.sh
61 lines (49 loc) · 1.72 KB
/
thewicklowwolf-init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
echo -e "\033[1;32mTheWicklowWolf\033[0m"
echo -e "\033[1;34mChannelTube\033[0m"
echo "Initializing app..."
cat << 'EOF'
_____________________________________
.-'''''-.
.' `.
: :
: :
: _/| :
: =/_/ :
`._/ | .'
( / ,|...-'
\_/^\/||__
_/~ `""~`"` \_
__/ -'/ `-._ `\_\__
/ /-'` `\ \ \-.\
_____________________________________
Brought to you by TheWicklowWolf
_____________________________________
If you'd like to buy me a coffee:
https://buymeacoffee.com/thewicklow
EOF
echo "-----------------"
echo -e "\033[1mInstalled Versions\033[0m"
# Get the version of yt-dlp
echo -n "yt-dlp: "
pip show yt-dlp | grep Version: | awk '{print $2}'
# Get the version of ffmpeg
echo -n "FFmpeg: "
ffmpeg -version | head -n 1 | awk '{print $3}'
echo "-----------------"
PUID=${PUID:-1000}
PGID=${PGID:-1000}
echo "-----------------"
echo -e "\033[1mRunning with:\033[0m"
echo "PUID=${PUID}"
echo "PGID=${PGID}"
echo "-----------------"
# Create the required directories with the correct permissions
echo "Setting up directories.."
mkdir -p /channeltube/downloads /channeltube/audio_downloads /channeltube/config /channeltube/cache
chown -R ${PUID}:${PGID} /channeltube
# Set XDG_CACHE_HOME to use the cache directory
export XDG_CACHE_HOME=/channeltube/cache
# Start the application with the specified user permissions
echo "Running ChannelTube..."
exec su-exec ${PUID}:${PGID} gunicorn src.ChannelTube:app -c gunicorn_config.py