Skip to main content

Twspace-dl

PyPI PyPI DLs Github Releases DLs

A python module to download twitter spaces.

Screenshots

GUI

general tab input tab running tab success pop up

CLI

help running

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

Windows

From source

pip install git+https://github.com/HoloArchivists/twspace-dl@gooey

CLI

From portable binaries

Windows

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

  1. Download the docker-compose.yml, .env, monitor.sh files and put them in a folder named twspace-dl.
  2. Edit .env and fill in the Twitter username you want to monitor.
  3. Put a cookies file into the folder and named it cookies.txt.
  4. docker-compose up -d

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twspace_dl-2024.7.2.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

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

Hashes for twspace_dl-2024.7.2.1.tar.gz
Algorithm Hash digest
SHA256 18bb3e50610eb1d19ca7f98487ed7656cf97958d60a04aa5ed4380bd5562d698
MD5 e66bb79f693e45af5a45813e3c69c64a
BLAKE2b-256 9ce0b5f8d05405d80cb7ca8ee437e9f15dbefc988301dea7673ad032e4b96193

See more details on using hashes here.

File details

Details for the file twspace_dl-2024.7.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for twspace_dl-2024.7.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22232d4cb61a6dfd2df08ef3bf610ee8a082ea5d34ce68aa5ddb45806d401925
MD5 cbd3622264c95c40901fc7aadd01a9f1
BLAKE2b-256 ceffc51e903c1b7944c608df42cb0fa233223a50d88d320dd4aa6fbc35d9fb52

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2024.7.2.1 This release

2 files

2023.7.24.1

2 files

2023.1.22.1

2 files

2023.1.22.0

2 files

2022.6.6.1

2 files

2022.3.12.2

2 files

2022.3.12.1

2 files

2022.2.25.2

2 files

2022.2.25.1

2 files

2022.2.23.0

2 files

2022.2.19.0

2 files

2022.2.13.0

2 files

2022.1.16.0

2 files

2022.1.15.1

2 files

2022.1.15.0

2 files

2022.1.13.0

2 files

2022.1.12.0

2 files

2021.12.18.3

2 files

2021.12.18.2

2 files

2021.12.18.1

2 files

2021.12.18.0

2 files

2021.12.16.0

2 files

2021.12.15.1

2 files

2021.12.15.0

2 files

2021.12.12.0

2 files

2021.12.10.1

2 files

2021.12.10.0

2 files

2021.11.17.0

2 files

2021.11.13.1

2 files

2021.11.13.0

2 files

2021.11.11.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page