From ededba80873a5ccf0ec799f720019814127362f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 20 Nov 2024 19:19:23 +0100 Subject: [PATCH] [steamgriddb] disable 'adjust-extensions' for fake-png files (#5274) --- gallery_dl/extractor/steamgriddb.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gallery_dl/extractor/steamgriddb.py b/gallery_dl/extractor/steamgriddb.py index 85828247..c120ee55 100644 --- a/gallery_dl/extractor/steamgriddb.py +++ b/gallery_dl/extractor/steamgriddb.py @@ -56,14 +56,19 @@ class SteamgriddbExtractor(Extractor): download_fake_png = self.config("download-fake-png", True) for asset in self.assets(): - if download_fake_png and asset.get("fake_png"): - urls = (asset["url"], asset["fake_png"]) - else: - urls = (asset["url"],) + fake_png = download_fake_png and asset.get("fake_png") - asset["count"] = len(urls) + asset["count"] = 2 if fake_png else 1 yield Message.Directory, asset - for asset["num"], url in enumerate(urls, 1): + + asset["num"] = 1 + url = asset["url"] + yield Message.Url, url, text.nameext_from_url(url, asset) + + if fake_png: + asset["num"] = 2 + asset["_http_adjust_extension"] = False + url = fake_png yield Message.Url, url, text.nameext_from_url(url, asset) def _call(self, endpoint, **kwargs):