mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-09-22 06:12:21 +03:00
Implement non-interactive mode for PlaylistDownloader to support CI automation
This commit is contained in:
@@ -18,6 +18,8 @@ class PlaylistDownloader:
|
|||||||
# If the manager (or config) defines debug, prefer that
|
# If the manager (or config) defines debug, prefer that
|
||||||
if hasattr(config, "debug"):
|
if hasattr(config, "debug"):
|
||||||
self.debug = bool(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.url = playlist.get("url")
|
||||||
self.skip = False
|
self.skip = False
|
||||||
@@ -358,7 +360,10 @@ class PlaylistDownloader:
|
|||||||
self.logger.warning(" %s", f.name)
|
self.logger.warning(" %s", f.name)
|
||||||
|
|
||||||
try:
|
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:
|
except EOFError:
|
||||||
confirm = "n"
|
confirm = "n"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user