31 Commits

Author SHA1 Message Date
tanjun
db81fd8f80 fix: 修复商品绑定后卡住在等待弹窗关闭的问题
- 使用 page.Has 替代 page.Element 检测弹窗关闭,避免阻塞等待
- 简化 clickModalSaveButton,找不到按钮时不返回错误,继续执行
- 删除未使用的 clickConfirmButton 函数
- 添加详细日志输出便于调试
- 商品绑定完成后增加 1 秒等待时间

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:24:32 +08:00
tanjun
e7004fe1d5 fix: 修复商品绑定功能无法选择商品的问题
- 更新商品选择器: .goods-item .d-checkbox → .goods-list-normal .good-card-container .d-checkbox
- 更新 Loading 选择器: .d-loading → .goods-list-loading
- 更新商品列表选择器: .goods-item → .goods-list-normal .good-card-container
- 使用 page.Keyboard.Press 替代 searchInput.MustKeyActions 触发搜索
- 添加已选中状态检查,避免重复点击取消选中
- 添加随机延迟 800-1500ms 模拟人为操作
- 缩短轮询间隔至 100ms,更快响应
- 优化日志输出

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:24:32 +08:00
tanjun
d092830b67 feat: 添加商品绑定功能
- 在图文发布和视频发布流程中集成商品绑定功能
- 新增 Products 字段到发布请求结构体
- 实现 go-rod 原生商品绑定函数(bindProducts)
- 商品绑定失败将阻断发布流程并返回具体错误信息

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 10:24:32 +08:00
zy
8a7fe21b4b Merge pull request #430 from prehisle/fix/publish-tag-popup-stuck
fix: avoid tag popup blocking after content input
2026-03-01 01:19:48 +08:00
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
prehisle
36ca181c8b fix: avoid tag popup blocking after content input 2026-02-18 23:15:26 +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
chekayo
047fa7cb6f fix: fix 2025-12-07 17:11:11 +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
zy
d11cb1c833 update publish timeout (#245)
* update publish timeout

* add publish error message
2025-10-16 23:09:47 +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
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
zy
c9002d06e8 publish: update publish, rm pop-cover (#176)
THANKS: @lmxdawn
CLOSE: #172
2025-09-28 22:41:31 +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
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
86224dcaa3 update find content element (#10)
- Updated the getContentElement function to utilize the Race method for improved efficiency in finding content elements.
- Added error handling for cases where no elements are found, ensuring better logging and debugging capabilities.
2025-08-13 02:34:50 +08:00
zy
e156592d34 增加上传图片后,更多的等待时间 (#5)
FIX: #1
2025-08-11 23:15:50 +08:00
zy
7cd35ebb71 feat: implement xiaohongshu automation with MCP server
Complete implementation of xiaohongshu (Little Red Book) automation system:

### Core Features:
- **QR Code Login**: Automated login with cookie persistence
- **Content Publishing**: Post text, images with AI-powered descriptions
- **Browser Management**: Headless Chrome automation via go-rod
- **Cookie Persistence**: Session management for login state
- **MCP Server**: Model Context Protocol integration for Claude

### Technical Components:
- go-rod browser automation with stealth mode
- MCP server for Claude Code integration
- Cookie-based session management
- Robust error handling and logging
- Cross-platform compatibility

### API Endpoints:
- Login status checking and QR code authentication
- Content publishing with image upload support
- Navigation and page interaction utilities

This provides a complete foundation for xiaohongshu automation
with proper session management and MCP integration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 13:09:00 +08:00