From 8b63be4f3e628c7ca1a28e16f14985d789d54916 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 22 Feb 2026 11:42:35 -0700 Subject: [PATCH] feat(dl): add --repack flag to insert REPACK tag in output filenames --- unshackle/commands/dl.py | 5 +++++ unshackle/core/titles/episode.py | 3 +++ unshackle/core/titles/movie.py | 3 +++ unshackle/core/titles/song.py | 3 +++ 4 files changed, 14 insertions(+) diff --git a/unshackle/commands/dl.py b/unshackle/commands/dl.py index 2a9ed33..aa3b747 100644 --- a/unshackle/commands/dl.py +++ b/unshackle/commands/dl.py @@ -406,6 +406,7 @@ class dl: @click.option( "--tag", type=str, default=None, help="Set the Group Tag to be used, overriding the one in config if any." ) + @click.option("--repack", is_flag=True, default=False, help="Add REPACK tag to the output filename.") @click.option( "--tmdb", "tmdb_id", @@ -508,6 +509,7 @@ class dl: no_proxy: bool, profile: Optional[str] = None, proxy: Optional[str] = None, + repack: bool = False, tag: Optional[str] = None, tmdb_id: Optional[int] = None, tmdb_name: bool = False, @@ -897,6 +899,9 @@ class dl: config=self.service_config, cdm=self.cdm, proxy_providers=self.proxy_providers, profile=self.profile ) + if repack: + config.repack = True + if tag: config.tag = tag diff --git a/unshackle/core/titles/episode.py b/unshackle/core/titles/episode.py index cdf94d2..5771def 100644 --- a/unshackle/core/titles/episode.py +++ b/unshackle/core/titles/episode.py @@ -156,6 +156,9 @@ class Episode(Title): name=self.name or "", ).strip() + if getattr(config, "repack", False): + name += " REPACK" + if primary_video_track: resolution_token = _get_resolution_token(primary_video_track) if resolution_token: diff --git a/unshackle/core/titles/movie.py b/unshackle/core/titles/movie.py index 366a971..d14df3e 100644 --- a/unshackle/core/titles/movie.py +++ b/unshackle/core/titles/movie.py @@ -91,6 +91,9 @@ class Movie(Title): # Name (Year) name = str(self).replace("$", "S") # e.g., Arli$$ + if getattr(config, "repack", False): + name += " REPACK" + if primary_video_track: resolution_token = _get_resolution_token(primary_video_track) if resolution_token: diff --git a/unshackle/core/titles/song.py b/unshackle/core/titles/song.py index 98cc0d7..580e33e 100644 --- a/unshackle/core/titles/song.py +++ b/unshackle/core/titles/song.py @@ -100,6 +100,9 @@ class Song(Title): # NN. Song Name name = str(self).split(" / ")[1] + if getattr(config, "repack", False): + name += " REPACK" + # Service (use track source if available) if show_service: source_name = None