How to Download Recordings from X (Formerly Twitter) Spaces | For General Users and Programmers
In this article, I'll explain how anyone can download X Spaces recording archives as audio files to their PC or smartphone.
Until June 2022, X Spaces recording archives were automatically deleted after one month. However, since then, the system was updated to permanently preserve these recordings, allowing listeners to continue playing them indefinitely as long as the host keeps the recording public.
That said, there's no guarantee that recording archives will remain available forever. Many users—including myself—want to save particularly valuable space recordings for offline access.
As someone who shares this concern, I've recently developed a web tool that makes it easy to download X Spaces recording archives as audio files.
This guide will primarily be aimed at general users. For the programming community, I'll also explain how to use Python to download X Spaces archives with a single command.
Download with Twitter Space Downloader
First, obtain a direct link to the X Space you wish to download.
Alternatively, copy the post URL with spaces from the browser's address bar.
URLs must follow the formats: https://x.com/i/spaces/○○○○○○○○○ or https://x.com/username/status/○○○○○○○○○ .
Currently, only publicly published recording archives can be downloaded. We cannot download spaces without recording settings or those that are still in progress.
For spaces without recording settings, we technically cannot download the data since it wouldn't be stored in the first place.
Regarding future development plans, we aim to enable saving and transcription of ongoing spaces, though the exact release date remains undetermined at this time.
X Space Downloader - Xスペースの録音を手軽に保存 twspace-dl.tools.ryusei.ioWhen accessing the above site, you'll find a space link input field at the top. Enter your link and click the "Execute" button to the right.
This will add an entry to your "Download History" and place the download request in the server's processing queue, where it will be processed sequentially.
If the site is experiencing high traffic, downloads may take longer to complete. For popular sites, we're considering increasing server resources to improve processing speed.
Once downloads are completed on the server, each entry's "Status" will update to "Process Completed," making the download button clickable.
Since this site uses browser cookies to store download history, your progress won't be reset even if you close or leave the page while waiting for processing. However, after 24 hours have passed since completion, the server will automatically delete the data, resetting the history.
With this, you can now download X Space content. The file format will be "m4a."
bonusWe have released a sister tool called "X Video Downloader" that allows you to download videos from X posts with embedded videos. It also supports downloading live broadcast archives.
X Video Downloader - Easily Save X Videos in High QualityThis tool allows you to easily download videos and live archives from X and save them to your PC (Windows/Mac) or smartphone (iOS/Android). You can easily download video data by simply entering the URL of the post containing the video.
twvideo-dl.tools.ryusei.ioBelow, we'll explain how to download X Space content using the Python library via the command line.
Download X Spaces using the Python library "twspace-dl"
Since explaining it would be quite simple, I'll just give a quick overview.
The library we're using is called "twspace-dl." For this web tool I developed, I completely rewrote the code in TypeScript while building upon this library, making various improvements along the way.
This is because the "twspace-dl" library we're introducing here has already been discontinued. No further updates will be made, so if X's specifications change and the library becomes incompatible, it will no longer be usable.
This library supports Windows, Linux, and macOS, so you can use it according to your specific environment. I'm on Windows myself, with Python version 3.10 installed.
commandline pip install twspace-dlUsing the above command, install "twspace-dl."
After installation is complete, you'll also need "ffmpeg," an open-source media editing tool. Download and install it from the official website below.
Download FFmpegAfter installation, add the path to the installed "ffmpeg.exe" to your system environment variables, then verify that running "ffmpeg -L" from the command line displays the version information.
commandline twspace_dl -i 'space_url' -o 'output_path'You can then download the X space audio file in "m4a" format using the above command. The "-o" option should be specified if you want to set an output path. If omitted, the output will be saved in the current directory where the command is being executed.
If unable to download due to authentication errorDuring summer 2023, Twitter (now X) implemented several major feature changes, and it appears that tweets and timelines can no longer be retrieved without proper authentication. Even tweet and timeline embeds now require the user to be logged into X beforehand. The same applies to Space archives.
Therefore, when downloading Space content, you'll need X authentication credentials. Specifically, you'll need two cookie values returned by the server when logging into X through your web browser.
The required keys are auth_token and ct0 values. You provide this information when running the twspace_dl command by specifying the --input-cookie-file option and passing the path to the Netscape-style cookie file.
This cookie file can be easily created by installing the "Cookie-Editor" extension in your browser (Chrome).
Cookie-Editor - Chrome Web StoreSimple yet powerful Cookie Editor that allow you to quickly create, edit and delete cookies without leaving your tab.
chromewebstore.google.comAfter installing "Cookie-Editor," an icon will appear in the top-right corner of your browser. Click this icon while logged in to X to view all currently registered cookies in a list.
In the window that appears, click the "Export" button at the bottom right to select the format. Choose "Netscape" to download a text file containing your cookie information in Netscape format.
Then execute the command. Enter the absolute or relative path to the downloaded cookie file in the Cookie File Path field.
commandline twspace_dl -i 'space_url' -o 'output_path' --input-cookie-file 'cookie file path'The file containing the cookie information created above includes X's authentication credentials, so handle it with care. If leaked, it could lead to your X account being compromised (session hijacking).
Bonus: How to transcribe Space Archive content
While requiring PC specifications, this article explains how to perform high-quality subtitle generation for free using Python.
[Completely Free] How to Perform Unlimited High-Accuracy Transcription Using Python | Ryusei.IOThis article provides a comprehensive guide to converting audio files—including videos and meeting minutes—into text completely free of charge using Python. No advanced programming knowledge is required; the process is straightforward.
AMD Ryzen内蔵GPUとWhisper.cppで爆速文字起こしに挑戦 | Ryusei.IOAMD Ryzen 8000シリーズのRadeon 780M(内蔵GPU)とROCm 6.4.1、whisper.cppを使った高速文字起こし環境の構築方法を解説。Minisforum UM870での実例付き。量子化モデル活用でNVIDIA GPU不要。Ubuntu Server 24.04対応。
Reference Page
The only tool to record Twitter spaces (yet)
GitHub - HoloArchivists/twspace-dl: A python module to download twitter spaces.A python module to download twitter spaces. Contribute to HoloArchivists/twspace-dl development by creating an account on GitHub.
Associated Posts
- Quick Guide to Installing Various Tools for Web App Development Environments
- Achieving Lightning-Fast Transcription with AMD Ryzen Integrated GPU and Whisper.cpp
- Personal notes on the technical stack for developing cross-platform services in TypeScript independently
- How to Deploy Next.js on an On-Premises Environment | Using Conoha VPS
- How to Find and Research Independently-Developed Web Services and Apps
- [Completely Free] How to Perform Unlimited High-Accuracy Transcription Using Python
- 【Ubuntu】Personal Collection of Commonly Used Linux Commands for Server Management
- Guide on deploying multiple Next.js applications with different port numbers on the same server
Latest Tips
画像をWEBP形式へ変換するためのCLIツールの覚書 【Windows】システム修復・検証コマンドの覚書 Pythonのパッケージ管理コマンド「pip」の覚書 certbotコマンドで「Let's Encrypt」のSSL証明書を取得する時の覚書Promotions
Profile
Despite being visually impaired with one nearly completely blind, he works as a full-stack engineer.
I primarily use TypeScript and Rust for developing web applications and desktop applications.
I also have an interest in AI and machine learning, and am working on projects that utilize these technologies.
Our website publishes technical articles and tutorials, offering content suitable for users ranging from beginners to advanced users.
If you have any questions or requests for work, please don't hesitate to contact us.