diff options
| author | 2025-07-31 01:22:01 -0400 | |
|---|---|---|
| committer | 2025-07-31 01:22:01 -0400 | |
| commit | a6e995c093de8aae2e91a0787281bb34c0b871eb (patch) | |
| tree | 2d79821b05300d34d8871eb6c9662b359a2de85d /gallery_dl/extractor/shopify.py | |
| parent | 7672a750cb74bf31e21d76aad2776367fd476155 (diff) | |
New upstream version 1.30.2.upstream/1.30.2
Diffstat (limited to 'gallery_dl/extractor/shopify.py')
| -rw-r--r-- | gallery_dl/extractor/shopify.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gallery_dl/extractor/shopify.py b/gallery_dl/extractor/shopify.py index a658cac..84c9a84 100644 --- a/gallery_dl/extractor/shopify.py +++ b/gallery_dl/extractor/shopify.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2019-2023 Mike Fährmann +# Copyright 2019-2025 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -18,10 +18,6 @@ class ShopifyExtractor(BaseExtractor): filename_fmt = "{product[title]}_{num:>02}_{id}.{extension}" archive_fmt = "{id}" - def __init__(self, match): - BaseExtractor.__init__(self, match) - self.item_url = self.root + match.group(match.lastindex) - def items(self): data = self.metadata() yield Message.Directory, data @@ -98,14 +94,15 @@ class ShopifyCollectionExtractor(ShopifyExtractor): example = "https://www.fashionnova.com/collections/TITLE" def metadata(self): - return self.request(self.item_url + ".json").json() + url = f"{self.root}{self.groups[-1]}.json" + return self.request_json(url) def products(self): - url = self.item_url + "/products.json" + url = f"{self.root}{self.groups[-1]}/products.json" params = {"page": 1} while True: - data = self.request(url, params=params).json()["products"] + data = self.request_json(url, params=params)["products"] if not data: return yield from data @@ -120,6 +117,7 @@ class ShopifyProductExtractor(ShopifyExtractor): example = "https://www.fashionnova.com/collections/TITLE/products/NAME" def products(self): - product = self.request(self.item_url + ".json").json()["product"] + url = f"{self.root}{self.groups[-1]}.json" + product = self.request_json(url)["product"] del product["image"] return (product,) |
