x2c-socialposter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
简体中文 | English
简体中文 | English

X2C Social Poster

X2C Social Poster

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

安装要求

RequirementValue
Binary
python3
Environment
X2C_API_KEY
(required; obtain from X2C Dashboard)
Pip
requests
Set
X2C_API_KEY
before use. The script will prompt if not configured.

要求项取值
二进制依赖
python3
环境变量
X2C_API_KEY
(必填,可从X2C管理后台获取)
Pip依赖
requests
使用前请设置
X2C_API_KEY
,如果未配置脚本会给出提示。

First-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 status
Display 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.
PlatformIDMedia RequiredText LimitMax MediaSupported TypesKey Constraints
YouTube
youtube
✅ (video)title:100 desc:5,0001 videoMP4, MOV, AVI, WMV
--title
required (auto-gen if missing, max 100 chars). Default visibility = public.
Instagram
instagram
2,20010 (carousel)JPEG, PNG, MP4Must be Business/Creator. No text-only. Max 5 hashtags, 3 @mentions.
TikTok
tiktok
2,2001 video or 35 imagesMP4, JPG, JPEG, WEBPImages & video can't mix. No PNG. No
\n
in text. AI content must mark
--ai-generated
.
X (Twitter)
twitter
2804 images or 1 videoJPEG, PNG, GIF, MP4Images and videos can't mix. BYO API keys required. Use
longPost
for >280 chars.
Facebook
facebook
63,20610+JPEG, PNG, MP4Must be a Page (not personal).
LinkedIn
linkedin
3,0009JPEG, PNG, GIF, MP4Personal or Company page.
Pinterest
pinterest
5005 (carousel)JPEG, PNGImage required. Video requires
--thumbnail
.
Reddit
reddit
title:300 post:40,0001JPEG, PNG, GIF, MP4
--title
required.
--subreddit
required.
GMB
gmb
1,5001JPEG, PNG, MP4Verified business. No phone numbers in text.
Bluesky
bluesky
3004JPEG, PNG, MP4300 chars including links.
Threads
threads
50010 (carousel)JPEG, PNG, MP4Linked to Instagram account.
Snapchat
snapchat
1601JPEG, PNG, MP4Exactly 1 media item.
Telegram
telegram
4,0961JPEG, PNG, GIF, MP4Bot + Channel/Group.
发布前请始终检查目标平台的要求,并对应引导用户。
平台ID需要媒体文本长度限制最大媒体数量支持格式关键限制
YouTube
youtube
✅(视频)标题:100 描述:5,0001个视频MP4, MOV, AVI, WMV
--title
必填(缺失将自动生成,最多100字符)。默认可见性为公开。
Instagram
instagram
2,20010(轮播)JPEG, PNG, MP4必须是企业/创作者账号。不支持纯文本。最多5个话题标签,3次@提及。
TikTok
tiktok
2,2001个视频或35张图片MP4, JPG, JPEG, WEBP图片和视频不能混合。不支持PNG。文本中不能有换行符
\n
。AI生成内容必须标注
--ai-generated
X (Twitter)
twitter
2804张图片或1个视频JPEG, PNG, GIF, MP4图片和视频不能混合。需要自备API密钥。超过280字符请使用
longPost
Facebook
facebook
63,20610+JPEG, PNG, MP4必须是主页账号(非个人账号)。
LinkedIn
linkedin
3,0009JPEG, PNG, GIF, MP4个人主页或企业主页均可。
Pinterest
pinterest
5005(轮播)JPEG, PNG必须上传图片。视频需要提供
--thumbnail
Reddit
reddit
标题:300 正文:40,0001JPEG, PNG, GIF, MP4
--title
必填。
--subreddit
必填。
GMB
gmb
1,5001JPEG, PNG, MP4已验证的企业账号。文本中不能包含电话号码。
Bluesky
bluesky
3004JPEG, PNG, MP4300字符包含链接长度。
Threads
threads
50010(轮播)JPEG, PNG, MP4需绑定Instagram账号。
Snapchat
snapchat
1601JPEG, PNG, MP4必须且仅能上传1个媒体文件。
Telegram
telegram
4,0961JPEG, 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:
ParameterPlatformsDescription
--title
YouTube, RedditPost/video title (required). YouTube auto-generates from post text if missing (max 100 chars).
--subreddit
RedditTarget subreddit without
r/
(required)
--visibility
YouTube, TikTok
public
/
unlisted
/
private
(YT),
PUBLIC_TO_EVERYONE
/
SELF_ONLY
etc. (TT)
--thumbnail
PinterestThumbnail URL for video pins (required for video)
--ai-generated
TikTokMark content as AI-generated (recommended for AI content)

