fix(xiaohongshu): use /search_result/<id> for bare note IDs#774
Merged
jackwener merged 1 commit intojackwener:mainfrom Apr 4, 2026
Merged
Conversation
XHS blocks /explore/<id> without a valid xsec_token, causing code 66 (empty result) when passing bare note IDs. The /search_result/<id> path works without xsec_token when the user is logged in via cookies. Changes: - note-helpers.ts: buildNoteUrl now uses /search_result/<id> for bare IDs - note.ts: remove isBareNoteId branching and simplify empty shell error
47d66c0 to
3614f26
Compare
jackwener
added a commit
that referenced
this pull request
Apr 4, 2026
Tests now expect /search_result/<id> for bare note IDs (matching the note-helpers.ts change from PR #774) and updated empty-shell hint assertion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jackwener
added a commit
that referenced
this pull request
Apr 4, 2026
* refactor: simplify core modules — remove root shims, consolidate error classification, streamline cascade/interceptor, clean up synthesize 1. Remove root-level shim files (errors.ts, logger.ts, registry.ts, types.ts, utils.ts, launcher.ts) — update all ~840 adapter imports to reference src/ directly 2. Consolidate interceptor: reuse shared DISGUISE_FN in tap interceptor instead of reimplementing 3. Unify error classification: single ClassifiedError type with icon/exitCode/hint lookup table, eliminating duplicated pattern matching between resolveExitCode and renderError 4. Simplify cascade probe: replace repetitive switch cases with PROBE_OPTIONS lookup map 12. Clean up synthesize.ts: remove deprecated snake_case field aliases (recommended_args, recommended_columns, recommendedColumnsLegacy) and unnecessary constant aliases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: update import paths in contributor docs and skill templates Update all documentation and skill files to reference src/ directly, matching the shim removal in the previous commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update new Gemini adapter imports to use src/ paths Fix imports in newly added deep-research adapter files that were still referencing the deleted root shim files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update xiaohongshu tests for /search_result/ URL change Tests now expect /search_result/<id> for bare note IDs (matching the note-helpers.ts change from PR #774) and updated empty-shell hint assertion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update LessWrong and hupu adapter imports to use src/ paths Fix imports in newly merged LessWrong and hupu/mentions adapter files that were still referencing the deleted root shim files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test(xueqiu): mock logger via src path --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Problem
opencli xiaohongshu note <bare-id>returns exit code 66 (empty result) becausebuildNoteUrlconstructs/explore/<id>URLs. XHS now blocks this path without a validxsec_token, rendering an empty shell page.Fix
Use
/search_result/<id>instead of/explore/<id>for bare note IDs. This path works withoutxsec_tokenwhen the user is logged in via cookies (which is always the case with opencli browser-based commands).Changes
note-helpers.ts:buildNoteUrlnow returns/search_result/<id>for bare IDsnote.ts: RemoveisBareNoteIdbranching and simplify empty-shell error messageTesting
Before (bare ID fails):
After (bare ID works):
Full URLs with
xsec_tokencontinue to work as before.