How to download Twitter/X Spaces recordings

Note: this requires typing in commands into your terminal, so make sure you're comfortable with this kind of thing!

  1. Install twspace-dl for Python

    In your terminal, type the following command:
    pip install twspace-dl

    NOTE: you need to have FFMPEG installed as well.
    Read more about this python script here.

  2. Install Cookie-Editor for Chrome

    You'll need to generate a "cookie.txt" file while you're logged into your Twitter/X account.
    Download this free Chrome add-on here (This add on can also be found for Firefox)

  3. Generate the cookie text file

    Log into Twitter/X, and activate the Cookie-Editor plugin. Click "Export" and then choose "Netscape".
    This will copy something to your clipboard. Paste it into a plain text editor (no formatting!) like TextEdit or Notepad.
    Save the file as "cookie.txt" to your desktop or somewhere easy to find.

  4. Get your file paths ready

    First, get the URL for the Space you want to download. You can do this by going to the space and clicking the "Share" button.

    The URL should look something like this:
    https://twitter.com/i/spaces/XXXXXXXX

    Then you need a path to your cookie.txt file:
    /Users/[YourUserName]/Desktop/cookie.txt

    And finally, you'll need a path to where you want your spaces file to save:
    /Users/[YourUserName]/Desktop/[MySpacesRecording]

  5. You're ready to download your space!

    Back in the terminal, type the following command:
    twspace_dl -i https://twitter.com/i/spaces/XXXXXXXX -c /Users/[YourUserName]/Desktop/cookie.txt -o /Users/[YourUserName]/Desktop/MySpacesRecording

This should run until it's done downloading. In this example, you'd end up with a file called "MySpacesRecording.m4a" on your desktop.

Here's an online guide that helped me write all this up.