NanmiCoder / MediaCrawler

小红书笔记 | 评论爬虫、抖音视频 | 评论爬虫、快手视频 | 评论爬虫、B 站视频 | 评论爬虫、微博帖子 | 评论爬虫、百度贴吧帖子 | 百度贴吧评论回复爬虫 | 知乎问答文章|评论爬虫
https://nanmicoder.github.io/MediaCrawler/
Other
18.14k stars 5.61k forks source link

小红书 单篇笔记详情无法获取 #382

Closed fangd123 closed 3 months ago

fangd123 commented 3 months ago

提示如下:

Traceback (most recent call last):
  File "D:\new_projects\MediaCrawler\media_platform\xhs\core.py", line 201, in get_note_detail
    note_detail: Dict = await self.xhs_client.get_note_by_id(note_id, xsec_source, xsec_token)
  File "D:\new_projects\MediaCrawler\media_platform\xhs\client.py", line 223, in get_note_by_id
    res = await self.post(uri, data)
  File "D:\new_projects\MediaCrawler\media_platform\xhs\client.py", line 129, in post
    return await self.request(method="POST", url=f"{self._host}{uri}",
  File "D:\new_projects\MediaCrawler\media_platform\xhs\client.py", line 98, in request
    raise DataFetchError(data.get("msg", None))
media_platform.xhs.exception.DataFetchError: 访问链接异常
2024-08-10 18:57:23 MediaCrawler INFO (core.py:220) - [XiaoHongShuCrawler.batch_get_note_comments] Crawling comment mode is not enabled
2024-08-10 18:57:23 MediaCrawler INFO (core.py:88) - [XiaoHongShuCrawler.start] Xhs Crawler finished ...
NanmiCoder commented 3 months ago

命令是--type detail模式下吗

NanmiCoder commented 3 months ago

xhs现在指定note_id获取详情验证xsec_token了,之前是随便拿一个xsec_token都可以用,现在不行了,待修复。

NanmiCoder commented 3 months ago

已修复:https://github.com/NanmiCoder/MediaCrawler/commit/f371675d475a263a737b1c45058eec30af800fc0