From e1ec65094f0b96944d0423cfaf04cecaa815b313 Mon Sep 17 00:00:00 2001 From: DARKZOUL5 Date: Tue, 21 Oct 2025 21:45:23 +0300 Subject: [PATCH] Implement non-interactive mode for PlaylistDownloader to support CI automation --- ytplaylist/downloader.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ytplaylist/downloader.py b/ytplaylist/downloader.py index 1d95ed1..421e17d 100644 --- a/ytplaylist/downloader.py +++ b/ytplaylist/downloader.py @@ -18,6 +18,8 @@ class PlaylistDownloader: # If the manager (or config) defines debug, prefer that if hasattr(config, "debug"): self.debug = bool(config.debug) + # non-interactive mode for CI/automated runs + self.non_interactive = bool(getattr(config, "non_interactive", False)) self.url = playlist.get("url") self.skip = False @@ -358,7 +360,10 @@ class PlaylistDownloader: self.logger.warning(" %s", f.name) try: - confirm = input("Delete these files? [y/N]: ").strip().lower() + if self.non_interactive: + confirm = "y" + else: + confirm = input("Delete these files? [y/N]: ").strip().lower() except EOFError: confirm = "n"