feat: add Xiaohongshu (RedNote) extractor#292
Open
Afterimages wants to merge 1 commit into
Open
Conversation
Extract note content (description, images, video, tags) and comments
from xiaohongshu.com note pages via __INITIAL_STATE__ JSON parsing.
Comment extraction uses a three-tier fallback strategy:
1. Parse from __INITIAL_STATE__ (HTML source / MAIN world bridge)
2. Fetch from XHS comment API (async fallback)
3. Extract from rendered DOM elements (works without MAIN world access)
Additional features:
- Normalize JS-only tokens (undefined/NaN/Infinity) in JSON-like state
- Remove duplicate hashtag mentions from description text
- Include comments in contentHtml by default; opt-out via
excludeCommentsFromContent option
- Provide comments as {{comments}} template variable (markdown)
- Register extractor for xiaohongshu.com URL patterns
Relates kepano#273
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract note content (description, images, video, tags) and comments from xiaohongshu.com note pages via INITIAL_STATE JSON parsing.
Comment extraction uses a three-tier fallback strategy:
Additional features:
Relates #273