aboutsummaryrefslogtreecommitdiffstats
path: root/core/entrypoint.sh
blob: 708ba030d5aca2e1810d4878d4e246e545fe04c5 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env sh

## Config
if [ ! -d "/root/.youtube-local" ]; then
    # make dir
    install -d /root/.youtube-local

    # generate config
    cat > /root/.youtube-local/settings.txt <<- EOF
# 0 - Off
# 1 - On, except video
# 2 - On, including video (see warnings)
route_tor = $ROUTE_TOR

tor_port = $TOR_PORT

tor_control_port = TOR_CONTROL_PORT

port_number = 8080

# This will allow others to connect to your Youtube Local instance as a website.
# For security reasons, enabling this is not recommended.
allow_foreign_addresses = $ALLOW_FOREIGN_ADDRESSES

# 0 - off by default
# 1 - only manually created subtitles on by default
# 2 - enable even if automatically generated is all that's available
subtitles_mode = $SUBTITLES_MODE

# ISO 639 language code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
subtitles_language = $SUBTITLES_LANG

# 0 - Related videos disabled
# 1 - Related videos always shown
# 2 - Related videos hidden; shown by clicking a button
related_videos_mode = $RELATED_VIDEOS_MODE

# 0 - Video comments disabled
# 1 - Video comments always shown
# 2 - Video comments hidden; shown by clicking a button
comments_mode = $COMMENTS_MODE

enable_comment_avatars = $ENABLE_COMMENTS_AVATARS

# 0 to sort by top
# 1 to sort by newest
default_comment_sorting = $DEFAULT_COMMENT_SORTING

theater_mode = $THEATER_MODE

default_resolution = $DEFAULT_RESOLUTION

use_video_hotkeys = $USE_VIDEO_HOTKEYS

proxy_images = $PROXY_IMAGES

use_comments_js = $USE_COMMENTS_JS

use_sponsorblock_js = $USE_SPONSORBLOCK_JS

theme = $THEME

font = $FONT

embed_page_mode = $EMBED_PAGE_MODE

autocheck_subscriptions = $AUTOCHECK_SUBSCRIPTIONS

# Developer use to debug 403s
gather_googlevideo_domains = $GATHER_GOOGLEVIDEO_DOMAINS

# Save all responses from youtube for debugging
debugging_save_responses = $DEBUGGING_SAVE_RESPONSES

# Do not change, remove, or comment out this value, or else your settings may be lost or corrupted
settings_version = 3
EOF
fi

if [ "$ROUTE_TOR" = 1 ] || [ "$ROUTE_TOR" = 2 ]; then
  cat > /etc/torrc <<- EOF
Log notice stdout
SocksPort 9050 # Default: Bind to localhost:9050 for local connections.
EOF
  tor -f /etc/torrc --runasdaemon 1
fi

exec /usr/bin/python3 /srv/app/server.py