Skip to content

dev-eof/twdownload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

twdownloader

A small script that downloads a video from an X/Twitter post and recreates the original tweet layout around it. The script screenshots the tweet UI, downloads the video with yt-dlp, and stitches everything together with ffmpeg.

The result is a video that looks like the original tweet player.

Requirements

You’ll need:

  • Python 3.9+
  • yt-dlp
  • ffmpeg
  • chromium
  • Python package: playwright

The script expects a system Chromium installation.

Setup

Clone the repo:

git clone https://github.com/yourname/twdownloader.git
cd twdownloader

Install Python dependencies:

pip install playwright

Install system dependencies.

Debian / Ubuntu

sudo apt install chromium ffmpeg yt-dlp

Arch

sudo pacman -S chromium ffmpeg yt-dlp

Fedora

sudo dnf install chromium ffmpeg yt-dlp

Make the script executable (optional):

chmod +x twdownloader.py

Usage

./twdownloader.py "https://x.com/<user>/status/<tweet_id>"

Example:

./twdownloader.py "https://x.com/user/status/1234567890123456789"

The final video will be written to the output/ directory.

Notes

  • Only tweets containing video media will produce a final rendered video.
  • Image or text-only tweets will just output the captured layout screenshot.
  • Temporary files are cleaned up automatically after rendering.

About

Download a video from X and recreate the original tweet layout around it.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages