mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
[fanbox] add 'content' metadata field (#3020)
This commit is contained in:
parent
e5d229c524
commit
1ca6be8619
@ -68,6 +68,16 @@ class FanboxExtractor(Extractor):
|
|||||||
post["html"] = content_body["html"]
|
post["html"] = content_body["html"]
|
||||||
if post["type"] == "article":
|
if post["type"] == "article":
|
||||||
post["articleBody"] = content_body.copy()
|
post["articleBody"] = content_body.copy()
|
||||||
|
if "blocks" in content_body:
|
||||||
|
content = []
|
||||||
|
append = content.append
|
||||||
|
for block in content_body["blocks"]:
|
||||||
|
if "text" in block:
|
||||||
|
append(block["text"])
|
||||||
|
if "links" in block:
|
||||||
|
for link in block["links"]:
|
||||||
|
append(link["url"])
|
||||||
|
post["content"] = "\n".join(content)
|
||||||
|
|
||||||
post["date"] = text.parse_datetime(post["publishedDatetime"])
|
post["date"] = text.parse_datetime(post["publishedDatetime"])
|
||||||
post["text"] = content_body.get("text") if content_body else None
|
post["text"] = content_body.get("text") if content_body else None
|
||||||
@ -271,6 +281,16 @@ class FanboxPostExtractor(FanboxExtractor):
|
|||||||
"hasAdultContent": True
|
"hasAdultContent": True
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
# 'content' metadata (#3020)
|
||||||
|
("https://www.fanbox.cc/@official-en/posts/4326303", {
|
||||||
|
"keyword": {
|
||||||
|
"content": r"re:^Greetings from FANBOX.\n \n"
|
||||||
|
r"As of Monday, September 5th, 2022, we are happy "
|
||||||
|
r"to announce the start of the FANBOX hashtag "
|
||||||
|
r"event #MySetupTour ! \nAbout the event\n"
|
||||||
|
r"To join this event ...",
|
||||||
|
},
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
|
Loading…
Reference in New Issue
Block a user