Hi, I'm @ryusei__46.
This article describes how anyone can download the recording archive of a X (fomar Twitter) space as an audio file to their PC or smartphone.
Until last June 2022, the specification was that the recording archive of a X space would be deleted after one month, but since then the specification has changed and the archive is now stored for an unlimited period of time, allowing semi-permanent listening playback as long as the host continues to make it public.
However, there is no guarantee that the recording archive will be open to the public forever, so there are many people who would like to save and save useful space archives offline.
After all, I am one of them. So, I recently created a web tool to easily download the recording archive of a X space as an audio file.
The main part of this presentation is an introduction of this tool for the general public. In the latter part of the article, I will explain how to download the Tweiterspace archive with a single command using Python for programmers.
Twitter Space Downloader
First, obtain a direct link to the X space you wish to download.
When you access the above site, you will see a space at the bottom of the page for entering a space link.
Then an item will be added to the "Waiting list for download," and the download process will be queued on the server side, and the download process will be executed in order.
If the site is busy, it may take some time for the download process to run. If this site is well received, we will consider increasing resource allocation to improve processing speed, while also considering the server load.
When the download process is completed on the server side, the text on the right button of each item will change from "In process..." to "Download.
This site uses a browser cookie to store the download history, so it will not be reset if you close the page or leave the site while waiting for the process to complete. However, 24 hours after the download process is complete, the data will be deleted from the server and the history will be reset.
You can now download your X space. The file format is "m4a".
From here, we will explain how to download the X space from the command line using the Python library.
Downloading Xspace using the Python library "twspace-dl".
It is very easy to explain, so I will give a brief introduction.
The library used is called "twspace-dl. The web tool I have created this time also uses this library in the backend.
This library is compatible with Windows/Linux/Mac, so you can use it according to your individual environment. I am Windows. The environment is "Python v 3.10".
pip install twspace-dl
Install "twspace-dl" using the above command.
After installation, you will also need an open source media editing tool called "ffmpeg", which you can download from the official site below and install.
After installation, add the path to the installed "ffmpeg.exe" to the environment variable and confirm that the version information is displayed by "ffmpeg -L" from the command line.
twspace_dl -i 'space_url' -o 'output_path'
You can then use the above command to download the Xspace as an audio file in "m4a" format. The "-o" option should be set if you wish to specify an output path. If the "-o" option is omitted, the output will be directed to the current directory where the command is executed.