From 4dd44944357b1de3a337d0f1c3e49ca54d4826b7 Mon Sep 17 00:00:00 2001 From: TPV Date: Sat, 26 Sep 2026 10:30:02 -0700 Subject: [PATCH] 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. --- samsung_shop/samsung_shop_monitor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/samsung_shop/samsung_shop_monitor.py b/samsung_shop/samsung_shop_monitor.py index d2e894c..74a746e 100644 --- a/samsung_shop/samsung_shop_monitor.py +++ b/samsung_shop/samsung_shop_monitor.py @@ -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