extend '-A / --abort' & '"skip": "abort"' functionality (#7891)

implement ascending by more than 1 level or
up to an extractor with a specific subcategory
This commit is contained in:
Mike Fährmann
2025-07-30 00:01:49 +02:00
parent 64de6605ce
commit 2eb5e52055
5 changed files with 70 additions and 23 deletions

View File

@@ -160,6 +160,22 @@ class ControlException(GalleryDLException):
class StopExtraction(ControlException):
"""Stop data extraction"""
def __init__(self, target=None):
ControlException.__init__(self)
if target is None:
self.target = None
self.depth = 1
elif isinstance(target, int):
self.target = None
self.depth = target
elif target.isdecimal():
self.target = None
self.depth = int(target)
else:
self.target = target
self.depth = 128
class AbortExtraction(ExtractionError, ControlException):
"""Abort data extraction due to an error"""