implement 'post-filter' & 'post-range' options

(#8643)
This commit is contained in:
Mike Fährmann
2025-12-05 16:40:23 +01:00
parent d9c1d15aee
commit 5da200945b
5 changed files with 61 additions and 12 deletions

View File

@@ -1455,13 +1455,22 @@ Note
The index of the first file is ``1``.
extractor.*.post-range
----------------------
Type
``string``
Description
Like `image-range <extractor.*.image-range_>`__,
but for posts.
extractor.*.chapter-range
-------------------------
Type
``string``
Description
Like `image-range <extractor.*.image-range_>`__,
but applies to delegated URLs like manga chapters, etc.
but for child extractors handling manga chapters, external URLs, etc.
extractor.*.image-filter
@@ -1480,6 +1489,19 @@ Description
Available values are the filename-specific ones listed by ``-K`` or ``-j``.
extractor.*.post-filter
-----------------------
Type
* Condition_
* ``list`` of Conditions_
Example
* ``"post['id'] > 12345"``
* ``["date >= datetime(2025, 5, 1)", "print(post_id)"]``
Description
Like `image-filter <extractor.*.image-filter_>`__,
but for posts.
extractor.*.chapter-filter
--------------------------
Type
@@ -1490,7 +1512,7 @@ Example
* ``["language == 'French'", "10 <= chapter < 20"]``
Description
Like `image-filter <extractor.*.image-filter_>`__,
but applies to delegated URLs like manga chapters, etc.
but for child extractors handling manga chapters, external URLs, etc.
extractor.*.image-unique

View File

@@ -47,6 +47,8 @@
"image-filter" : null,
"image-range" : null,
"image-unique" : false,
"post-filter" : null,
"post-range" : null,
"chapter-filter": null,
"chapter-range" : null,
"chapter-unique": false,

View File

@@ -145,16 +145,18 @@
--range RANGE Index range(s) specifying which files to
download. These can be either a constant value,
range, or slice (e.g. '5', '8-20', or '1:24:3')
--chapter-range RANGE Like '--range', but applies to manga chapters
and other delegated URLs
--post-range RANGE Like '--range', but for posts
--chapter-range RANGE Like '--range', but for child extractors
handling manga chapters, external URLs, etc.
--filter EXPR Python expression controlling which files to
download. Files for which the expression
evaluates to False are ignored. Available keys
are the filename-specific ones listed by '-K'.
Example: --filter "image_width >= 1000 and
rating in ('s', 'q')"
--chapter-filter EXPR Like '--filter', but applies to manga chapters
and other delegated URLs
--post-filter EXPR Like '--filter', but for posts
--chapter-filter EXPR Like '--filter', but for child extractors
handling manga chapters, external URLs, etc.
## Post-processing Options:
-P, --postprocessor NAME Activate the specified post processor