xpzouying/xiaohongshu-mcp · warning

笔记不可访问: %s

Error message

笔记不可访问: %s

What it means

checkPageAccessible detects blocked-note pages on xiaohongshu by keyword matching the page text (e.g. '因违规无法查看'). When a known blocking keyword appears, it throws '笔记不可访问: <keyword>' to abort detail/comment operations on an inaccessible note.

Source

Thrown at xiaohongshu/feed_detail.go:928

	// 检查关键词
	keywords := []string{
		"当前笔记暂时无法浏览",
		"该内容因违规已被删除",
		"该笔记已被删除",
		"内容不存在",
		"笔记不存在",
		"已失效",
		"私密笔记",
		"仅作者可见",
		"因用户设置,你无法查看",
		"因违规无法查看",
	}

	for _, kw := range keywords {
		if strings.Contains(text, kw) {
			logrus.Warnf("笔记不可访问: %s", kw)
			return fmt.Errorf("笔记不可访问: %s", kw)
		}
	}

	// 如果有文本但不匹配关键词,返回未知错误
	trimmedText := strings.TrimSpace(text)
	if trimmedText != "" {
		logrus.Warnf("笔记不可访问(未知原因): %s", trimmedText)
		return fmt.Errorf("笔记不可访问: %s", trimmedText)
	}

	return nil
}

// ========== 数据提取 ==========

func (f *FeedDetailAction) extractFeedDetail(page *rod.Page, feedID string) (*FeedDetailResponse, error) {
	var result string

View on GitHub (pinned to 332d196854)

Solutions

  1. Check the note URL in a browser; if it is blocked the note cannot be processed — skip it
  2. Refresh the feed ID from a fresh feeds list instead of a cached one
  3. Catch this error and mark the note as inaccessible in your pipeline rather than retrying

Example fix

// before
detail, err := client.GetFeedDetailWithConfig(ctx, feedID, cfg)
if err != nil { return err }
// after
detail, err := client.GetFeedDetailWithConfig(ctx, feedID, cfg)
if err != nil {
    if strings.Contains(err.Error(), "笔记不可访问") { log.Warn("skip blocked note "+feedID); return nil }
    return err
}
Defensive patterns

Strategy: try-catch

Try / catch

detail, err := client.GetFeedDetailWithConfig(ctx, id, cfg)
if err != nil {
    if strings.Contains(err.Error(), "笔记不可访问") {
        log.Warnf("skip inaccessible note %s: %v", id, err)
        return nil // skip
    }
    return err
}

Prevention

When it happens

Trigger: Calling GetFeedDetailWithConfig, PostComment or ReplyToComment on a note whose rendered page text contains a block keyword such as '因违规无法查看' (note deleted, private, region-locked, or taken down for violation).

Common situations: Note was deleted by the author or removed by moderation after you captured its ID; note requires login/attention to view; scraping a note ID from an old cached list.

Related errors


AI-assisted analysis of xpzouying/xiaohongshu-mcp@332d196854 (2026-09-05). Data as JSON: /api/errors/d560e79169d99feb. Report an issue: GitHub.