Retro-Artikel #46-#57: BSN-Standard-Fixes + Abkürzungs-Check (Daniel 24.06.2026)
This commit is contained in:
+12
-6
@@ -49,7 +49,7 @@ SHOPS = {
|
||||
},
|
||||
"Milan-Spiele.de": {
|
||||
"search_url": "https://www.milan-spiele.de/advanced_search_result.php?keywords={query}",
|
||||
"affix": None,
|
||||
"affix": "awinmid=14379&awinaffid=661969",
|
||||
"scrape": True,
|
||||
},
|
||||
"Thalia.de": {
|
||||
@@ -430,13 +430,19 @@ def search_allgames4you(game_name):
|
||||
|
||||
|
||||
def search_milan_spiele(game_name):
|
||||
"""Milan-Spiele — scrape product listing for price and availability."""
|
||||
"""Milan-Spiele — scrape product listing for price and availability.
|
||||
Converts direct URLs to AWIN affiliate links (advertiser 14379)."""
|
||||
AWIN_URL = "https://www.awin1.com/cread.php?awinmid=14379&awinaffid=661969&ued="
|
||||
|
||||
def _awin(url):
|
||||
return AWIN_URL + urllib.parse.quote(url, safe='')
|
||||
|
||||
query = urllib.parse.quote(game_name)
|
||||
search_url = f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}"
|
||||
html = fetch(search_url, timeout=15)
|
||||
if not html:
|
||||
return {
|
||||
"url": f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}",
|
||||
"url": _awin(f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}"),
|
||||
"price": None,
|
||||
"shop": "Milan-Spiele.de",
|
||||
}
|
||||
@@ -445,7 +451,7 @@ def search_milan_spiele(game_name):
|
||||
blocks = re.split(r'<div class="product">', html)[1:]
|
||||
if not blocks:
|
||||
return {
|
||||
"url": f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}",
|
||||
"url": _awin(f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}"),
|
||||
"price": None,
|
||||
"shop": "Milan-Spiele.de",
|
||||
}
|
||||
@@ -486,7 +492,7 @@ def search_milan_spiele(game_name):
|
||||
|
||||
if not candidates:
|
||||
return {
|
||||
"url": f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}",
|
||||
"url": _awin(f"https://www.milan-spiele.de/advanced_search_result.php?keywords={query}"),
|
||||
"price": None,
|
||||
"shop": "Milan-Spiele.de",
|
||||
}
|
||||
@@ -516,7 +522,7 @@ def search_milan_spiele(game_name):
|
||||
shop_label += " (englische Version)"
|
||||
|
||||
return {
|
||||
"url": best["url"],
|
||||
"url": _awin(best["url"]),
|
||||
"price": best["price"],
|
||||
"shop": shop_label,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user