From 6dd342074377e9f313f9c36043e9eff675a691a3 Mon Sep 17 00:00:00 2001 From: Relakkes Date: Mon, 2 Sep 2024 22:57:28 +0800 Subject: [PATCH] fix: #423 --- media_platform/xhs/client.py | 4 ++-- media_platform/xhs/core.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/media_platform/xhs/client.py b/media_platform/xhs/client.py index fd9589a..0b06169 100644 --- a/media_platform/xhs/client.py +++ b/media_platform/xhs/client.py @@ -217,8 +217,8 @@ class XiaoHongShuClient(AbstractApiClient): "source_note_id": note_id, "image_formats": ["jpg", "webp", "avif"], "extra": {"need_body_topic": 1}, - "xsec_source": xsec_source, - "xsec_token": xsec_token + # "xsec_source": xsec_source, + # "xsec_token": xsec_token } uri = "/api/sns/web/v1/feed" res = await self.post(uri, data) diff --git a/media_platform/xhs/core.py b/media_platform/xhs/core.py index 3334f06..b1c1b4f 100644 --- a/media_platform/xhs/core.py +++ b/media_platform/xhs/core.py @@ -220,7 +220,8 @@ class XiaoHongShuCrawler(AbstractCrawler): """Get note detail""" async with semaphore: try: - note_detail: Dict = await self.xhs_client.get_note_by_id_from_html(note_id) + # note_detail: Dict = await self.xhs_client.get_note_by_id_from_html(note_id) + note_detail: Dict = await self.xhs_client.get_note_by_id(note_id, xsec_source, xsec_token) if not note_detail: utils.logger.error( f"[XiaoHongShuCrawler.get_note_detail_async_task] Get note detail error, note_id: {note_id}")