[furaffinity] improve 'artist_url' extraction (#7115 #7123)

This commit is contained in:
Mike Fährmann
2025-03-06 14:09:52 +01:00
parent ecbad03c49
commit 984116ada7
2 changed files with 13 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ class FuraffinityExtractor(Extractor):
data["tags"] = text.split_html(extr(
'class="tags-row">', '</section>'))
data["title"] = text.unescape(extr("<h2><p>", "</p></h2>"))
extr('title=', '"')
data["artist_url"] = extr('title="', '"').strip()
data["artist"] = extr(">", "<")
data["_description"] = extr(
'class="submission-description user-submitted-links">',
@@ -122,7 +122,7 @@ class FuraffinityExtractor(Extractor):
else:
# old site layout
data["title"] = text.unescape(extr("<h2>", "</h2>"))
extr('title=', '"')
data["artist_url"] = extr('title="', '"').strip()
data["artist"] = extr(">", "<")
data["fa_category"] = extr("<b>Category:</b>", "<").strip()
data["theme"] = extr("<b>Theme:</b>", "<").strip()
@@ -141,7 +141,6 @@ class FuraffinityExtractor(Extractor):
'style="padding:8px">', ' </td>')
data["folders"] = () # folders not present in old layout
data["artist_url"] = data["artist"].replace("_", "").lower()
data["user"] = self.user or data["artist_url"]
data["date"] = text.parse_timestamp(data["filename"].partition(".")[0])
data["description"] = self._process_description(data["_description"])