This commit is contained in:
Relakkes 2024-09-02 22:57:28 +08:00
parent d6fb255bdf
commit 6dd3420743
2 changed files with 4 additions and 3 deletions

View File

@ -217,8 +217,8 @@ class XiaoHongShuClient(AbstractApiClient):
"source_note_id": note_id, "source_note_id": note_id,
"image_formats": ["jpg", "webp", "avif"], "image_formats": ["jpg", "webp", "avif"],
"extra": {"need_body_topic": 1}, "extra": {"need_body_topic": 1},
"xsec_source": xsec_source, # "xsec_source": xsec_source,
"xsec_token": xsec_token # "xsec_token": xsec_token
} }
uri = "/api/sns/web/v1/feed" uri = "/api/sns/web/v1/feed"
res = await self.post(uri, data) res = await self.post(uri, data)

View File

@ -220,7 +220,8 @@ class XiaoHongShuCrawler(AbstractCrawler):
"""Get note detail""" """Get note detail"""
async with semaphore: async with semaphore:
try: 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: if not note_detail:
utils.logger.error( utils.logger.error(
f"[XiaoHongShuCrawler.get_note_detail_async_task] Get note detail error, note_id: {note_id}") f"[XiaoHongShuCrawler.get_note_detail_async_task] Get note detail error, note_id: {note_id}")