Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
refactor: limit all log messages to 5k characters max
NTFSvolume0159a998b845
diff --git a/cyberdrop_dl/env.py b/cyberdrop_dl/env.pyindex 5906f9a82..e8235d57c 100644--- a/cyberdrop_dl/env.py+++ b/cyberdrop_dl/env.py@@ -22,7 +22,7 @@ FORCE_PORTRAIT_MODE = bool(_env("PORTRAIT_MODE") or RUNNING_IN_TERMUX)DEBUG_LOG_FOLDER = _env("DEBUG_LOG_FOLDER")-MAX_CRAWLER_ERRORS = int(_env("MAX_CRAWLER_ERRORS") or 10)+MAX_LOG_MSG_LENGTH = int(_env("MAX_LOG_MSG_LENGTH") or 0) or 5_000DEBUG_MODE = bool(_env("DEBUG_MODE")or DEBUG_LOG_FOLDERdiff --git a/cyberdrop_dl/logs.py b/cyberdrop_dl/logs.pyindex e3af7139c..36d372067 100644--- a/cyberdrop_dl/logs.py+++ b/cyberdrop_dl/logs.py@@ -21,7 +21,7 @@ from rich.text import Text, TextTypefrom cyberdrop_dl import envfrom cyberdrop_dl.constants import MAIN_LOG_FILEfrom cyberdrop_dl.exceptions import CDLConfigRuntimeErrorsGroup-from cyberdrop_dl.utils import dates, enter_context+from cyberdrop_dl.utils import dates, enter_context, truncated_previewif TYPE_CHECKING:import datetime@@ -111,9 +111,12 @@ class CDLFormater(logging.Formatter):def formatMessage(self, record: logging.LogRecord) -> str: # noqa: N802if record.name.startswith("cyberdrop_dl"):- return self._CDL_FORMAT.format(record)+ content = self._CDL_FORMAT.format(record)- return self._style.format(record)+ else:+ content = self._style.format(record)++ return truncated_preview(content, env.MAX_LOG_MSG_LENGTH)class LogHandler(RichHandler):