[imagehosts] provide 'post_url' metadata (#6582)

https://github.com/mikf/gallery-dl/issues/6582#issuecomment-3520249958
This commit is contained in:
Mike Fährmann
2025-11-12 18:58:49 +01:00
parent 359681a8e4
commit 65c4f00939
4 changed files with 19 additions and 3 deletions

View File

@@ -66,6 +66,7 @@ class ImagehostImageExtractor(Extractor):
else:
data = text.nameext_from_url(url)
data["token"] = self.token
data["post_url"] = self.page_url
data.update(self.metadata(page))
if self._https and url.startswith("http:"):

View File

@@ -13,8 +13,13 @@ __tests__ = (
"#category": ("imagehost", "pixhost", "image"),
"#class" : imagehosts.PixhostImageExtractor,
"#sha1_url" : "4e5470dcf6513944773044d40d883221bbc46cff",
"#sha1_metadata": "3bad6d59db42a5ebbd7842c2307e1c3ebd35e6b0",
"#sha1_content" : "0c8768055e4e20e7c7259608b67799171b691140",
"filename" : "130327671_test-",
"extension": "png",
"directory": "190",
"token" : "130327671",
"post_url" : "https://pixhost.to/show/190/130327671_test-.png",
},
{

View File

@@ -13,6 +13,11 @@ __tests__ = (
"#category": ("imagehost", "postimg", "image"),
"#class" : imagehosts.PostimgImageExtractor,
"#results" : "https://i.postimg.cc/PhJZt1Rw/test-tesuto.png?dl=1",
"filename" : "test-テスト-\"&>",
"extension": "png",
"token" : "Wtn2b3hC",
"post_url" : "https://postimg.cc/Wtn2b3hC",
},
{
@@ -34,9 +39,10 @@ __tests__ = (
"#results" : "https://i.postimg.cc/PhJZt1Rw/test-tesuto.png?dl=1",
"#sha1_content" : "cfaa8def53ed1a575e0c665c9d6d8cf2aac7a0ee",
"extension": "png",
"filename" : "test-テスト-\"&>",
"extension": "png",
"token" : "Wtn2b3hC",
"post_url" : "https://postimg.cc/Wtn2b3hC",
},
{

View File

@@ -13,12 +13,16 @@ __tests__ = (
"#category": ("imagehost", "turboimagehost", "image"),
"#class" : imagehosts.TurboimagehostImageExtractor,
"#sha1_url" : "b94de43612318771ced924cb5085976f13b3b90e",
"#sha1_metadata": "704757ca8825f51cec516ec44c1e627c1f2058ca",
"#sha1_content" : (
"f38b54b17cd7462e687b58d83f00fca88b1b105a",
"0c8768055e4e20e7c7259608b67799171b691140",
"961b25d85b5f5bd18cbe3e847ac55925f14d0286"
),
"filename" : "test--",
"extension": "png",
"token" : "39078423",
"post_url" : "https://www.turboimagehost.com/p/39078423/test--.png.html",
},
{