A CLI tool to download media from bookmarked tweets.
Project description
Twitter-Archive
A CLI Python application to download all media (and hopefully more) from bookmarked tweets (for now). Eventually I hope to make this a general archive utility for Twitter, allowing users to download/archive all kinds of tweets.
Originally, before the V2 Twitter API, this app used Selenium to try and scrape the contents of the a users bookmarks page. Now, since the release of the V2 API, the application has been rewritten. This new version is much faster and more robust.
Installation and Setup
Installation
Twitter-Archive can be installed with pip
$ pip install twitter-archive
Alternatively, you can clone this repository and install from the repository instead of from PyPi.
$ git clone https://github.com/jarulsamy/Twitter-Archive
$ cd Twitter-Archive
$ pip install .
To properly authenticate with the Twitter API, you will have to create a developer application. This will provide you with a client ID and client secret.
TODO: Document how to create Twitter Developer App.
Usage
You can invoke the app with:
$ twitter-archive
By default, the app will print a URL to prompt the user to authorize the application with Twitters official APIs. Once you navigate to that link and login with Twitter, the app will fetch a manifest of all the bookmarked tweets and begin saving any photos/videos to disk.
You can view the built-in CLI help menu for more info:
$ twitter-archive --help
Usage: twitter-archive [-o FILE] [--headless] [--no-clobber] [--quiet] [--num-download-threads N] [-v] [-h] [--version]
[-m FILE | -i FILE]
A CLI Tool to archive tweets
Options:
-o FILE, --media-output FILE
Path to output downloaded media. (default: media)
--headless Don't use interactive authentication. (default: False)
--no-clobber Don't redownload/overwrite existing media. (default: False)
--quiet Disable download progress bars (default: False)
--num-download-threads N
Number of threads to use while downloading media. (default: 8)
-v, --verbose
-h, --help Show this help message ane exit.
--version show program's version number and exit
-m FILE, --manifest-output FILE
Path to output bookmark manifest. (default: bookmark-manifest.json)
-i FILE, --manifest-input FILE
Use an existing manifest and download all media. (default: None)## Acknowledgements
The Twitter developer team did an excellent job on the new APIs. The new APIs are substantially more intuitive and allow us to interact with many more features of Twitter. While it did take two years, the openness, transparency, and attention to feedback is much appreciated!
The relevant forum post is available here.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for twitter_archive-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88a763468f84c1099bf67eb6658c1df93c0f7a708fad1f70453b095b999c06bd |
|
MD5 | 4b684a6db797ee0b2f8906bca5ec846e |
|
BLAKE2b-256 | ef85a77b3faf9964f5d9e2e91544e4b98ad86519e44f4fb94ccade68ed1e58e6 |