second commit

This commit is contained in:
gosangam
2026-10-18 23:52:30 +05:30
parent 732a06f65d
commit 3ee8427dae
5 changed files with 286 additions and 6 deletions
+4 -1
View File
@@ -301,8 +301,11 @@ class Config:
config.sequence_prefix_format.format(seq=1)
except (KeyError, IndexError, ValueError):
r.problems.append("SEQUENCE_PREFIX_FORMAT must be a format string using {seq}, e.g. '{seq:03d} - '")
import tempfile
resolved = config.download_dir.resolve()
if resolved in {Path("/").resolve(), Path.home().resolve(), PROJECT_DIR.resolve()} or len(resolved.parts) < 3:
shared = {Path(p).resolve() for p in ("/", "/tmp", "/var/tmp", tempfile.gettempdir(), Path.home(), PROJECT_DIR)}
if resolved in shared or len(resolved.parts) < 3:
r.problems.append(
f"DOWNLOAD_DIR={config.download_dir} is not a dedicated directory; use e.g. 'downloads' or '/tmp/telegram_drive_bot'"
)