[kemonoparty] fix 'username' extraction (fixes #1652)

The site's <title> content changed from

<title>NAME | Kemono</title>

to

<title>
    NAME | Kemono
</title>
This commit is contained in:
Mike Fährmann
2021-06-25 14:47:12 +02:00
parent befe635022
commit 759735fb02
2 changed files with 10 additions and 1 deletions

View File

@@ -28,7 +28,8 @@ class KemonopartyExtractor(Extractor):
if self.config("metadata"):
username = text.unescape(text.extract(
self.request(self.user_url).text, "<title>", " | Kemono<")[0])
self.request(self.user_url).text, "<title>", " | Kemono"
)[0]).lstrip()
else:
username = None
@@ -133,6 +134,11 @@ class KemonopartyPostExtractor(KemonopartyExtractor):
"pattern": r"https://data\.kemono\.party/(file|attachment)s"
r"/gumroad/trylsc/IURjT/",
}),
# username (#1548, #1652)
("https://kemono.party/gumroad/user/3252870377455/post/aJnAH", {
"options": (("metadata", True),),
"keyword": {"username": "Kudalyn's Creations"},
}),
("https://kemono.party/subscribestar/user/alcorart/post/184330"),
)