Add pruning option to PlaylistDownloader and update CLI arguments

This commit is contained in:
2025-10-21 22:06:55 +03:00
parent e1ec65094f
commit 599a0751b9
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -20,6 +20,8 @@ class PlaylistDownloader:
self.debug = bool(config.debug)
# non-interactive mode for CI/automated runs
self.non_interactive = bool(getattr(config, "non_interactive", False))
# prune controls whether cleanup actually deletes files; default False
self.prune = bool(getattr(config, "prune", False))
self.url = playlist.get("url")
self.skip = False
@@ -359,6 +361,10 @@ class PlaylistDownloader:
for f in to_delete:
self.logger.warning(" %s", f.name)
if not self.prune:
self.logger.info("Prune disabled; no files will be deleted in '%s'.", folder)
return
try:
if self.non_interactive:
confirm = "y"