[kemonoparty] skip duplicated patreon files (closes #1689)
this behavior can be disabled with the 'patreon-skip-file' option
This commit is contained in:
@@ -1264,6 +1264,16 @@ Description
|
||||
Extract ``username`` metadata
|
||||
|
||||
|
||||
extractor.kemonoparty.patreon-skip-file
|
||||
---------------------------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``true``
|
||||
Description
|
||||
Skip main files in Patreon posts to avoid duplicates.
|
||||
|
||||
|
||||
extractor.khinsider.format
|
||||
--------------------------
|
||||
Type
|
||||
|
||||
@@ -33,6 +33,8 @@ class KemonopartyExtractor(Extractor):
|
||||
KemonopartyExtractor._warning = False
|
||||
|
||||
find_inline = re.compile(r'src="(/inline/[^"]+)').findall
|
||||
skip_service = \
|
||||
"patreon" if self.config("patreon-skip-file", True) else None
|
||||
|
||||
if self.config("metadata"):
|
||||
username = text.unescape(text.extract(
|
||||
@@ -54,7 +56,8 @@ class KemonopartyExtractor(Extractor):
|
||||
|
||||
if file:
|
||||
file["type"] = "file"
|
||||
append(file)
|
||||
if post["service"] != skip_service or not post["attachments"]:
|
||||
append(file)
|
||||
for attachment in post["attachments"]:
|
||||
attachment["type"] = "attachment"
|
||||
append(attachment)
|
||||
@@ -158,6 +161,11 @@ class KemonopartyPostExtractor(KemonopartyExtractor):
|
||||
"options": (("metadata", True),),
|
||||
"keyword": {"username": "Kudalyn's Creations"},
|
||||
}),
|
||||
# skip patreon main file (#1667, #1689)
|
||||
("https://kemono.party/patreon/user/4158582/post/32099982", {
|
||||
"count": 2,
|
||||
"keyword": {"type": "attachment"},
|
||||
}),
|
||||
("https://kemono.party/subscribestar/user/alcorart/post/184330"),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user