SPB Git forge

spb/fabri-ka

Public

Agrégateur de produits québécois — www.fabri-ka.com

217commits 1branches 0releases
66.1 MBsize
maindefault branch
7 h agolast push
Python 38.4% HTML 30.3% TypeScript 17.2% CSS 11% JavaScript 3.2%

[ka6] fix connecteur labonneattitude.com: Hydrogen/Oxygen frontend (ca.attitudeliving.com) n'expose pas /products.json — remplace l'URL par main-ca-attitude.myshopify.com; myshopify.com bloque les UA navigateur, skip -A curl sur .myshopify.com

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Simon-Pierre Boucher committed 1 mo ago (Aug 23, 2026) parent d6f622a

2 changed files +8 −2

modified data/stores.json +1 −1
@@ -72499,7 +72499,7 @@
72499 72499 {
72500 72500 "id": "labonneattitude.com",
72501 72501 "name": "ATTITUDE",
72502 − "url": "https://ca.attitudeliving.com",
72502 + "url": "https://main-ca-attitude.myshopify.com",
72503 72503 "platform": "shopify",
72504 72504 "catalog_endpoint": "/products.json",
72505 72505 "city": "",
modified fabrika/connectors/shopify.py +7 −1
@@ -33,6 +33,12 @@ class ShopifyConnector(BaseConnector):
33 33 if getattr(self, "_scrapfly_only", False):
34 34 return self._scrapfly_json(url)
35 35 last_err = None
36 + # myshopify.com bloque les UA navigateur mais accepte le UA curl par
37 + # défaut — ne pas passer -A sur ce domaine.
38 + import urllib.parse as _up
39 + _netloc = _up.urlparse(url).netloc
40 + _ua_args = ([] if _netloc.endswith(".myshopify.com")
41 + else ["-A", self.session.headers["User-Agent"].split(" FabriKaBot")[0]])
36 42 # 6 tentatives, backoff long sur 429 : les boutiques à panne
37 43 # intermittente (ex. boutiquesoha.com) répondent après patience,
38 44 # là où le repli Scrapfly renvoie parfois 422.
@@ -44,7 +50,7 @@ class ShopifyConnector(BaseConnector):
44 50 _last_shopify_req[0] = time.time()
45 51 p = subprocess.run(
46 52 ["curl", "-sS", "--compressed", "-L", "--max-time", str(self.timeout),
47 − "-A", self.session.headers["User-Agent"].split(" FabriKaBot")[0],
53 + *_ua_args,
48 54 "-w", "\n%{http_code}", url],
49 55 capture_output=True, text=True, errors="replace")
50 56 body, _, code = p.stdout.rpartition("\n")
51 57