From ba808c4853851f4aeef710c8b251fef4149e7771 Mon Sep 17 00:00:00 2001 From: Dion Date: Thu, 14 May 2026 21:20:07 +0930 Subject: [PATCH] Add ability to mark existing episodes at source as already downloaded without downloading --- autograbber.py | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/autograbber.py b/autograbber.py index bbd81e3..6d2dc16 100755 --- a/autograbber.py +++ b/autograbber.py @@ -1,3 +1,4 @@ + #!/usr/bin/env python3 import argparse @@ -11,10 +12,10 @@ from services.iview import iViewService # ------------------------- # Metadata paths # ------------------------- -DOWNLOAD_META = Path("./.download") +DOWNLOAD_META = Path("./.config") -HISTORY_FILE = DOWNLOAD_META / ".history" -SERIES_FILE = DOWNLOAD_META / ".series" +HISTORY_FILE = DOWNLOAD_META / "history" +SERIES_FILE = DOWNLOAD_META / "series" # ------------------------- @@ -30,10 +31,16 @@ SERVICES = { # ------------------------- class AutoGrabber: - def __init__(self, download_dir, dry_run=False): + def __init__( + self, + download_dir, + dry_run=False, + mark_existing=False + ): self.download_dir = Path(download_dir) self.dry_run = dry_run + self.mark_existing = mark_existing self.history = self.load_history() self.series_list = self.load_series() @@ -197,6 +204,22 @@ class AutoGrabber: continue + # mark-existing mode + if self.mark_existing: + + print( + f"📝 " + f"{filename} " + f"(added to history)" + ) + + self.history[ep_id] = filename + self.save_history() + + continue + + + # normal download mode print(f"✅ {filename} → downloading") success = service.download_episode( @@ -254,6 +277,12 @@ def parse_args(): help="Download directory" ) + parser.add_argument( + "--mark-existing", + action="store_true", + help="Add all available episodes to history without downloading" + ) + return parser.parse_args() @@ -266,5 +295,6 @@ if __name__ == "__main__": AutoGrabber( download_dir=args.downloads, - dry_run=args.dry_run + dry_run=args.dry_run, + mark_existing=args.mark_existing ).run()