x2c-socialposter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese简体中文 | English
简体中文 | English
X2C Social Poster
X2C Social Poster
Source: storyclaw-official/skills · Dashboard: x2creel.ai
Publish posts, manage comments, and upload media to 13+ social platforms via X2C Open API. Features smart upload (auto-selects pre-signed URL for large files), per-platform validation, and one-step publish with local files.
来源: storyclaw-official/skills · 管理后台: x2creel.ai
通过X2C Open API向13个以上社交平台发布帖子、管理评论、上传媒体资源。支持智能上传(大文件自动选择预签名URL)、分平台校验、本地文件一键发布。
Installation Requirements
安装要求
| Requirement | Value |
|---|---|
| Binary | |
| Environment | |
| Pip | |
Set before use. The script will prompt if not configured.
X2C_API_KEYFirst-Time Setup Guide
首次设置指南
When the user invokes this skill for the first time, follow these onboarding steps IN ORDER:
用户首次调用该工具时,请按顺序执行以下引导步骤:
Step 0: Check API Key
步骤0: 检查API Key
bash
python3 scripts/x2c_social.py --action check-key- If the key is set → proceed to Step 1.
- If the key is NOT set → guide the user:
🔑 X2C API Key is not configured yet. Let's set it up:
1. Go to https://www.x2creel.ai/social-accounts and sign up / log in
2. Click "Link Account" to connect your social media accounts (TikTok, Instagram, etc.)
3. On the same page, scroll down to "Developer API Key" section and click "Get API Key"
4. Copy your X2C Open API Key and paste it here
Once you provide the key, I'll save it for you.bash
python3 scripts/x2c_social.py --action check-key- 密钥已设置 → 进入步骤1。
- 密钥未设置 → 引导用户:
🔑 X2C API Key 尚未配置。我们来完成配置:
1. 访问 https://www.x2creel.ai/social-accounts 注册/登录
2. 点击「绑定账号」连接你的社交媒体账号(TikTok、Instagram等)
3. 在同一页面下滑到「开发者API Key」板块,点击「获取API Key」
4. 复制你的X2C Open API Key并粘贴到此处
提供密钥后,我会为你保存。Step 1: Verify Linked Accounts
步骤1: 验证绑定账号
bash
python3 scripts/x2c_social.py --action statusDisplay the linked platforms. If none are linked:
⚠️ No social accounts linked yet.
Please visit https://www.x2creel.ai/social-accounts to link your accounts.bash
python3 scripts/x2c_social.py --action status展示已绑定的平台。如果未绑定任何账号:
⚠️ 尚未绑定任何社交账号。
请访问 https://www.x2creel.ai/social-accounts 绑定你的账号。Platform Requirements Quick Reference
平台要求速查表
Before publishing, always check the target platform's requirements and guide the user accordingly.
| Platform | ID | Media Required | Text Limit | Max Media | Supported Types | Key Constraints |
|---|---|---|---|---|---|---|
| YouTube | | ✅ (video) | title:100 desc:5,000 | 1 video | MP4, MOV, AVI, WMV | |
| ✅ | 2,200 | 10 (carousel) | JPEG, PNG, MP4 | Must be Business/Creator. No text-only. Max 5 hashtags, 3 @mentions. | |
| TikTok | | ✅ | 2,200 | 1 video or 35 images | MP4, JPG, JPEG, WEBP | Images & video can't mix. No PNG. No |
| X (Twitter) | | ❌ | 280 | 4 images or 1 video | JPEG, PNG, GIF, MP4 | Images and videos can't mix. BYO API keys required. Use |
| ❌ | 63,206 | 10+ | JPEG, PNG, MP4 | Must be a Page (not personal). | |
| ❌ | 3,000 | 9 | JPEG, PNG, GIF, MP4 | Personal or Company page. | |
| ✅ | 500 | 5 (carousel) | JPEG, PNG | Image required. Video requires | |
| ❌ | title:300 post:40,000 | 1 | JPEG, PNG, GIF, MP4 | | |
| GMB | | ❌ | 1,500 | 1 | JPEG, PNG, MP4 | Verified business. No phone numbers in text. |
| Bluesky | | ❌ | 300 | 4 | JPEG, PNG, MP4 | 300 chars including links. |
| Threads | | ❌ | 500 | 10 (carousel) | JPEG, PNG, MP4 | Linked to Instagram account. |
| Snapchat | | ✅ | 160 | 1 | JPEG, PNG, MP4 | Exactly 1 media item. |
| Telegram | | ❌ | 4,096 | 1 | JPEG, PNG, GIF, MP4 | Bot + Channel/Group. |
发布前请始终检查目标平台的要求,并对应引导用户。
| 平台 | ID | 需要媒体 | 文本长度限制 | 最大媒体数量 | 支持格式 | 关键限制 |
|---|---|---|---|---|---|---|
| YouTube | | ✅(视频) | 标题:100 描述:5,000 | 1个视频 | MP4, MOV, AVI, WMV | |
| ✅ | 2,200 | 10(轮播) | JPEG, PNG, MP4 | 必须是企业/创作者账号。不支持纯文本。最多5个话题标签,3次@提及。 | |
| TikTok | | ✅ | 2,200 | 1个视频或35张图片 | MP4, JPG, JPEG, WEBP | 图片和视频不能混合。不支持PNG。文本中不能有换行符 |
| X (Twitter) | | ❌ | 280 | 4张图片或1个视频 | JPEG, PNG, GIF, MP4 | 图片和视频不能混合。需要自备API密钥。超过280字符请使用 |
| ❌ | 63,206 | 10+ | JPEG, PNG, MP4 | 必须是主页账号(非个人账号)。 | |
| ❌ | 3,000 | 9 | JPEG, PNG, GIF, MP4 | 个人主页或企业主页均可。 | |
| ✅ | 500 | 5(轮播) | JPEG, PNG | 必须上传图片。视频需要提供 | |
| ❌ | 标题:300 正文:40,000 | 1 | JPEG, PNG, GIF, MP4 | | |
| GMB | | ❌ | 1,500 | 1 | JPEG, PNG, MP4 | 已验证的企业账号。文本中不能包含电话号码。 |
| Bluesky | | ❌ | 300 | 4 | JPEG, PNG, MP4 | 300字符包含链接长度。 |
| Threads | | ❌ | 500 | 10(轮播) | JPEG, PNG, MP4 | 需绑定Instagram账号。 |
| Snapchat | | ✅ | 160 | 1 | JPEG, PNG, MP4 | 必须且仅能上传1个媒体文件。 |
| Telegram | | ❌ | 4,096 | 1 | JPEG, PNG, GIF, MP4 | 需要机器人+频道/群组权限。 |
⚠️ Multi-Platform Posting Caveat
⚠️ 多平台发布注意事项
When posting to multiple platforms simultaneously, content guards apply sequentially — the shortest character limit wins and will truncate for all platforms. If you need different text per platform, make separate publish calls.
同时向多个平台发布时,内容校验会依次生效——最短字符限制优先,所有平台的内容都会按该长度截断。如果你需要为不同平台设置不同文案,请发起单独的发布请求。
Platform-Specific Parameters
平台特定参数
When publishing to these platforms, the script automatically validates and builds platform options:
| Parameter | Platforms | Description |
|---|---|---|
| YouTube, Reddit | Post/video title (required). YouTube auto-generates from post text if missing (max 100 chars). |
| Target subreddit without | |
| YouTube, TikTok | |
| Thumbnail URL for video pins (required for video) | |
| TikTok | Mark content as AI-generated (recommended for AI content) |
向这些平台发布时,脚本会自动校验并生成平台专属配置:
| 参数 | 适用平台 | 说明 |
|---|---|---|
| YouTube, Reddit | 帖子/视频标题(必填)。YouTube缺失时将自动从正文中生成(最多100字符)。 |
| 目标社区,无需带 | |
| YouTube, TikTok | YouTube可选 |
| 视频 pin 的缩略图URL(视频必填) | |
| TikTok | 标注内容为AI生成(AI内容建议填写) |
Media Upload
媒体上传
The script uses smart upload — automatically selects the best method based on file size:
| Method | File Size | Limit | How It Works |
|---|---|---|---|
| Direct upload | ≤ 50MB | ~50MB | One-step multipart upload |
| Pre-signed URL | > 50MB | 5GB | Gets S3 pre-signed URL → PUT directly to S3 |
This is handled automatically — the user just provides a file path and the script picks the right method.
脚本使用智能上传——根据文件大小自动选择最优上传方式:
| 上传方式 | 文件大小 | 上限 | 工作原理 |
|---|---|---|---|
| 直传 | ≤ 50MB | ~50MB | 单步分片上传 |
| 预签名URL上传 | > 50MB | 5GB | 获取S3预签名URL → 直接PUT上传到S3 |
该过程完全自动,用户只需提供文件路径,脚本会自动选择合适的上传方式。
Standalone Upload
独立上传
bash
undefinedbash
undefinedSmall file → direct upload
小文件 → 直传
python3 scripts/x2c_social.py --action upload --file /path/to/image.jpg
python3 scripts/x2c_social.py --action upload --file /path/to/image.jpg
Large file → auto pre-signed upload
大文件 → 自动使用预签名上传
python3 scripts/x2c_social.py --action upload --file /path/to/large_video.mp4 --folder videos
undefinedpython3 scripts/x2c_social.py --action upload --file /path/to/large_video.mp4 --folder videos
undefinedOne-Step Publish with Local Files
本地文件一键发布
When publishing, local files are auto-uploaded before publishing — no separate upload step needed:
bash
undefined发布时,本地文件会自动上传后再发布,无需单独执行上传步骤:
bash
undefined75MB video → auto pre-signed upload → publish
75MB视频 → 自动预签名上传 → 发布
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Check this out! 🎬"
--media-files /path/to/large_video.mp4
--platforms tiktok instagram
--post "Check this out! 🎬"
--media-files /path/to/large_video.mp4
Output flow:
```json
{"status": "uploading", "file": "large_video.mp4", "size_mb": 75.2, "method": "presigned", "message": "..."}
{"status": "uploaded", "file": "large_video.mp4", "url": "https://v.arkfs.co/.../large_video.mp4", "method": "presigned"}
{"success": true, "data": {"id": "post_abc123", "postIds": [...]}}python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Check this out! 🎬"
--media-files /path/to/large_video.mp4
--platforms tiktok instagram
--post "Check this out! 🎬"
--media-files /path/to/large_video.mp4
输出流程:
```json
{"status": "uploading", "file": "large_video.mp4", "size_mb": 75.2, "method": "presigned", "message": "..."}
{"status": "uploaded", "file": "large_video.mp4", "url": "https://v.arkfs.co/.../large_video.mp4", "method": "presigned"}
{"success": true, "data": {"id": "post_abc123", "postIds": [...]}}Commands
命令说明
1. Check Linked Accounts
1. 查看绑定账号
bash
python3 scripts/x2c_social.py --action statusbash
python3 scripts/x2c_social.py --action status2. Publish Post
2. 发布帖子
bash
undefinedbash
undefinedText-only (works for: twitter, facebook, linkedin, reddit, gmb, bluesky, threads, telegram)
纯文本(支持平台:twitter, facebook, linkedin, reddit, gmb, bluesky, threads, telegram)
python3 scripts/x2c_social.py --action publish
--platforms twitter facebook
--post "Hello world! 🚀"
--platforms twitter facebook
--post "Hello world! 🚀"
python3 scripts/x2c_social.py --action publish
--platforms twitter facebook
--post "Hello world! 🚀"
--platforms twitter facebook
--post "Hello world! 🚀"
With local file — auto-uploaded (any size up to 5GB)
带本地文件 → 自动上传(最大支持5GB)
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-files /path/to/video.mp4
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-files /path/to/video.mp4
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-files /path/to/video.mp4
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-files /path/to/video.mp4
With remote URL
带远程URL
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-urls "https://example.com/video.mp4"
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-urls "https://example.com/video.mp4"
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-urls "https://example.com/video.mp4"
--platforms tiktok instagram
--post "Watch this! 🎬"
--media-urls "https://example.com/video.mp4"
Mix local + remote
本地+远程混合
python3 scripts/x2c_social.py --action publish
--platforms facebook
--post "Double media! 🎬"
--media-files /local/video.mp4
--media-urls "https://cdn.example.com/image.jpg"
--platforms facebook
--post "Double media! 🎬"
--media-files /local/video.mp4
--media-urls "https://cdn.example.com/image.jpg"
python3 scripts/x2c_social.py --action publish
--platforms facebook
--post "Double media! 🎬"
--media-files /local/video.mp4
--media-urls "https://cdn.example.com/image.jpg"
--platforms facebook
--post "Double media! 🎬"
--media-files /local/video.mp4
--media-urls "https://cdn.example.com/image.jpg"
YouTube — title required
YouTube → 必填标题
python3 scripts/x2c_social.py --action publish
--platforms youtube
--post "Video description here"
--title "My YouTube Video"
--visibility public
--media-files /path/to/video.mp4
--platforms youtube
--post "Video description here"
--title "My YouTube Video"
--visibility public
--media-files /path/to/video.mp4
python3 scripts/x2c_social.py --action publish
--platforms youtube
--post "Video description here"
--title "My YouTube Video"
--visibility public
--media-files /path/to/video.mp4
--platforms youtube
--post "Video description here"
--title "My YouTube Video"
--visibility public
--media-files /path/to/video.mp4
Reddit — title + subreddit required
Reddit → 必填标题和目标社区
python3 scripts/x2c_social.py --action publish
--platforms reddit
--post "Post body text"
--title "Discussion: AI in 2026"
--subreddit technology
--platforms reddit
--post "Post body text"
--title "Discussion: AI in 2026"
--subreddit technology
python3 scripts/x2c_social.py --action publish
--platforms reddit
--post "Post body text"
--title "Discussion: AI in 2026"
--subreddit technology
--platforms reddit
--post "Post body text"
--title "Discussion: AI in 2026"
--subreddit technology
TikTok — mark AI content
TikTok → 标注AI内容
python3 scripts/x2c_social.py --action publish
--platforms tiktok
--post "AI generated content"
--ai-generated
--media-files /path/to/ai_video.mp4
--platforms tiktok
--post "AI generated content"
--ai-generated
--media-files /path/to/ai_video.mp4
python3 scripts/x2c_social.py --action publish
--platforms tiktok
--post "AI generated content"
--ai-generated
--media-files /path/to/ai_video.mp4
--platforms tiktok
--post "AI generated content"
--ai-generated
--media-files /path/to/ai_video.mp4
Scheduled post
定时发布
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Coming soon! ⏰"
--media-files /path/to/video.mp4
--schedule "2026-04-01T12:00:00Z"
--platforms tiktok instagram
--post "Coming soon! ⏰"
--media-files /path/to/video.mp4
--schedule "2026-04-01T12:00:00Z"
python3 scripts/x2c_social.py --action publish
--platforms tiktok instagram
--post "Coming soon! ⏰"
--media-files /path/to/video.mp4
--schedule "2026-04-01T12:00:00Z"
--platforms tiktok instagram
--post "Coming soon! ⏰"
--media-files /path/to/video.mp4
--schedule "2026-04-01T12:00:00Z"
Shorten links
自动缩短链接
python3 scripts/x2c_social.py --action publish
--platforms twitter linkedin
--post "Read our blog: https://example.com/very-long-url"
--shorten-links
--platforms twitter linkedin
--post "Read our blog: https://example.com/very-long-url"
--shorten-links
undefinedpython3 scripts/x2c_social.py --action publish
--platforms twitter linkedin
--post "Read our blog: https://example.com/very-long-url"
--shorten-links
--platforms twitter linkedin
--post "Read our blog: https://example.com/very-long-url"
--shorten-links
undefined3. Get Post History
3. 获取发布历史
bash
python3 scripts/x2c_social.py --action posts
python3 scripts/x2c_social.py --action posts --platform tiktokbash
python3 scripts/x2c_social.py --action posts
python3 scripts/x2c_social.py --action posts --platform tiktok4. Delete Post
4. 删除帖子
bash
python3 scripts/x2c_social.py --action delete-post --post-id post_abc123
python3 scripts/x2c_social.py --action delete-post --post-id post_abc123 --bulkbash
python3 scripts/x2c_social.py --action delete-post --post-id post_abc123
python3 scripts/x2c_social.py --action delete-post --post-id post_abc123 --bulk5. Post Comment
5. 发布评论
bash
python3 scripts/x2c_social.py --action comment \
--post-id post_abc123 --platforms tiktok --comment "Great! 🔥"bash
python3 scripts/x2c_social.py --action comment \
--post-id post_abc123 --platforms tiktok --comment "Great! 🔥"6. Get Comments
6. 获取评论列表
bash
python3 scripts/x2c_social.py --action comments --post-id post_abc123 --platform tiktokbash
python3 scripts/x2c_social.py --action comments --post-id post_abc123 --platform tiktok7. Reply to Comment
7. 回复评论
bash
python3 scripts/x2c_social.py --action reply \
--comment-id comment_xyz --platforms tiktok --comment "Thanks!"bash
python3 scripts/x2c_social.py --action reply \
--comment-id comment_xyz --platforms tiktok --comment "Thanks!"8. Delete Comment
8. 删除评论
bash
python3 scripts/x2c_social.py --action delete-comment --comment-id comment_xyzbash
python3 scripts/x2c_social.py --action delete-comment --comment-id comment_xyz9. Upload Media (standalone)
9. 上传媒体(独立使用)
bash
python3 scripts/x2c_social.py --action upload --file /path/to/file.mp4 --folder videosbash
python3 scripts/x2c_social.py --action upload --file /path/to/file.mp4 --folder videosParameter Reference
参数参考
| Parameter | Required | Description |
|---|---|---|
| ✅ | Action to perform |
| for publish | Post text content |
| for publish | Space-separated target platforms |
| for filtering | Single platform filter |
| ❌ | Remote URLs or local paths (auto-uploaded) |
| ❌ | Local file paths to auto-upload and attach |
| ❌ | ISO 8601 date for scheduled posting |
| ❌ | Shorten URLs in post text |
| YouTube, Reddit | Post/video title |
| Target subreddit (without | |
| YouTube, TikTok | Post visibility setting |
| Video thumbnail URL | |
| TikTok | Mark as AI-generated content |
| for post ops | Ayrshare post ID |
| for comment ops | Comment ID |
| for comment/reply | Comment or reply text |
| ❌ | Delete from all platforms |
| for upload | Local file path to upload |
| ❌ | Upload subfolder (default: |
| 参数 | 是否必填 | 说明 |
|---|---|---|
| ✅ | 要执行的操作 |
| 发布时必填 | 帖子文本内容 |
| 发布时必填 | 空格分隔的目标平台列表 |
| 过滤时使用 | 单个平台过滤条件 |
| ❌ | 远程URL或本地路径(自动上传) |
| ❌ | 要自动上传并挂载的本地文件路径 |
| ❌ | 定时发布的ISO 8601格式时间 |
| ❌ | 自动缩短帖子中的URL |
| YouTube、Reddit必填 | 帖子/视频标题 |
| Reddit必填 | 目标社区(不带 |
| YouTube、TikTok使用 | 帖子可见性设置 |
| Pinterest使用 | 视频缩略图URL |
| TikTok使用 | 标注内容为AI生成 |
| 帖子操作时必填 | Ayrshare帖子ID |
| 评论操作时必填 | 评论ID |
| 评论/回复时必填 | 评论或回复文本 |
| ❌ | 从所有平台删除 |
| 上传时必填 | 要上传的本地文件路径 |
| ❌ | 上传子目录(默认: |
Interaction Guide
交互指南
When the user request is vague, guide per the steps below. If the user has provided enough info, run the command directly.
用户请求模糊时,请按以下步骤引导。如果用户已提供足够信息,可直接运行命令。
Step 1: Onboarding Check
步骤1: 首次引导检查
Always run the First-Time Setup Guide first. Verify API key and linked accounts.
始终优先执行首次设置指南,验证API Key和绑定账号状态。
Step 2: Determine Intent
步骤2: 确认用户意图
What would you like to do?
Options:
📝 Publish a post
📊 View post history
💬 Manage comments
📤 Upload media
🔗 Check linked accounts你想要执行什么操作?
可选选项:
📝 发布帖子
📊 查看发布历史
💬 管理评论
📤 上传媒体
🔗 查看绑定账号Step 3: For Publishing — Platform-Aware Guidance
步骤3: 发布场景下的平台适配引导
-
Ask which platforms → show only linked platforms fromcheck.
status -
Check platform requirements and proactively ask for required fields:
- YouTube → ask for and
--title--visibility - Reddit → ask for and
--title--subreddit - Instagram/TikTok/Pinterest/Snapchat → remind media is required
- TikTok with AI content → suggest
--ai-generated
- YouTube → ask for
-
Ask for post content → check text length against platform limits.
-
Ask about media → accept local files or remote URLs. Local files auto-upload (any size).
-
Ask about scheduling → publish now or schedule for later.
-
询问目标平台 → 仅展示检查返回的已绑定平台。
status -
检查平台要求,主动询问必填字段:
- YouTube → 询问和
--title--visibility - Reddit → 询问和
--title--subreddit - Instagram/TikTok/Pinterest/Snapchat → 提醒需要上传媒体
- TikTok发布AI内容 → 建议标注
--ai-generated
- YouTube → 询问
-
询问帖子内容 → 对照平台限制检查文本长度。
-
询问媒体需求 → 支持本地文件或远程URL,本地文件会自动上传(无大小限制)。
-
询问发布时间 → 立即发布或定时发布。
Step 4: Execute and Display
步骤4: 执行并展示结果
Run the command. The script will:
- Auto-upload local files (smart method selection)
- Validate against platform requirements
- Build platform-specific options
- Publish and return per-platform results
Display results clearly, highlighting any per-platform success/failure.
运行命令,脚本会自动执行以下操作:
- 智能选择方式上传本地文件
- 对照平台要求校验内容
- 生成平台专属配置
- 发布并返回各平台的发布结果
清晰展示结果,重点标注各平台的成功/失败状态。
Error Handling
错误处理
| Code | Meaning | Action |
|---|---|---|
| 400 | Missing/invalid parameters | Check platform requirements and fix |
| 401 | Invalid API key | Guide user to verify/reset key |
| 500 | Server error | Retry or inform user |
The script also performs client-side validation before calling the API:
- Text length per platform
- Media required check
- Required fields (title, subreddit)
- Media count limits (Snapchat = 1)
Fatal validation errors block the publish. Warnings are displayed but don't block.
| 错误码 | 含义 | 处理方式 |
|---|---|---|
| 400 | 参数缺失/无效 | 检查平台要求并修正参数 |
| 401 | API密钥无效 | 引导用户验证/重置密钥 |
| 500 | 服务器错误 | 重试或告知用户 |
脚本调用API前还会执行客户端校验:
- 各平台的文本长度校验
- 媒体必填检查
- 必填字段校验(标题、目标社区等)
- 媒体数量限制校验(Snapchat仅允许1个)
致命校验错误会阻断发布,警告信息会展示但不会阻断发布。