mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-03-10 08:29:00 +00:00
feat(dl): add --repack flag to insert REPACK tag in output filenames
This commit is contained in:
@@ -406,6 +406,7 @@ class dl:
|
|||||||
@click.option(
|
@click.option(
|
||||||
"--tag", type=str, default=None, help="Set the Group Tag to be used, overriding the one in config if any."
|
"--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(
|
@click.option(
|
||||||
"--tmdb",
|
"--tmdb",
|
||||||
"tmdb_id",
|
"tmdb_id",
|
||||||
@@ -508,6 +509,7 @@ class dl:
|
|||||||
no_proxy: bool,
|
no_proxy: bool,
|
||||||
profile: Optional[str] = None,
|
profile: Optional[str] = None,
|
||||||
proxy: Optional[str] = None,
|
proxy: Optional[str] = None,
|
||||||
|
repack: bool = False,
|
||||||
tag: Optional[str] = None,
|
tag: Optional[str] = None,
|
||||||
tmdb_id: Optional[int] = None,
|
tmdb_id: Optional[int] = None,
|
||||||
tmdb_name: bool = False,
|
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
|
config=self.service_config, cdm=self.cdm, proxy_providers=self.proxy_providers, profile=self.profile
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if repack:
|
||||||
|
config.repack = True
|
||||||
|
|
||||||
if tag:
|
if tag:
|
||||||
config.tag = tag
|
config.tag = tag
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,9 @@ class Episode(Title):
|
|||||||
name=self.name or "",
|
name=self.name or "",
|
||||||
).strip()
|
).strip()
|
||||||
|
|
||||||
|
if getattr(config, "repack", False):
|
||||||
|
name += " REPACK"
|
||||||
|
|
||||||
if primary_video_track:
|
if primary_video_track:
|
||||||
resolution_token = _get_resolution_token(primary_video_track)
|
resolution_token = _get_resolution_token(primary_video_track)
|
||||||
if resolution_token:
|
if resolution_token:
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ class Movie(Title):
|
|||||||
# Name (Year)
|
# Name (Year)
|
||||||
name = str(self).replace("$", "S") # e.g., Arli$$
|
name = str(self).replace("$", "S") # e.g., Arli$$
|
||||||
|
|
||||||
|
if getattr(config, "repack", False):
|
||||||
|
name += " REPACK"
|
||||||
|
|
||||||
if primary_video_track:
|
if primary_video_track:
|
||||||
resolution_token = _get_resolution_token(primary_video_track)
|
resolution_token = _get_resolution_token(primary_video_track)
|
||||||
if resolution_token:
|
if resolution_token:
|
||||||
|
|||||||
@@ -100,6 +100,9 @@ class Song(Title):
|
|||||||
# NN. Song Name
|
# NN. Song Name
|
||||||
name = str(self).split(" / ")[1]
|
name = str(self).split(" / ")[1]
|
||||||
|
|
||||||
|
if getattr(config, "repack", False):
|
||||||
|
name += " REPACK"
|
||||||
|
|
||||||
# Service (use track source if available)
|
# Service (use track source if available)
|
||||||
if show_service:
|
if show_service:
|
||||||
source_name = None
|
source_name = None
|
||||||
|
|||||||
Reference in New Issue
Block a user