-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathyt-dlp
More file actions
executable file
·44 lines (37 loc) · 934 Bytes
/
yt-dlp
File metadata and controls
executable file
·44 lines (37 loc) · 934 Bytes
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
#!/usr/bin/env bash
###########
# Set PATH to include user installed packages
PY_BASE_VERSION=$(/opt/python/bin/python -V 2>&1 | awk '{print $2}' | cut -d. -f1,2)
CONFIG_PATH="${YTP_CONFIG_PATH:-/app/var/config}"
USER_SITE="${CONFIG_PATH}/python${PY_BASE_VERSION}-packages"
USER_SITE_BIN="${USER_SITE}/bin"
if [ -d "${USER_SITE_BIN}" ]; then
case ":${PATH}:" in
*:"${USER_SITE_BIN}":*)
;;
*)
if [ -n "${PATH}" ]; then
PATH="${USER_SITE_BIN}:${PATH}"
else
PATH="${USER_SITE_BIN}"
fi
;;
esac
export PATH
fi
if [ -d "${USER_SITE}" ]; then
case ":${PYTHONPATH}:" in
*:"${USER_SITE}":*)
;;
*)
if [ -n "${PYTHONPATH}" ]; then
PYTHONPATH="${USER_SITE}:${PYTHONPATH}"
else
PYTHONPATH="${USER_SITE}"
fi
;;
esac
export PYTHONPATH
fi
# Execute yt-dlp with passed arguments
exec /opt/python/bin/python -m yt_dlp "${@}"