enable 'parent-metadata' by default for 'chevereto' & 'imagehost' (album/gallery) extractors
This commit is contained in:
@@ -231,10 +231,13 @@ Type
|
||||
* ``bool``
|
||||
* ``string``
|
||||
Default
|
||||
``true``
|
||||
``[chevereto]`` |
|
||||
``[imagehost]``
|
||||
``false``
|
||||
otherwise
|
||||
Description
|
||||
If ``true``, overwrite any metadata provided by a child extractor
|
||||
with its parent's.
|
||||
Forward a parent's metadata to its child extractors.
|
||||
|
||||
| If this is a ``string``, add a parent's metadata to its children's
|
||||
to a field named after said string.
|
||||
|
||||
@@ -1007,6 +1007,11 @@
|
||||
"videos" : true
|
||||
},
|
||||
|
||||
"chevereto":
|
||||
{
|
||||
"parent-metadata": true
|
||||
},
|
||||
|
||||
"Danbooru":
|
||||
{
|
||||
"sleep-request": "0.5-1.5",
|
||||
@@ -1076,6 +1081,11 @@
|
||||
"referer": false
|
||||
},
|
||||
|
||||
"imagehost":
|
||||
{
|
||||
"parent-metadata": true
|
||||
},
|
||||
|
||||
"mastodon":
|
||||
{
|
||||
"access-token": null,
|
||||
|
||||
@@ -17,6 +17,7 @@ class CheveretoExtractor(BaseExtractor):
|
||||
basecategory = "chevereto"
|
||||
directory_fmt = ("{category}", "{user}", "{album}")
|
||||
archive_fmt = "{id}"
|
||||
parent = True
|
||||
|
||||
def _init(self):
|
||||
self.path = self.groups[-1]
|
||||
|
||||
@@ -33,6 +33,7 @@ class Extractor():
|
||||
basecategory = ""
|
||||
basesubcategory = ""
|
||||
categorytransfer = False
|
||||
parent = False
|
||||
directory_fmt = ("{category}",)
|
||||
filename_fmt = "{filename}.{extension}"
|
||||
archive_fmt = ""
|
||||
|
||||
@@ -19,6 +19,7 @@ class ImagehostImageExtractor(Extractor):
|
||||
basecategory = "imagehost"
|
||||
subcategory = "image"
|
||||
archive_fmt = "{token}"
|
||||
parent = True
|
||||
_https = True
|
||||
_params = None
|
||||
_cookies = None
|
||||
|
||||
@@ -452,7 +452,8 @@ class DownloadJob(Job):
|
||||
else:
|
||||
extr._parentdir = pextr._parentdir
|
||||
|
||||
if pmeta := pextr.config2("parent-metadata", "metadata-parent"):
|
||||
if pmeta := pextr.config2(
|
||||
"parent-metadata", "metadata-parent", pextr.parent):
|
||||
if isinstance(pmeta, str):
|
||||
data = self.kwdict.copy()
|
||||
if kwdict:
|
||||
|
||||
Reference in New Issue
Block a user