#!/usr/bin/env sh ## Config if [ ! -d "/root/.youtube-local" ]; then # make dir install -d /root/.yt-local # generate config cat > /root/.yt-local/settings.txt <<- EOF # Set app public mode, disabled by default app_public = ${APP_PUBLIC:-False} # Set URL of app for example: http://localhost app_url = "${APP_URL:-http://localhost}" # 0 - Off # 1 - On, except video # 2 - On, including video (see warnings) route_tor = ${ROUTE_TOR:-0} tor_port = ${TOR_PORT:-9050} tor_control_port = ${TOR_CONTROL_PORT:-9151} port_number = ${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:-True} # 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:-0} # ISO 639 language code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes subtitles_language = "${SUBTITLES_LANG:-en}" # 0 - Related videos disabled # 1 - Related videos always shown # 2 - Related videos hidden; shown by clicking a button related_videos_mode = ${RELATED_VIDEOS_MODE:-1} # 0 - Video comments disabled # 1 - Video comments always shown # 2 - Video comments hidden; shown by clicking a button comments_mode = ${COMMENTS_MODE:-1} enable_comment_avatars = ${ENABLE_COMMENTS_AVATARS:-True} # 0 to sort by top # 1 to sort by newest default_comment_sorting = ${DEFAULT_COMMENT_SORTING:-0} theater_mode = ${THEATER_MODE:-True} default_resolution = ${DEFAULT_RESOLUTION:-2160} codec_rank_h264 = ${CODEC_RANK_H264:-3} codec_rank_vp = ${CODEC_RANK_VP:-2} codec_rank_av1 = ${CODEC_RANK_AV1:-1} prefer_uni_sources = ${PREFER_UNI_SOURCES:-True} use_video_player = ${USE_VIDEO_PLAYER:-0} use_video_download = ${USE_VIDEO_DOWNLOAD:-0} proxy_images = ${PROXY_IMAGES:-True} use_comments_js = ${USE_COMMENTS_JS:-True} use_sponsorblock_js = ${USE_SPONSORBLOCK_JS:-False} theme = ${THEME:-0} font = ${FONT:-0} embed_page_mode = ${EMBED_PAGE_MODE:-True} autocheck_subscriptions = ${AUTOCHECK_SUBSCRIPTIONS:-True} # Developer use to debug 403s gather_googlevideo_domains = ${GATHER_GOOGLEVIDEO_DOMAINS:-False} # Save all responses from youtube for debugging debugging_save_responses = ${DEBUGGING_SAVE_RESPONSES:-False} # Do not change, remove, or comment out this value, or else your settings may be lost or corrupted settings_version = 3 EOF fi /entrypoint-tor.sh "$@" & cd /srv/app || exit exec gunicorn -b "0.0.0.0:${PORT_NUMBER:-8080}" --timeout "${GUNICORN_TIMEOUT:-30}" --workers "${GUNICORN_NUM_WORKERS:-4}" server:site_dispatch