Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: add envvar to override appdirs

NTFSvolume69f630faecab
diff --git a/cyberdrop_dl/config/appdata.py b/cyberdrop_dl/config/appdata.py
index 2156993db..5eb526317 100644
--- a/cyberdrop_dl/config/appdata.py
+++ b/cyberdrop_dl/config/appdata.py
@@ -8,6 +8,8 @@ import tempfile
from pathlib import Path
from typing import TYPE_CHECKING, final
+from cyberdrop_dl import env
+
if TYPE_CHECKING:
from collections.abc import Iterator
@@ -100,6 +102,9 @@ def _default_app_dir() -> AppDirs:
temp_dir = Path(tempfile.TemporaryDirectory(prefix="cdl_", delete=False).name)
return AppDirs.from_path(temp_dir)
+ if env.APPDATA_FOLDER:
+ return AppDirs.from_path(_resolve(Path(env.APPDATA_FOLDER)))
+
if os.name == "nt":
return AppDirs.from_path(_windows_appdata())
diff --git a/cyberdrop_dl/env.py b/cyberdrop_dl/env.py
index 84eeb585b..a4733d549 100644
--- a/cyberdrop_dl/env.py
+++ b/cyberdrop_dl/env.py
@@ -33,7 +33,7 @@ ENABLE_DEBUG_CRAWLERS = (
_env("ENABLE_DEBUG_CRAWLERS", censor=True) == "d396ab8c85fcb1fecd22c8d9b58acf944a44e6d35014e9dd39e42c9a64091eda"
)
-NO_PLUGINS = bool(_env("NO_PLUGINS"))
+APPDATA_FOLDER = _env("APPDATA_FOLDER")
WRITE_JSON_UI = int(_env("WRITE_JSON_UI") or 0) or None
EDITOR = os.getenv("EDITOR")