NanmiCoder / NanmiCoder/MediaCrawler

[问题] 小红书当前笔记暂时无法浏览

Open
#719 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
65.3k
Forks
12.6k
PR merge metrics
No merged PRs in 30d

Description

⚠️ 提交前确认

  • 我已经仔细阅读了项目使用过程中的常见问题汇总
  • 我已经搜索并查看了已关闭的issues
  • 我确认这不是由于滑块验证码、Cookie过期、Cookie提取错误、平台风控等常见原因导致的问题

❓ 问题描述

🔍 使用场景

  • 目标平台:小红书
  • 使用功能: 关键词搜索

💻 环境信息

  • 操作系统:
  • Python版本: 3.9
  • 是否使用IP代理: 是
  • 是否使用VPN翻墙软件:是
  • 目标平台(抖音/小红书/微博等): 小红书

📋 错误日志

2025-09-16 11:08:10 MediaCrawler INFO (login.py:183) - [XiaoHongShuLogin.login_by_qrcode] Login successful then wait for 5 seconds redirect ...
2025-09-16 11:08:15 MediaCrawler INFO (core.py:260) - [XiaoHongShuCrawler.get_specified_notes] Parse note url info: note_id='66fad51c000000001b0224b8' xsec_token='AB3rO-QopW5sgrJ41GwN01WCXh6yWPxjSoFI9D5JIMgKw=' xsec_source='pc_search'
2025-09-16 11:08:15 MediaCrawler INFO (core.py:307) - [get_note_detail_async_task] Begin get note detail, note_id: 66fad51c000000001b0224b8
2025-09-16 11:08:17 MediaCrawler ERROR (core.py:322) - [XiaoHongShuCrawler.get_note_detail_async_task] Get note detail error, note_id: 66fad51c000000001b0224b8
Traceback (most recent call last):
  File "MediaCrawler-main/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in __call__
    result = await fn(*args, **kwargs)
  File "MediaCrawler-main/media_platform/xhs/client.py", line 118, in request
    raise DataFetchError(data.get("msg", None))
media_platform.xhs.exception.DataFetchError: 当前笔记暂时无法浏览

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "MediaCrawler-main/main.py", line 67, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "MediaCrawler-main/main.py", line 57, in main
    await crawler.start()
  File "MediaCrawler-main/media_platform/xhs/core.py", line 114, in start
    await self.get_specified_notes()
  File "MediaCrawler-main/media_platform/xhs/core.py", line 273, in get_specified_notes
    note_details = await asyncio.gather(*get_note_detail_task_list)
  File "MediaCrawler-main/media_platform/xhs/core.py", line 328, in get_note_detail_async_task
    await self.xhs_client.get_note_by_id(
  File "MediaCrawler-main/media_platform/xhs/client.py", line 258, in get_note_by_id
    res = await self.post(uri, data)
  File "MediaCrawler-main/media_platform/xhs/client.py", line 150, in post
    return await self.request(
  File "/MediaCrawler-main/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
    return await fn(*args, **kwargs)
  File "MediaCrawler-main/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in __call__
    do = self.iter(retry_state=retry_state)
  File "MediaCrawler-main/.venv/lib/python3.9/site-packages/tenacity/__init__.py", line 326, in iter
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x138d37c10 state=finished raised DataFetchError>]

📷 错误截图

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the keyword-search flow described in the issue and trace the reported path through media_platform/xhs/core.py and media_platform/xhs/client.py. Check the request and retry handling around get_note_by_id and the DataFetchError message, then compare the result with the supplied logs. Done means the reported note-detail request has a defined, verified outcome rather than the same uninvestigated error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.