Skip to content

fix(xiaohongshu): support creator center URLs in creator-note-detail#1696

Open
FrankFuShMomentLab wants to merge 1 commit into
jackwener:mainfrom
FrankFuShMomentLab:fix/creator-note-detail-url-support
Open

fix(xiaohongshu): support creator center URLs in creator-note-detail#1696
FrankFuShMomentLab wants to merge 1 commit into
jackwener:mainfrom
FrankFuShMomentLab:fix/creator-note-detail-url-support

Conversation

@FrankFuShMomentLab
Copy link
Copy Markdown

Problem

The creator-note-detail command fails when users pass a full creator center URL (e.g., https://creator.xiaohongshu.com/statistics/note-detail?noteId=xxx) instead of a bare note ID.

Error: No note detail data found. Check note_id and login status for creator.xiaohongshu.com. (EmptyResultError)

Root cause: The command directly uses the raw note-id argument in page.goto(), causing a malformed URL when a full URL is passed.

Solution

  1. Enhanced parseNoteId() in note-helpers.js to support creator.xiaohongshu.com URLs
  2. Updated creator-note-detail.js to use parseNoteId() instead of raw input
  3. Added comprehensive tests

Test Results

All 154 xiaohongshu adapter tests pass.

Changes

  • clis/xiaohongshu/note-helpers.js: Add creator URL support to parseNoteId()
  • clis/xiaohongshu/creator-note-detail.js: Use parseNoteId() for robust ID extraction
  • clis/xiaohongshu/note-helpers.test.js: New test file (6 tests)
  • clis/xiaohongshu/creator-note-detail.test.js: Add creator URL test case

- Enhance parseNoteId() to extract noteId from creator.xiaohongshu.com URLs
- Update creator-note-detail.js to use parseNoteId() for robust ID extraction
- Add comprehensive tests for URL parsing and creator-note-detail command

Fixes: creator-note-detail fails when passed a full creator center URL
instead of a bare note ID, because the raw URL was used directly
in page.goto() causing 404/406 errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant