From ca776461ff1778b2c538518cd6b83f475eb0c92d Mon Sep 17 00:00:00 2001 From: adogecheems Date: Thu, 29 Aug 2024 11:05:14 +0800 Subject: [PATCH] ... --- anisearch/search/AniSearch.py | 1 + anisearch/search/cli.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/anisearch/search/AniSearch.py b/anisearch/search/AniSearch.py index 2e5efbb..7eb4a82 100644 --- a/anisearch/search/AniSearch.py +++ b/anisearch/search/AniSearch.py @@ -140,6 +140,7 @@ def save_csv(self, filename: str) -> None: "size": anime.size, "magnet": anime.magnet }) + except Exception as e: log.error(f"Failed to save CSV: {str(e)}") raise diff --git a/anisearch/search/cli.py b/anisearch/search/cli.py index 94c6652..4fe45c9 100644 --- a/anisearch/search/cli.py +++ b/anisearch/search/cli.py @@ -44,7 +44,6 @@ def main() -> None: parser.add_argument('-c', '--collected', action='store_true', help='是否启用季度全集搜索') args = parser.parse_args() - search_params: Dict[str, Any] = {'keyword': args.keyword, 'collected': args.collected} searcher = None @@ -64,6 +63,7 @@ def main() -> None: console.print(f"[bold green]其磁链为: [/bold green][bold yellow]{searcher.anime.magnet}[/bold yellow]") else: console.print("[bold yellow]已退出选择[/bold yellow]") + elif searcher is None: console.print("[bold red]搜索失败,无法进行选择[/bold red]") else: