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 an entry field at the top for a space link, so enter it and press the "Execute" button on the right.
Then an entry will be added to the "Download History" and the download process will be queued on the server side, and the dunload process will be executed in order.
If the site is busy, it may take some time before the download process is executed. 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 "Status" of each item will change to "Processing Complete" and the download button on the right can be clicked.
The site uses a browser cookie to store the download history, which will not be reset if you close the page or leave while waiting for processing. However, 24 hours after the download process is complete, the data is deleted from the server and the history is reset.
You can now download the X-space. The file format is "m4a".
From here, we will explain how to download X-space from the command line using a 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.