The only tool to record Twitter spaces (yet)
Project description
Screenshots
GUI
CLI
Requirements
ffmpeg
if not using portable binaries.- A logged in user's cookies file exported from Twitter in the Netscape format.
Install
GUI
Use this if you're not sure.
From portable binaries
From source
pip install git+https://github.com/HoloArchivists/twspace-dl@gooey
CLI
From portable binaries
From PyPI
pip install twspace-dl
From source
pip install git+https://github.com/HoloArchivists/twspace-dl
Usage
twspace_dl -i space_url -c COOKIE_FILE
With binaries
Windows
.\twspace_dl.exe -i space_url -c COOKIE_FILE
Features
Here's the output of the help option
usage: twspace_dl [-h] [-v] [-s] [-k] [-l] -c COOKIE_FILE
[-i SPACE_URL | -U USER_URL] [-d DYN_URL] [-f URL] [-M PATH]
[-o FORMAT_STR] [-m] [-p] [-u] [--write-url URL_OUTPUT] [-e]
Script designed to help download twitter spaces
options:
-h, --help show this help message and exit
-v, --verbose
-s, --skip-download
-k, --keep-files
-l, --log create logfile
-c COOKIE_FILE, --input-cookie-file COOKIE_FILE
cookies file in the Netscape format. The specs of the
Netscape cookies format can be found here:
https://curl.se/docs/http-cookies.html. The cookies
file is now required due to the Twitter API change
that prohibited guest user access to Twitter API
endpoints on 2023-07-01.
input:
-i SPACE_URL, --input-url SPACE_URL
-U USER_URL, --user-url USER_URL
-d DYN_URL, --from-dynamic-url DYN_URL
use the dynamic url for the processes(useful for ended
spaces) example: https://prod-fastly-ap-northeast-
1.video.pscp.tv/Transcoding/v1/hls/zUUpEgiM0M18jCGxo2e
SZs99p49hfyFQr1l4cdze-Sp4T-
DQOMMoZpkbdyetgfwscfvvUkAdeF-
I5hPI4bGoYg/non_transcode/ap-northeast-1/periscope-
replay-direct-prod-ap-northeast-1-public/audio-
space/dynamic_playlist.m3u8?type=live
-f URL, --from-master-url URL
use the master url for the processes(useful for ended
spaces) example: https://prod-fastly-ap-northeast-
1.video.pscp.tv/Transcoding/v1/hls/YRSsw6_P5xUZHMualK5
-ihvePR6o4QmoZVOBGicKvmkL_KB9IQYtxVqm3P_vpZ2HnFkoRfar4
_uJOjqC8OCo5A/non_transcode/ap-northeast-1/periscope-
replay-direct-prod-ap-northeast-1-public/audio-
space/master_playlist.m3u8
-M PATH, --input-metadata PATH
use a metadata json file instead of input url (useful
for very old ended spaces)
output:
-o FORMAT_STR, --output FORMAT_STR
-m, --write-metadata write the full metadata json to a file
-p, --write-playlist write the m3u8 used to download the stream(e.g. if you
want to use another downloader)
-u, --url display the master url
--write-url URL_OUTPUT
write master url to file
-e, --embed-cover embed user avatar as cover art
Format
You can use the following identifiers for the formatting
%(title)s
%(id)s
%(start_date)s
%(creator_name)s
%(creator_screen_name)s
%(url)s
%(creator_id)s
Example: [%(creator_screen_name)s]-%(title)s|%(start_date)s
Known Errors
Changing ID3 metadata in HLS audio elementary stream is not implemented....
This is an error in ffmpeg that does not affect twspace_dl at all as far as I know.
Service
To run as a systemd service please refer to https://github.com/HoloArchivists/twspace-dl/blob/main/SERVICE.md
Docker
Run once
docker run --rm -v .:/output holoarchivists/twspace-dl -i space_url
Run as monitoring service
- Download the
docker-compose.yml
,.env
,monitor.sh
files and put them in a folder namedtwspace-dl
. - Edit
.env
and fill in the Twitter username you want to monitor. - Put a cookies file into the folder and named it
cookies.txt
. docker-compose up -d
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
twspace_dl-2024.7.2.1.tar.gz
(22.9 kB
view details)
Built Distribution
File details
Details for the file twspace_dl-2024.7.2.1.tar.gz
.
File metadata
- Download URL: twspace_dl-2024.7.2.1.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18bb3e50610eb1d19ca7f98487ed7656cf97958d60a04aa5ed4380bd5562d698 |
|
MD5 | e66bb79f693e45af5a45813e3c69c64a |
|
BLAKE2b-256 | 9ce0b5f8d05405d80cb7ca8ee437e9f15dbefc988301dea7673ad032e4b96193 |
File details
Details for the file twspace_dl-2024.7.2.1-py3-none-any.whl
.
File metadata
- Download URL: twspace_dl-2024.7.2.1-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22232d4cb61a6dfd2df08ef3bf610ee8a082ea5d34ce68aa5ddb45806d401925 |
|
MD5 | cbd3622264c95c40901fc7aadd01a9f1 |
|
BLAKE2b-256 | ceffc51e903c1b7944c608df42cb0fa233223a50d88d320dd4aa6fbc35d9fb52 |