スキル一覧に戻る
bossjones

twitter-to-reel

by bossjones

Repo/Lab for my personal Claude Code configs and skills

0🍴 0📅 2026年1月5日
GitHubで見るManusで実行

SKILL.md


name: twitter-to-reel description: Convert Twitter/X posts into Instagram Reels format. Screenshots tweets, crops to show username/caption/media, creates a 9:16 vertical canvas with matching background color, and overlays downloaded video content. Works alongside twitter-media-downloader skill. Use when user wants to repurpose Twitter content for Instagram, TikTok, or other vertical video platforms.

Twitter to Reel Converter

Convert Twitter/X posts into Instagram Reels format (9:16 vertical video).

Dependencies

Install required packages before use:

pip install playwright pillow numpy
playwright install chromium

FFmpeg must also be available:

# Ubuntu/Debian
apt-get install ffmpeg

# macOS
brew install ffmpeg

Quick Start

Create a reel from a tweet URL (video auto-downloaded):

uv run python scripts/create_reel.py "https://x.com/user/status/123" -o output.mp4

Or provide a video file explicitly:

uv run python scripts/create_reel.py "https://x.com/user/status/123" video.mp4 -o output.mp4

Workflow

  1. Download (auto): If no video provided, downloads from tweet using twitter-media-downloader
  2. Screenshot: Captures the tweet using a headless browser
  3. Detect Theme: Identifies light/dark mode for background matching
  4. Canvas: Creates 1080x1920 vertical canvas with matching background
  5. Compose: Places tweet at top, overlays video in media area
  6. Export: Outputs Instagram Reels-ready MP4

Scripts

create_reel.py (Main Script)

Full pipeline from tweet URL to finished reel:

uv run python scripts/create_reel.py "TWEET_URL" [VIDEO_FILE] [options]

Options:

OptionDescription
-o, --outputOutput file path (default: reel_output.mp4)
--themeForce theme: light, dark, or auto (default: auto)
--positionTweet position: top, center, bottom (default: top)
--paddingPadding around tweet in pixels (default: 40)
--no-cleanupKeep intermediate files
--cookiesPath to cookies.txt for auth
--browserBrowser to extract cookies from (recommended: firefox)
--no-auto-downloadDisable automatic video download (require explicit video path)

Note: Using --browser firefox is recommended as it automatically extracts cookies from your browser session. This applies to both tweet screenshots and video downloads.

screenshot_tweet.py (Standalone)

Screenshot a tweet without video overlay:

uv run python scripts/screenshot_tweet.py "TWEET_URL" -o screenshot.png

Options:

OptionDescription
-o, --outputOutput file path
--themeForce light or dark theme
--widthBrowser viewport width (default: 550)
--fullCapture full tweet thread
--cookiesCookies file for protected tweets

compose_video.py (Standalone)

Compose video onto an existing screenshot:

uv run python scripts/compose_video.py screenshot.png video.mp4 -o reel.mp4

Examples

Simply provide the tweet URL - video is downloaded automatically:

uv run python scripts/create_reel.py "https://x.com/NASA/status/123456" -o nasa_reel.mp4

With authentication for protected tweets:

uv run python scripts/create_reel.py "https://x.com/user/status/123" --browser firefox -o reel.mp4

Manual Download (Advanced)

If you want more control, download separately first:

# First download the video
uv run python ../twitter-media-downloader/scripts/download.py "https://x.com/user/status/123" -o ./downloads

# Then create the reel
uv run python scripts/create_reel.py "https://x.com/user/status/123" ./downloads/*.mp4 -o reel.mp4

Or provide a video file directly:

uv run python scripts/create_reel.py "https://x.com/NASA/status/123456" my_video.mp4 -o reel.mp4

Customization

Dark theme with bottom positioning:

uv run python scripts/create_reel.py "https://x.com/user/status/123" \
  --theme dark --position bottom -o my_reel.mp4

Screenshot Only (No Video)

uv run python scripts/screenshot_tweet.py "https://x.com/user/status/123" -o tweet.png

Output Specifications

  • Resolution: 1080x1920 (Instagram Reels standard)
  • Aspect Ratio: 9:16 vertical
  • Format: MP4 (H.264 video, AAC audio)
  • Background: Matches tweet theme (white/black)

Troubleshooting

  • Tweet not loading: Use --browser firefox (recommended) or --cookies for protected accounts
  • Wrong colors: Force theme with --theme light or --theme dark
  • Video too long: Trim video before processing or use --duration
  • Playwright errors: Run playwright install chromium

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です