Revert "[ka2] fix connecteur rp_ag_greybruce: fallback en code des chemins d'archive (page 1 sans cartes → essai listings/listing/all-regional-listings avec seuil anti-widget-vedette et bascule de self.archive) + ré-application de archive=listings au registre (fix du 2026-08-31 validé found=7575 mais rollback avant la fin du sync de 50 min) — test réel 7573 fiches"
This reverts commit 3096abbc78b0b403a1500f205c4e471c5387dbbe.
4 changed files +9 −27
modified
data/canada_agencies.json
+3 −4
@@ -35,9 +35,8 @@ | ||
| 35 | 35 | "id": "rp_ag_greybruce", |
| 36 | 36 | "name": "Grey Bruce Real Estate", |
| 37 | 37 | "site": "https://greybrucerealestate.ca", |
| 38 | − "note": "Recensement ON 2026-08-27 : ~8 268 fiches (Grey-Bruce/Georgian Bay). RealtyPress/DDF. Même feed que collaborativerealestate.ca (fallback). 2026-08-31 : refonte du site, /listing/ → 404 (avec widget 12 cartes vedettes), archive déplacée sur /listings/ — sync validé found=7575 le 2026-08-31 ; le connecteur a aussi un fallback en code qui détecte le chemin d'archive déplacé.", | |
| 39 | − "province": "Ontario", | |
| 40 | − "archive": "listings" | |
| 38 | + "note": "Recensement ON 2026-08-27 : ~8 268 fiches (Grey-Bruce/Georgian Bay). RealtyPress/DDF. Même feed que collaborativerealestate.ca (fallback).", | |
| 39 | + "province": "Ontario" | |
| 41 | 40 | }, |
| 42 | 41 | { |
| 43 | 42 | "id": "rp_ag_remaxfinest", |
@@ -145,4 +144,4 @@ | ||
| 145 | 144 | "province": "Alberta", |
| 146 | 145 | "note": "Recensement CANADA 2026-08-27 : ~≥60 fiches, provinces page 1 : {'Alberta': 25}. RealtyPress/DDF." |
| 147 | 146 | } |
| 148 | −] | |
| 147 | +] | |
| \ No newline at end of file | ||
modified
data/sources.json
+1 −1
@@ -48,7 +48,7 @@ | ||
| 48 | 48 | "id": "rp_ag_greybruce", |
| 49 | 49 | "name": "Grey Bruce Real Estate", |
| 50 | 50 | "url": "https://greybrucerealestate.ca", |
| 51 | − "listing_url": "https://greybrucerealestate.ca/listings/", | |
| 51 | + "listing_url": "https://greybrucerealestate.ca/listing/", | |
| 52 | 52 | "coverage": "Grey-Bruce / Georgian Bay (ITSO) — ~8 300 fiches DDF", |
| 53 | 53 | "connector": "realtypress", |
| 54 | 54 | "status": "actif", |
modified
immoka/connectors/realtypress.py
+4 −21
@@ -126,33 +126,16 @@ class _RealtyPress(BaseConnector): | ||
| 126 | 126 | # gabarit sans cartes) : réessayer, puis variantes d'URL — un |
| 127 | 127 | # échec ici ferait retirer TOUTES les fiches de la source |
| 128 | 128 | import time as _t |
| 129 | − alts = [(self.archive, url), | |
| 130 | − (self.archive, f"{base}/{self.archive}/?posts_per_page=100"), | |
| 131 | − (self.archive, f"{base}/{self.archive}/page/2/{pp}")] | |
| 132 | − # refonte de site : l'archive change parfois de chemin SANS | |
| 133 | − # redirection (greybruce 2026-08 : /listing/ → 404 avec widget | |
| 134 | − # « 12 vedettes », archive réelle déplacée sur /listings/) — | |
| 135 | − # essayer les autres chemins connus du parc RealtyPress et | |
| 136 | − # basculer self.archive pour les pages suivantes. Seuil de | |
| 137 | − # cartes pour ne pas confondre un widget vedette (~12 cartes) | |
| 138 | − # avec une vraie page d'archive (100/page, 10 en natif). | |
| 139 | − min_cards = 20 if self.use_pp else 5 | |
| 140 | − alts += [(a, f"{base}/{a}/{pp}") | |
| 141 | − for a in ("listings", "listing", "all-regional-listings") | |
| 142 | − if a != self.archive] | |
| 143 | − orig_archive, accepted = self.archive, False | |
| 144 | − for arch, alt in alts: | |
| 129 | + for alt in (url, f"{base}/{self.archive}/?posts_per_page=100", | |
| 130 | + f"{base}/{self.archive}/page/2/{pp}"): | |
| 145 | 131 | _t.sleep(2.0) |
| 146 | 132 | try: |
| 147 | 133 | body = self.get(alt).text |
| 148 | 134 | except Exception: |
| 149 | 135 | continue |
| 150 | − n = len(_CARD_RE.findall(body)) | |
| 151 | − if n and (arch == orig_archive or n >= min_cards): | |
| 152 | − self.archive = arch | |
| 153 | − accepted = True | |
| 136 | + if _CARD_RE.search(body): | |
| 154 | 137 | break |
| 155 | − if not accepted: | |
| 138 | + if not _CARD_RE.search(body): | |
| 156 | 139 | raise RuntimeError( |
| 157 | 140 | f"{self.source_id}: archive sans cartes après reprises " |
| 158 | 141 | "(page vide intermittente ?) — sync abandonné pour " |
modified
sources.json
+1 −1
@@ -48,7 +48,7 @@ | ||
| 48 | 48 | "id": "rp_ag_greybruce", |
| 49 | 49 | "name": "Grey Bruce Real Estate", |
| 50 | 50 | "url": "https://greybrucerealestate.ca", |
| 51 | − "listing_url": "https://greybrucerealestate.ca/listings/", | |
| 51 | + "listing_url": "https://greybrucerealestate.ca/listing/", | |
| 52 | 52 | "coverage": "Grey-Bruce / Georgian Bay (ITSO) — ~8 300 fiches DDF", |
| 53 | 53 | "connector": "realtypress", |
| 54 | 54 | "status": "actif", |
| 55 | 55 | |