allow filtering '--list-extractors' results

with blacklist/whitelist syntax, e.g.

--list-extractors pixiv
--list-extractors pixiv:user pixiv:work
--list-extractors :search
This commit is contained in:
Mike Fährmann
2024-09-07 22:41:02 +02:00
parent 0db3c11ab0
commit 4da3347d18
4 changed files with 14 additions and 6 deletions

View File

@@ -760,8 +760,9 @@ def build_extractor_filter(categories, negate=True, special=None):
if catsub:
def test(extr):
for category, subcategory in catsub:
if category in (extr.category, extr.basecategory) and \
subcategory == extr.subcategory:
if subcategory == extr.subcategory and (
category == extr.category or
category == extr.basecategory):
return not negate
return negate
tests.append(test)