[kemono:discord] improve 'filename' parsing
This commit is contained in:
@@ -451,11 +451,16 @@ class KemonoDiscordExtractor(KemonoExtractor):
|
|||||||
post["type"] = file["type"]
|
post["type"] = file["type"]
|
||||||
url = file["path"]
|
url = file["path"]
|
||||||
|
|
||||||
text.nameext_from_url(file.get("name", url), post)
|
if name := file.get("name"):
|
||||||
if not post["extension"]:
|
text.nameext_from_name(name, post)
|
||||||
post["extension"] = text.ext_from_url(url)
|
ext = text.ext_from_url(url)
|
||||||
|
if not post["extension"]:
|
||||||
|
post["extension"] = ext
|
||||||
|
else:
|
||||||
|
text.nameext_from_url(url, post)
|
||||||
|
ext = post["extension"]
|
||||||
|
|
||||||
if post["extension"] in exts_archive:
|
if ext in exts_archive:
|
||||||
if not post_archives:
|
if not post_archives:
|
||||||
post["archives"] = post_archives = []
|
post["archives"] = post_archives = []
|
||||||
post["type"] = "archive"
|
post["type"] = "archive"
|
||||||
|
|||||||
Reference in New Issue
Block a user