Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
refactor: use global time variables
NTFSvolumed0cba63787b1
diff --git a/cyberdrop_dl/profiling.py b/cyberdrop_dl/profiling.pyindex c09c0ecf2..f11368a75 100644--- a/cyberdrop_dl/profiling.py+++ b/cyberdrop_dl/profiling.py@@ -8,12 +8,12 @@ import osimport pstatsimport shutilfrom contextlib import contextmanager-from datetime import datetimefrom pathlib import Pathfrom tempfile import TemporaryDirectoryfrom typing import TYPE_CHECKINGfrom cyberdrop_dl import env+from cyberdrop_dl.utils import constantsif TYPE_CHECKING:from collections.abc import Callable@@ -65,7 +65,7 @@ def destroy_profile(old_cwd: Path, temp_dir_path: Path) -> None:if old_log_file and old_log_file.is_file():suffix = "_profiling"if env.PROFILING == "use_date":- suffix += f"_{datetime.now().strftime('%Y%m%d_%H%M%S')}"+ suffix += f"_{constants.STARTUP_TIME.strftime(constants.LOGS_DATETIME_FORMAT)}"new_log_file = Path(f"cyberdrop_dl_debug{suffix}.log").resolve()shutil.move(old_log_file, new_log_file)diff --git a/cyberdrop_dl/utils/constants.py b/cyberdrop_dl/utils/constants.pyindex cf113b088..a4d88b783 100644--- a/cyberdrop_dl/utils/constants.py+++ b/cyberdrop_dl/utils/constants.py@@ -1,10 +1,17 @@import re+from datetime import UTC, datetimefrom enum import Enum, IntEnum, StrEnum, autofrom pathlib import Pathfrom typing import Anyfrom rich.text import Text+# TIME+STARTUP_TIME = datetime.now()+STARTUP_TIME_UTC = datetime.now(UTC)+LOGS_DATETIME_FORMAT = "%Y%m%d_%H%M%S"+LOGS_DATE_FORMAT = "%Y_%m_%d"+# loggingCONSOLE_LEVEL = 100MAX_NAME_LENGTHS = {"FILE": 95, "FOLDER": 60}