use get_response_json in get_category_products

Adds the body guard this site lacked; a non-dict body now logs and
returns before the fan-out instead of raising on searchTotalCount.
This commit is contained in:
TPV committed 2026-09-26 10:30:02 -07:00
1 parent c6c606b504
commit 4dd4494435
1 file changed
+7 -2
+7 -2
View File
@@ -14,7 +14,7 @@ from monitor_utils.runner import (
run_bounded_cycle,
setup_monitor_logging,
)
from monitor_utils.sessions import send_request
from monitor_utils.sessions import get_response_json, send_request
from motor.motor_asyncio import AsyncIOMotorCollection
setup_monitor_logging(monitor="samsung_shop")
@@ -73,7 +73,12 @@ async def get_category_products(
headers={"content-type": "application/x-www-form-urlencoded"},
)
data = response.json()
data = get_response_json(
response, logger=LOGGER, category=category_id, offset=offset
)
if data is None:
return
if offset != 0:
await process_page(data, category_id, offset, collection)
return