From 228dc0170a669cc3507e445c3e9c0b9c9a0adeb9 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 24 Apr 2026 17:43:16 +0200 Subject: [PATCH] =?UTF-8?q?breed=5Fenricher:=20User-Agent=20f=C3=BCr=20Wik?= =?UTF-8?q?ipedia=20API=20(Fix=20403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/scraper/breed_enricher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/scraper/breed_enricher.py b/backend/scraper/breed_enricher.py index a2cda17..f08ae65 100644 --- a/backend/scraper/breed_enricher.py +++ b/backend/scraper/breed_enricher.py @@ -174,7 +174,10 @@ async def _fetch_wikimedia_photo(name: str) -> str | None: """Sucht ein lizenzfreies Foto via Wikipedia pageimages API (de → en Fallback).""" for lang in ("de", "en"): try: - async with httpx.AsyncClient(timeout=8) as client: + async with httpx.AsyncClient( + timeout=8, + headers={"User-Agent": "Banyaro/1.0 (https://banyaro.de; mail@banyaro.de) httpx"}, + ) as client: resp = await client.get( f"https://{lang}.wikipedia.org/w/api.php", params={