NanmiCoder / NanmiCoder/MediaCrawler
[BUG] 小红书扫码之后提示 无登陆信息
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 65.3k
- Forks
- 12.6k
- PR merge metrics
- No merged PRs in 30d
Description
🔍 问题检查清单
- 我已经仔细阅读了项目使用过程中的常见问题汇总
- 我已经搜索并查看了已关闭的issues
- 我确认这不是由于滑块验证码、Cookie过期、Cookie提取错误、平台风控等常见原因导致的问题
🐛 问题描述
mac UV 环境下
拉起网页扫码登录后,扫码成功,几秒钟跳转成到重新登陆,提示无登陆信息
我尝试扫码两次,也一样是失败,第二次页面直接关闭了
我自己打开网页登陆,扫了两次才登陆成功
📝 复现步骤
- 选择小红书,开始爬虫
- 扫码
- 提示无登陆信息,又出现了新的扫码
💻 运行环境
- 操作系统: mac
- Python版本: 3.14.3
- 是否使用IP代理: 无
- 是否使用VPN翻墙软件:无
- 目标平台(抖音/小红书/微博等): 小红书
📋 错误日志
18:55:38]
[DATA]
The above exception was the direct cause of the following exception:
[18:55:38]
[DATA]
Traceback (most recent call last):
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/main.py", line 157, in <module>
[18:55:38]
[DATA]
run(main, async_cleanup, cleanup_timeout_seconds=15.0, on_first_interrupt=_force_stop)
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/tools/app_runner.py", line 109, in run
[18:55:38]
[DATA]
asyncio.run(_runner())
[18:55:38]
[DATA]
File "/Users/tz/.local/share/uv/python/cpython-3.11.15-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 190, in run
[18:55:38]
[DATA]
return runner.run(main)
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/.local/share/uv/python/cpython-3.11.15-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 118, in run
[18:55:38]
[DATA]
return self._loop.run_until_complete(task)
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/.local/share/uv/python/cpython-3.11.15-macos-aarch64-none/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
[18:55:38]
[DATA]
return future.result()
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/tools/app_runner.py", line 96, in _runner
[18:55:38]
[DATA]
await app_main()
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/main.py", line 110, in main
[18:55:38]
[DATA]
await crawler.start()
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/media_platform/xhs/core.py", line 113, in start
[18:55:38]
[DATA]
await self.search()
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/media_platform/xhs/core.py", line 147, in search
[18:55:38]
[DATA]
notes_res = await self.xhs_client.get_note_by_keyword(
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/media_platform/xhs/client.py", line 292, in get_note_by_keyword
[18:55:38]
[DATA]
return await self.post(uri, data)
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/media_platform/xhs/client.py", line 184, in post
[18:55:38]
[DATA]
return await self.request(
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/.venv/lib/python3.11/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
[18:55:38]
[DATA]
return await fn(*args, **kwargs)
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/.venv/lib/python3.11/site-packages/tenacity/_asyncio.py", line 47, in __call__
[18:55:38]
[DATA]
do = self.iter(retry_state=retry_state)
[18:55:38]
[DATA]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[18:55:38]
[DATA]
File "/Users/tz/worker/MediaCrawler/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 326, in iter
[18:55:38]
[DATA]
raise retry_exc from fut.exception()
[18:55:38]
[ERR]
tenacity.RetryError: RetryError[<Future at 0x131f0aa50 state=finished raised DataFetchError>]
[18:55:41]
[WARN]
Crawler exited with code: 1
📷 错误截图
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in media_platform/xhs/core.py at start() and search(), then follow the login-related request flow into media_platform/xhs/client.py, including post() and request(). Reproduce the macOS UV scan-login flow and inspect the reported DataFetchError and RetryError. Done means a successful scan login allows the crawler to proceed without showing another login prompt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100