Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: show version, docs and repo on --help

NTFSvolume6319cc76468e
diff --git a/cyberdrop_dl/cli.py b/cyberdrop_dl/cli.py
index ac25b17cc..e1f89c289 100644
--- a/cyberdrop_dl/cli.py
+++ b/cyberdrop_dl/cli.py
@@ -17,13 +17,21 @@ from cyberdrop_dl.commands.retry import app as retry_app
from cyberdrop_dl.commands.retry import create_retry_source
from cyberdrop_dl.commands.scrape import download, prepare_manager, scrape
from cyberdrop_dl.constants import DEFAULT_PARAMETER
+from cyberdrop_dl.progress import hyperlink
from cyberdrop_dl.scrape_source import RetryScrapeSource, RetrySource
app = App(
name="cyberdrop-dl",
- help="Bulk asynchronous downloader for multiple file hosts",
version=__version__,
default_parameter=DEFAULT_PARAMETER,
+ help_prologue=f"cyberdrop-dl [blue]v{__version__}[/blue]\nBulk [cyan]asynchronous[/cyan] downloader for multiple file hosts",
+ help_format="rich",
+ help_epilogue="\n".join(
+ (
+ f"Github: {hyperlink('https://github.com/Cyberdrop-DL/cyberdrop-dl').markup}",
+ f"Wiki (docs): {hyperlink('https://script-ware.gitbook.io/cyberdrop-dl').markup}",
+ )
+ ),
result_action="return_value",
help_formatter=DefaultFormatter().with_newline_metadata(), # pyright: ignore[reportUnknownMemberType]
)
@@ -44,7 +52,7 @@ def main_menu(
] = Path("URLs.txt"), # pyright: ignore[reportCallInDefaultInitializer]
cli_args: CLIarguments | None = None,
) -> None:
- "Show a TUI menu equivalent to the CLI commands"
+ "Run [cyan]'cyberdrop-dl'[/cyan] without arguments to start the interactive TUI"
input_file = input_file.resolve().absolute()
with prepare_manager(cli_args, cli_overrides=None)() as manager:
from cyberdrop_dl import program_ui
diff --git a/cyberdrop_dl/progress/__init__.py b/cyberdrop_dl/progress/__init__.py
index 23455a675..63654e20c 100644
--- a/cyberdrop_dl/progress/__init__.py
+++ b/cyberdrop_dl/progress/__init__.py
@@ -87,12 +87,13 @@ def create_test_live(renderable: JsonableRenderableType, *, transient: bool = Fa
)
-def hyperlink(file_path: Path, text: str | None = None) -> Text:
+def hyperlink(file_path: Path | str, text: str | None = None) -> Text:
from rich.markup import escape
from rich.text import Text
text = escape(text or str(file_path))
- return Text.from_markup(f"[link={file_path.as_uri()}]{text}[/link]", style="blue")
+ link = file_path if isinstance(file_path, str) else file_path.as_uri()
+ return Text.from_markup(f"[link={link}]{text}[/link]", style="blue")
class DictProgress(Progress):