Simple bash script to download audio from Twitter/X Spaces.
It fetches the stream URL, downloads all audio chunks and merges them into a single file.
Make sure you have the following installed:
- yt-dlp
- wget
- aria2c
- ffmpeg
First, make the script executable:
chmod +x downloader.shRun the script with the Twitter/X Space URL as the first argument:
./downloader.sh <URL>
Example:
./downloader.sh https://twitter.com/i/spaces/XXXXXXXX
The script generates a final audio file with a name based on:
- upload date
- uploader
- title
- id
- Requires access to the Space via your browser cookies, currently using Opera
- Make sure you are logged in if the Space is restricted
- Temporary files are automatically cleaned after execution
- Forked from: https://gist.github.com/rodrigopolo/40029718a85963399784ae35b06adcaf