向这些平台发布时,脚本会自动校验并生成平台专属配置
参数适用平台说明
--title
YouTube, Reddit帖子/视频标题(必填)。YouTube缺失时将自动从正文中生成(最多100字符)。
--subreddit
Reddit目标社区,无需带
r/
前缀(必填)
--visibility
YouTube, TikTokYouTube可选
public
/
unlisted
/
private
,TikTok可选
PUBLIC_TO_EVERYONE
/
SELF_ONLY
--thumbnail
Pinterest视频 pin 的缩略图URL(视频必填)
--ai-generated
TikTok标注内容为AI生成(AI内容建议填写)

Media Upload

媒体上传

The script uses smart upload — automatically selects the best method based on file size:
MethodFile SizeLimitHow It Works
Direct upload≤ 50MB~50MBOne-step multipart upload
Pre-signed URL> 50MB5GBGets 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上传> 50MB5GB获取S3预签名URL → 直接PUT上传到S3
该过程完全自动,用户只需提供文件路径,脚本会自动选择合适的上传方式。

Standalone Upload

独立上传

bash
undefined
bash
undefined

Small 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
undefined
python3 scripts/x2c_social.py --action upload --file /path/to/large_video.mp4 --folder videos
undefined

One-Step Publish with Local Files

本地文件一键发布

When publishing, local files are auto-uploaded before publishing — no separate upload step needed:
bash
undefined
发布时,本地文件会自动上传后再发布,无需单独执行上传步骤:
bash
undefined

75MB 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

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

输出流程:
```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 status
bash
python3 scripts/x2c_social.py --action status

2. Publish Post

2. 发布帖子

bash
undefined
bash
undefined

Text-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! 🚀"
python3 scripts/x2c_social.py --action publish
--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
python3 scripts/x2c_social.py --action publish
--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"
python3 scripts/x2c_social.py --action publish
--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"
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"

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
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

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
python3 scripts/x2c_social.py --action publish
--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
python3 scripts/x2c_social.py --action publish
--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"
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"

Shorten links

自动缩短链接

python3 scripts/x2c_social.py --action publish
--platforms twitter linkedin
--post "Read our blog: https://example.com/very-long-url"
--shorten-links
undefined
python3 scripts/x2c_social.py --action publish
--platforms twitter linkedin
--post "Read our blog: https://example.com/very-long-url"
--shorten-links
undefined

3. Get Post History

3. 获取发布历史

bash
python3 scripts/x2c_social.py --action posts
python3 scripts/x2c_social.py --action posts --platform tiktok
bash
python3 scripts/x2c_social.py --action posts
python3 scripts/x2c_social.py --action posts --platform tiktok

4. 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 --bulk
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 --bulk

5. 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 tiktok
bash
python3 scripts/x2c_social.py --action comments --post-id post_abc123 --platform tiktok

7. 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_xyz
bash
python3 scripts/x2c_social.py --action delete-comment --comment-id comment_xyz

9. Upload Media (standalone)

9. 上传媒体(独立使用)

bash
python3 scripts/x2c_social.py --action upload --file /path/to/file.mp4 --folder videos

bash
python3 scripts/x2c_social.py --action upload --file /path/to/file.mp4 --folder videos

Parameter Reference

参数参考

ParameterRequiredDescription
--action
Action to perform
--post
for publishPost text content
--platforms
for publishSpace-separated target platforms
--platform
for filteringSingle platform filter
--media-urls
Remote URLs or local paths (auto-uploaded)
--media-files
Local file paths to auto-upload and attach
--schedule
ISO 8601 date for scheduled posting
--shorten-links
Shorten URLs in post text
--title
YouTube, RedditPost/video title
--subreddit
RedditTarget subreddit (without
r/
)
--visibility
YouTube, TikTokPost visibility setting
--thumbnail
PinterestVideo thumbnail URL
--ai-generated
TikTokMark as AI-generated content
--post-id
for post opsAyrshare post ID
--comment-id
for comment opsComment ID
--comment
for comment/replyComment or reply text
--bulk
Delete from all platforms
--file
for uploadLocal file path to upload
--folder
Upload subfolder (default:
uploads
)

参数是否必填说明
--action
要执行的操作
--post
发布时必填帖子文本内容
--platforms
发布时必填空格分隔的目标平台列表
--platform
过滤时使用单个平台过滤条件
--media-urls
远程URL或本地路径(自动上传)
--media-files
要自动上传并挂载的本地文件路径
--schedule
定时发布的ISO 8601格式时间
--shorten-links
自动缩短帖子中的URL
--title
YouTube、Reddit必填帖子/视频标题
--subreddit
Reddit必填目标社区(不带
r/
前缀)
--visibility
YouTube、TikTok使用帖子可见性设置
--thumbnail
Pinterest使用视频缩略图URL
--ai-generated
TikTok使用标注内容为AI生成
--post-id
帖子操作时必填Ayrshare帖子ID
--comment-id
评论操作时必填评论ID
--comment
评论/回复时必填评论或回复文本
--bulk
从所有平台删除
--file
上传时必填要上传的本地文件路径
--folder
上传子目录(默认:
uploads

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: 发布场景下的平台适配引导

  1. Ask which platforms → show only linked platforms from
    status
    check.
  2. Check platform requirements and proactively ask for required fields:
    • YouTube → ask for
      --title
      and
      --visibility
    • Reddit → ask for
      --title
      and
      --subreddit
    • Instagram/TikTok/Pinterest/Snapchat → remind media is required
    • TikTok with AI content → suggest
      --ai-generated
  3. Ask for post content → check text length against platform limits.
  4. Ask about media → accept local files or remote URLs. Local files auto-upload (any size).
  5. Ask about scheduling → publish now or schedule for later.
  1. 询问目标平台 → 仅展示
    status
    检查返回的已绑定平台。
  2. 检查平台要求,主动询问必填字段:
    • YouTube → 询问
      --title
      --visibility
    • Reddit → 询问
      --title
      --subreddit
    • Instagram/TikTok/Pinterest/Snapchat → 提醒需要上传媒体
    • TikTok发布AI内容 → 建议标注
      --ai-generated
  3. 询问帖子内容 → 对照平台限制检查文本长度。
  4. 询问媒体需求 → 支持本地文件或远程URL,本地文件会自动上传(无大小限制)。
  5. 询问发布时间 → 立即发布或定时发布。

Step 4: Execute and Display

步骤4: 执行并展示结果

Run the command. The script will:
  1. Auto-upload local files (smart method selection)
  2. Validate against platform requirements
  3. Build platform-specific options
  4. Publish and return per-platform results
Display results clearly, highlighting any per-platform success/failure.

运行命令,脚本会自动执行以下操作:
  1. 智能选择方式上传本地文件
  2. 对照平台要求校验内容
  3. 生成平台专属配置
  4. 发布并返回各平台的发布结果
清晰展示结果,重点标注各平台的成功/失败状态。

Error Handling

错误处理

CodeMeaningAction
400Missing/invalid parametersCheck platform requirements and fix
401Invalid API keyGuide user to verify/reset key
500Server errorRetry 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参数缺失/无效检查平台要求并修正参数
401API密钥无效引导用户验证/重置密钥
500服务器错误重试或告知用户
脚本调用API前还会执行客户端校验
  • 各平台的文本长度校验
  • 媒体必填检查
  • 必填字段校验(标题、目标社区等)
  • 媒体数量限制校验(Snapchat仅允许1个)
致命校验错误会阻断发布,警告信息会展示但不会阻断发布。