From 360ea00bd94af9821766c78f03d08853b21717de Mon Sep 17 00:00:00 2001 From: Ricter Zheng Date: Tue, 14 Apr 2026 21:51:50 +0800 Subject: [PATCH] feat: use exact artist lookup instead of fuzzy search --artist now calls parser.artist() which resolves the artist name to a tag id via the /tags/artist/{slug} endpoint, then queries /galleries/tagged for exact results. BaseParser.artist() defaults to search('artist:...') as fallback for plugins that don't implement it. Fixes #430 Co-Authored-By: Claude Sonnet 4.6 (1M context) --- doujinshi_dl/__init__.py | 2 +- doujinshi_dl/command.py | 4 ++-- doujinshi_dl/core/plugin.py | 3 +++ pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doujinshi_dl/__init__.py b/doujinshi_dl/__init__.py index 26891ec..ba92dff 100644 --- a/doujinshi_dl/__init__.py +++ b/doujinshi_dl/__init__.py @@ -1,3 +1,3 @@ -__version__ = '2.0.8' +__version__ = '2.0.9' __author__ = 'RicterZ' __email__ = 'ricterzheng@gmail.com' diff --git a/doujinshi_dl/command.py b/doujinshi_dl/command.py index 1d4855d..5cb26c3 100644 --- a/doujinshi_dl/command.py +++ b/doujinshi_dl/command.py @@ -86,8 +86,8 @@ def main(): ) elif options.artist: - doujinshis = parser.search( - f'artist:{options.artist}', + doujinshis = parser.artist( + options.artist, sorting=options.sorting, page=page_list, is_page_all=options.page_all, diff --git a/doujinshi_dl/core/plugin.py b/doujinshi_dl/core/plugin.py index 6a077b6..8133c6a 100644 --- a/doujinshi_dl/core/plugin.py +++ b/doujinshi_dl/core/plugin.py @@ -36,6 +36,9 @@ class BaseParser(ABC): @abstractmethod def search(self, keyword: str, sorting: str = 'date', page=None, **kwargs) -> List[Dict]: ... + def artist(self, artist_name: str, sorting: str = 'date', page=None, **kwargs) -> List[Dict]: + return self.search(f'artist:{artist_name}', sorting=sorting, page=page, **kwargs) + def favorites(self, page=None) -> List[Dict]: return [] diff --git a/pyproject.toml b/pyproject.toml index 2deacdb..cbaf671 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "doujinshi-dl" -version = "2.0.8" +version = "2.0.9" description = "doujinshi downloader" authors = ["Ricter Z "] license = "MIT"