Commit Graph

56 Commits

Author SHA1 Message Date
zy
fcbf554016 refactor: Private bool → Visibility string 支持多种可见范围 (#464)
* docs: 更新 API 文档以包含 private 参数的用途和可选性。

* refactor: visibility 功能从 Private bool 重构为 Visibility string

将发布时可见范围参数从 `Private bool` 改为 `Visibility string`,
支持三种选项:公开可见(默认)、仅自己可见、仅互关好友可见。

- 使用精确 CSS selector 替代遍历 span/label/div 的宽泛选择器
- 新增参数校验,不支持的选项直接返回错误
- 更新 API 文档和 MCP jsonschema 描述
- 与 upstream IsOriginal(原创声明) 功能共存

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: yryangang <dd101bb@qq.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 00:37:47 +08:00
liangzx
c22e8758ed feat: 添加小红书发布原创声明功能 2026-02-27 17:03:38 +08:00
tan jun
44061fdabc fix: 逐张等待图片上传完成,避免多图上传时图片丢失
每张图片上传后等待预览元素出现(最多60秒)再传下一张,
替代原来固定 sleep(1s) 的方式,解决部分图片静默丢失的问题。
跳过 current=0 的无意义日志
跳过上传等待中已知计数的重复日志

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 12:03:45 +08:00
tanjun
70f07e8327 fix: 多图上传改为逐张上传,适配页面 DOM 变化
原实现一次性上传所有图片,但小红书页面在第一张上传后会移除
.upload-input class,导致后续图片可能上传失败。
改为逐张上传,第一张用 .upload-input,后续用 input[type="file"],
每张独立 30s 超时,同时将 Must* 替换为错误返回。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:03:32 +08:00
tanjun
10898374e2 fix: 将发布流程中的 Must* 调用替换为错误返回,避免 context 取消时 panic
publish_content 和 publish_with_video 工具在 MCP 客户端断开或超时时,
rod 的 Must* 方法会因 context canceled 直接 panic。
将 inputTag、inputTags、submitPublish、submitPublishVideo 中的 Must* 调用
替换为带 error 返回的安全版本,使错误能正常传播而非 panic。

Closes #352

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 20:12:53 +08:00
tan jun
5c76f976ea fix: 适配小红书创作者中心页面更新 (#394) (#395)
- 发布按钮选择器改为 .publish-page-publish-btn button.bg-red
- 定时发布从 radio 改为 switch 开关 (.post-time-wrapper .d-switch)
- 日期时间输入改为单个输入框 (.date-picker-container input)
- 视频发布页面等待策略从 MustWaitIdle 改为 WaitLoad

Fixes #394

Co-authored-by: tanjun <tanjun@tanjundeMac-mini.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 01:38:28 +08:00
tan jun
e467f8447a feat: 添加定时发布功能 (#377)
- publish_content 和 publish_with_video 支持 schedule_at 参数
- 支持 ISO8601 格式时间,范围为 1 小时至 14 天
- 优化页面导航等待策略,提升发布稳定性

Co-authored-by: tanjun <tanjun@tanjundeMac-mini.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 12:08:03 +08:00
zy
8916dacdab publish: check title/content max length
检查 “标题”/“正文” 是否超出小红书要求的最大长度
2025-12-17 00:19:11 +08:00
haikow
486cfa0e68 修复绑定滑动评论区事件及添加使用说明 (#324)
* fix: 修复滑动绑定事件评论

* fix: fix

* fix: fix

* fix: 修复没有评论的场景

* fix

* fix: fix

---------

Co-authored-by: chekayo <9827969+chekayo@user.noreply.gitee.com>
2025-12-09 23:44:07 +08:00
chekayo
484ab31d8e fix: fix 2025-12-07 17:42:28 +08:00
chekayo
047fa7cb6f fix: fix 2025-12-07 17:11:11 +08:00
chekayo
aa8a64dbaf fix:fix 2025-12-07 17:06:41 +08:00
chekayo
8f01632f59 fix: fix 2025-12-07 15:35:30 +08:00
chekayo
cbbec86000 fix: 自定义修复,优化代码 2025-12-04 01:10:40 +08:00
chekayo
9b15339ef0 fix: 详情增加自定义加载数量 2025-12-03 02:42:50 +08:00
chekayo
c5fa30bd3e fix 2025-11-27 02:25:59 +08:00
chekayo
3947509479 fix: 修复滚动滑动回复问题 2025-11-24 02:05:30 +08:00
chekayo
c47ef233aa 增加更多评论详情内容 2025-11-15 14:58:54 +08:00
chekayo
19b0f8545d refactor(feed_detail): optimize comment loading logic in GetFeedDetail
- Replaced the previous comment loading JavaScript with a more efficient scrolling and collection mechanism.
- Improved the logic for determining scroll targets and handling comment counts.
- Enhanced error handling and logging for comment loading failures.
- Removed deprecated code related to the old comment loading approach.
2025-11-01 21:21:47 +08:00
chekayo
6484e58ade feat(feed_detail): add loadAllComments parameter to GetFeedDetail functionality
- Enhanced GetFeedDetail method to support loading all comments based on the new loadAllComments parameter.
- Updated related handlers and request structures to accommodate the new parameter.
- Improved logging to reflect the loading of all comments during feed detail retrieval.
- Implemented JavaScript logic to scroll and collect comments when loadAllComments is true.
2025-11-01 20:55:51 +08:00
chekayo
a169db603b refactor(comment_feed): streamline comment reply process and enhance error handling
- Removed redundant waiting times and improved the logic for finding comment elements and reply buttons.
- Simplified the reply button search by consolidating selectors and enhancing error messages.
- Improved the overall readability of the code by removing unnecessary comments and whitespace.
- Ensured better handling of potential errors during the comment reply process.
2025-10-28 02:02:08 +08:00
chekayo
4d01a362a9 feat(feeds): Enhance search functionality with additional filter options
- Added support for sorting, note type, time range, search scope, and location distance in the search feeds functionality.
- Updated SearchFeedsArgs struct to include new parameters for filtering.
- Modified handleSearchFeeds method to process and apply filters during feed search.
- Improved logging to include the number of applied filters.
2025-10-28 02:01:42 +08:00
hrz
94ed5d4477 修改 filterOptions 让接口更友好 (#260)
Co-authored-by: huruize <8985917+huruize007@user.noreply.gitee.com>
2025-10-23 23:52:34 +08:00
zy
d11cb1c833 update publish timeout (#245)
* update publish timeout

* add publish error message
2025-10-16 23:09:47 +08:00
zy
df623caf18 fix get data panic (#244)
* fix: 修复 data 获取时的循环引用错误
2025-10-16 23:00:57 +08:00
Carlo
844ff8c102 myProfileHandler (#239)
Co-authored-by: Buf Generate <buf-generate@bondee.com>
2025-10-16 21:17:28 +08:00
Carlo
d5138d32bc new_search (#238)
Co-authored-by: Buf Generate <buf-generate@bondee.com>
2025-10-16 21:15:13 +08:00
chekayo
408c641959 Merge remote-tracking branch 'upstream/main' into feature/comment-feed-logic
# Conflicts:
#	mcp_handlers.go
#	mcp_server.go
#	service.go
#	xiaohongshu/like_favorite.go
2025-10-09 23:20:41 +08:00
chekayo
e6bf9921ea refactor: improve comment posting logic with enhanced error handling and stability checks
- Updated the PostComment method to include error handling for navigation and element interactions.
- Replaced sleep calls with more reliable wait mechanisms to ensure page stability.
- Added checks for the presence of input elements and improved logging for better debugging.
2025-10-09 21:38:52 +08:00
haikow
66aa36b48c feat: add like and favorite functionality for feeds (#207)
* feat: add like and favorite functionality for feeds

- Implemented handleLikeFeed and handleFavoriteFeed methods in mcp_handlers.go to manage liking and favoriting feeds.
- Added LikeFavoriteArgs struct in mcp_server.go for handling parameters.
- Registered new MCP tools for liking and favoriting feeds in registerTools function.
- Introduced LikeFeed and FavoriteFeed methods in XiaohongshuService to interact with the respective actions.
- Created LikeFavoriteAction in a new file to encapsulate the logic for liking and favoriting feeds on the Xiaohongshu platform.

* "Fix-build-errors"

* refactor: streamline like and favorite actions in LikeFavoriteAction

- Introduced a generic method `performInteractAction` to handle both liking and favoriting feeds, reducing code duplication.
- Updated logging to reflect the action type being performed (like or favorite).
- Enhanced state verification after interaction to ensure accurate feedback on success or failure.
- Removed the `clickLastMatch` function, simplifying the interaction logic.

* "Add-unlike-and-unfavorite-functionality"

* "Refactor-performInteractAction-function"

* "Refactor-split-LikeFavoriteAction-into-separate-actions"

---------

Co-authored-by: chekayo <9827969+chekayo@user.noreply.gitee.com>
2025-10-08 11:40:45 +08:00
chekayo
7c2658dae5 "优化评论反馈逻辑:简化回复按钮查找和点击流程 2025-10-07 14:00:16 +08:00
chekayo
c6390bf014 feat: add like and favorite functionality for feeds
- Implemented handleLikeFeed and handleFavoriteFeed methods in mcp_handlers.go to manage liking and favoriting feeds.
- Added LikeFavoriteArgs struct in mcp_server.go for handling parameters.
- Registered new MCP tools for liking and favoriting feeds in registerTools function.
- Introduced LikeFeed and FavoriteFeed methods in XiaohongshuService to interact with the respective actions.
- Created LikeFavoriteAction in a new file to encapsulate the logic for liking and favoriting feeds on the Xiaohongshu platform.
2025-10-06 03:26:52 +08:00
zy
d84bf2e9a2 update rm popup window (#202) 2025-10-04 23:22:28 +08:00
zy
678bc71ae0 publish: 增加发布移除弹窗的操作 (#201)
* publish: 增加发布移除弹窗的操作

* 随机点击操作

* 更新点击的随机坐标
2025-10-04 21:14:47 +08:00
zy
0955723b19 feat: 为视频发布功能新增HTTP API接口和完善文档 (#179)
* 重构 publish tab 选择逻辑,把公共代码提取到同一个函数中

* feat: 为视频发布功能新增HTTP API接口和完善文档

- 新增 /api/v1/publish_video HTTP接口
- 添加 publishVideoHandler 处理函数
- 更新 API.md 增加视频发布接口文档
- 更新 README.md 和 README_EN.md 增加视频发布功能说明
- 在MCP工具列表中补充 publish_with_video 工具说明
2025-09-29 01:08:11 +08:00
Banghao Chi
8c3665a3de feat: publish with video (#171)
* feat: publish with video

* fix: add more timeout (network bandwidth + large files) and remove pop-up

* fix: remove excessive remove pop-up function
2025-09-29 00:34:47 +08:00
zy
c9002d06e8 publish: update publish, rm pop-cover (#176)
THANKS: @lmxdawn
CLOSE: #172
2025-09-28 22:41:31 +08:00
lmxdawn
a8a2743a51 feat: 支持返回登录二维码与 Docker 部署 (#155)
* feat: 支持返回登录二维码与 Docker 部署

* feat: 完善扫码登录功能

* fix: 修复当存在已经登录的情况,上层还会启动 goroutine的问题,并把 mcp 的返回增加为图片格式
2025-09-25 19:44:01 +08:00
CooperGuo
5f412a6bc5 feat:获取用户主页功能 (#122)
增加读取用户的个人主页的信息
2025-09-20 22:20:58 +08:00
Journey
fec85b2b30 feat: 添加图片上传验证与超时处理功能 (#115)
(cherry picked from commit 651b1578ae341f0a5cbb1447d483cc8954f7e5bc)

Co-authored-by: chengchongzhen <15939054361@163.com>
2025-09-20 00:16:07 +08:00
zy
b86d3626f1 Revert "Revert PR #105" - 恢复 publish.go 功能 (#109)
* Reapply "Merge pull request #105 from chengazhen/main" (#107)

This reverts commit 81ff26d6a7.

* feature: 获取有效的元素
2025-09-18 22:25:36 +08:00
zy
81ff26d6a7 Revert "Merge pull request #105 from chengazhen/main" (#107)
This reverts commit aaf5fdedf1.
2025-09-18 22:12:24 +08:00
Journey
aaf5fdedf1 Merge pull request #105 from chengazhen/main
feat: 添加蜜罐元素检测与过滤功能
2025-09-18 22:08:26 +08:00
zy
60e48fec0c types: del user xsecToken (#100)
删除用户中的 xsecToken,该字段暂时没有用,有的大模型容易识别错误,把user的token当做 note 的token用。

CLOSED #96
2025-09-17 22:26:06 +08:00
zy
3143576cc0 publish tags by arrow down (#80)
使用 arrow down 吧,arrow-right 有时候不能移动到最结尾
2025-09-16 02:12:21 +08:00
zy
90169ec894 refactor: 优化小红书标签输入逻辑 (#71)
* refactor: 优化小红书标签输入逻辑

- 调整 inputTag 函数以减少延迟时间
- 增加标签联想下拉框的等待时间
- 更新 MustInput 和 MustKeyActions 方法的调用顺序
- 添加错误处理和日志记录以增强稳定性

* update headless_browser version

* downgrade fetchup version

* update publish
2025-09-14 21:47:55 +08:00
zy
47aba20735 feat: 添加小红书标签功能支持 (#65)
* feat: 实现小红书标签输入和自动关联功能

- 在 PublishImageContent 结构体中添加 Tags 字段
- 实现 inputTags 函数处理多个标签输入
- 实现 inputTag 函数自动点击标签联想下拉框
- 通过 #creator-editor-topic-container 选择器定位标签下拉框
- 自动点击第一个 .item 元素完成标签关联
- 添加错误处理和日志记录

* feat: 为 MCP 和 HTTP API 添加标签(tags)支持

- 在 PublishRequest 结构体中添加 Tags 字段
- 更新 MCP handler 处理标签参数
- 更新 MCP 工具定义,添加 tags 参数说明
- HTTP API 自动支持 tags 字段(通过 PublishRequest)
- 保持向后兼容,tags 为可选参数
2025-09-14 15:06:23 +08:00
zy
f21183fa48 update wait for list feed and get feed details (#52)
更新一下 list-feed,get-feed-detail 行为的等待,
这里可能是 windows 的问题所在
2025-09-10 00:30:31 +08:00
zy
cd28e4064e feat: 添加小红书Feed评论功能 (#50)
实现通过HTTP GIN API和MCP API发表评论到小红书Feed的功能:
- 新增POST /api/v1/feeds/comment端点
- 新增post_comment_to_feed MCP工具
- 添加PostCommentRequest和PostCommentResponse类型
- 实现PostCommentToFeed服务方法
- 新增CommentFeedAction用于浏览器自动化操作

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 23:13:05 +08:00
zy
27575689a6 feat: enhance feed detail functionality with MCP interface improvements (#45)
* feat: add feed detail page functionality with gin and MCP interfaces

Add comprehensive Feed detail page support:
- Create new FeedDetailAction in xiaohongshu/feed_detail.go
- Add HTTP API endpoint POST /api/v1/feeds/detail
- Add MCP tool 'get_feed_detail' for MCP protocol support
- Support feed_id and xsec_token parameters (both required)
- Raw __INITIAL_STATE__ JSON data saved to feed_detail.json
- Return structured data for both HTTP and MCP interfaces

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: enhance feed detail functionality with MCP interface improvements

- Add comprehensive feed detail page support with proper data extraction
- Create dedicated feed_detail.go file for FeedDetailAction
- Optimize Go struct definitions based on actual JSON data analysis
- Remove unnecessary fields from FeedDetail, DetailImageInfo, CommentList, and Comment structs
- Update MCP interface description to reflect comment retrieval capability
- Support both HTTP REST API and MCP protocol interfaces
- Implement proper Vue 3 reactive data extraction from window.__INITIAL_STATE__
- Include feed content, user info, interaction data, and comment lists

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: restore JSON file writing for testing and improve code structure

- Restore feed_detail.json file writing for testing purposes
- Improve error handling by separating marshal and unmarshal steps
- Keep the original data extraction logic for complex Vue reactive data structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: simplify JSON unmarshaling using struct instead of map[string]any

- Replace complex map[string]any extraction with direct struct unmarshaling
- Define inline struct matching the actual JSON response structure
- Remove unnecessary extractFeedDetailData and extractNestedValue methods
- Significantly reduce code complexity and improve readability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: improve MCP interface descriptions for better usability

- Enhance get_feed_detail parameter descriptions with clear source information
- Clarify publish_content images parameter supports both local paths and URLs
- Improve search_feeds description to specify supported search types
- Keep descriptions concise and practical without over-complication

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: revert search_feeds keyword description to keep it simple

- Remove unnecessary details from keyword description
- Keep interface descriptions concise and clear

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 00:55:24 +08:00