From 0548e5e73a0e0e7eb3d6d95e398acfbbb8bde9bb Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Mon, 26 Feb 2024 17:36:49 +0300 Subject: [PATCH] changed logging_level to LOG_LEVEL --- .vscode/launch.json | 5 +++-- README.md | 6 +++--- app/Config.py | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 00142ba4..64a27dee 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,7 +23,7 @@ }, { "name": "Python: main.py", - "type": "python", + "type": "debugpy", "request": "launch", "program": "app/main.py", "console": "internalConsole", @@ -31,7 +31,8 @@ "YTP_CONFIG_PATH": "${workspaceFolder}/var/config", "YTP_DOWNLOAD_PATH": "${workspaceFolder}/var/downloads", "YTP_TEMP_PATH": "${workspaceFolder}/var/tmp", - "YTP_URL_HOST": "http://localhost:8081" + "YTP_URL_HOST": "http://localhost:8081", + "YTP_LOG_LEVEL": "DEBUG" } } ] diff --git a/README.md b/README.md index 06aab286..7607c7ee 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,9 @@ Certain values can be set via environment variables, using the `-e` parameter on * __YTP_KEEP_ARCHIVE__: Whether to keep history of downloaded videos to prevent downloading same file multiple times. Defaults to `true`. * __YTP_YTDL_DEBUG__: Whether to turn debug logging for the internal `yt-dlp` package. Defaults to `false`. * __YTP_ALLOW_MANIFESTLESS__: Allow `yt-dlp` to download live streams videos which are yet to be processed by YouTube. Defaults to `false` -* __YTP_HOST__: Which ip address to bind to. Defaults to `0.0.0.0`. +* __YTP_HOST__: Which IP address to bind to. Defaults to `0.0.0.0`. * __YTP_PORT__: Which port to bind to. Defaults to `8081`. -* __YTP_LOGGING_LEVEL__: Logging level. Defaults to `info`. +* __YTP_LOG_LEVEL__: Log level. Defaults to `info`. * __YTP_MAX_WORKERS__: How many works to use for downloads. Defaults to `1`. ## Running behind a reverse proxy @@ -130,7 +130,7 @@ Once there, you can use the yt-dlp command freely. ## Building and running locally -Make sure you have node.js and Python 3.11 installed. +Make sure you have `node.js` and Python `3.11+` installed. ```bash cd ytptube/frontend diff --git a/app/Config.py b/app/Config.py index 301999a8..0c6137b2 100644 --- a/app/Config.py +++ b/app/Config.py @@ -33,7 +33,7 @@ class Config: base_path: str = '' - logging_level: str = 'info' + log_level: str = 'info' allow_manifestless: bool = False @@ -110,9 +110,9 @@ class Config: if not self.url_prefix.endswith('/'): self.url_prefix += '/' - numeric_level = getattr(logging, self.logging_level.upper(), None) + numeric_level = getattr(logging, self.log_level.upper(), None) if not isinstance(numeric_level, int): - raise ValueError(f"Invalid log level: {self.logging_level}") + raise ValueError(f"Invalid log level: {self.log_level}") coloredlogs.install( level=numeric_level,