Script to monitor & download Twitter Spaces.
- Please set
TWITTER_AUTHORIZATION
orTWITTER_AUTH_TOKEN
for better Spaces lookup - Without above config, script will try to fetch user tweets for live Spaces, which could result empty if user not tweet that Space
npm install
npm run build
Monitor user(s) indefinitely, wait for live Space and download when Space ended
node ./dist/index.js --user nakiriayame
node ./dist/index.js --user nakiriayame,sakamatachloe
node ./dist/index.js --config ./config.json
Monitor & download Space by id
node ./dist/index.js --id 1yoJMWvbybNKQ
Download Space by playlist url
node ./dist/index.js --url https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/hls/1Nq1QFkYTQ4v1X4BTV_aJ_pFeQhYyuYXY7ykz5xB7v5NvGwFMJMKwnRBmxyi9twF4BZ90ZKks5wdGKqESVsjLw...
Download Space by playlist url with additional metadata (if Space url still available)
node ./dist/index.js --id 1yoJMWvbybNKQ --url https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/hls/1Nq1QFkYTQ4v1X4BTV_aJ_pFeQhYyuYXY7ykz5xB7v5NvGwFMJMKwnRBmxyi9twF4BZ90ZKks5wdGKqESVsjLw...
-h, --help Display help
-d, --debug Show debug logs
--config <CONFIG_PATH> Load config file (Check config.json)
--user <USER> Monitor & download live Spaces from users indefinitely,
separate by comma (,)
--id <SPACE_ID> Monitor & download live Space with id
--force Force download Space when using with --id
--url <PLAYLIST_URL> Download Space using playlist url
--notification Show notification about new live Space
--force-open Force open Space in browser
Use to manually process audio/captions
- cc
download|d <SPACE_ID> <ENDPOINT> <TOKEN> Download Space captions, with
- ENDPOINT: Chat endpoint
- TOKEN: Chat access token
extract|e <FILE> Extract Space captions
node ./dist/index.js cc d 1yoJMWneoZwKQ https://prod-chatman-ancillary-ap-northeast-1.pscp.tv 2Ozpcu2xxqb5wxMdkyodUCygOrbYMLv8rq...
node ./dist/index.js cc e /download/sample_cc.jsonl
-
To monitor multiple users, it is better to use Twitter API v2
-
Navigate to Projects & Apps to create new app (or use existing app)
-
Clone
config.example.json
and rename toconfig.json
and run app with--config
-
Clone
.env.example
and rename to.env
-
Get app
Bearer Token
inKeys and tokens
tab -
Set
TWITTER_AUTHORIZATION
value toBearer Token
valueTWITTER_AUTHORIZATION = "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs..."
-
How to get
TWITTER_AUTH_TOKEN
-
Sign in Twitter
-
Open new tab (Chrome)
chrome://settings/cookies/detail?site=twitter.com&search=cookies
-
Copy
Content
ofauth_token
-
Currently support Discord Webooks
Check config.example.json
for more detail