|
|
@@ -233,15 +233,18 @@ class _AirbnbClient:
|
|
|
) or {}
|
|
|
return section.get('days', [])
|
|
|
|
|
|
+ def _has_prices(days: list[dict]) -> bool:
|
|
|
+ return any(d.get('priceData', {}).get('price') is not None for d in days)
|
|
|
+
|
|
|
resp = await self._gql('getDLSHostCalendar', _HASHES['getDLSHostCalendar'], variables, referer)
|
|
|
days = _extract_days(resp)
|
|
|
- if not days:
|
|
|
- _log.warning('Airbnb: empty calendar for %d-%02d; retrying', year, month)
|
|
|
+ if not days or not _has_prices(days):
|
|
|
+ _log.warning('Airbnb: empty or priceless calendar for %d-%02d; retrying', year, month)
|
|
|
await asyncio.sleep(1)
|
|
|
resp = await self._gql('getDLSHostCalendar', _HASHES['getDLSHostCalendar'], variables, referer)
|
|
|
days = _extract_days(resp)
|
|
|
- if not days:
|
|
|
- _log.warning('Airbnb: still empty calendar for %d-%02d after retry', year, month)
|
|
|
+ if not days or not _has_prices(days):
|
|
|
+ _log.warning('Airbnb: still empty/priceless calendar for %d-%02d after retry', year, month)
|
|
|
return days
|
|
|
|
|
|
async def _get_month_days(self, month: int, year: int) -> list[dict]:
|