allow extractors to register a 'finalize()' method
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
## 1.18.4 - 2021-09-04
|
## 1.18.4 - 2021-09-04
|
||||||
### Additions
|
### Additions
|
||||||
- [420chan] add `thread` and `board` extractors ([#1773](https://github.com/mikf/gallery-dl/issues/1773))
|
- [420chan] add `thread` and `board` extractors ([#1773](https://github.com/mikf/gallery-dl/issues/1773))
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class Extractor():
|
|||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
self.log = logging.getLogger(self.category)
|
self.log = logging.getLogger(self.category)
|
||||||
self.url = match.string
|
self.url = match.string
|
||||||
|
self.finalize = None
|
||||||
|
|
||||||
if self.basecategory:
|
if self.basecategory:
|
||||||
self.config = self._config_shared
|
self.config = self._config_shared
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ class Job():
|
|||||||
log.info("No results for %s", extractor.url)
|
log.info("No results for %s", extractor.url)
|
||||||
finally:
|
finally:
|
||||||
self.handle_finalize()
|
self.handle_finalize()
|
||||||
|
if extractor.finalize:
|
||||||
|
extractor.finalize()
|
||||||
|
|
||||||
return self.status
|
return self.status
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
__version__ = "1.18.4"
|
__version__ = "1.19.0-dev"
|
||||||
|
|||||||
Reference in New Issue
Block a user