Twitter allows you to download your tweet archive, but that archive doesn’t contain your images or videos. Ergo, it is not really an archive.
This script:
(I wrote a similar script for a Medium archive.)
twitter-export-image-fill.py
there (using terminal/command line).Note: You can interrupt the script at any time and run it again – it should start where it left off.
--include-videos PATH_TO_YOUTUBE_DL
Download videos and animated GIFs from tweets. You have to
download/install
youtube-dl and then provide a path to it, e.g.
--include-videos /usr/local/Cellar/youtube-dl/2017.01.05/bin/youtube-dl
The script will try to find youtube-dl in its common path, but it might fail.
Note: This includes animated GIFs, which Twitter transcodes into videos.
--continue-after-failure
Continue the process when one of the downloads fail. This will create an incomplete archive, although it is sometimes necessary as apparently Twitter deletes some images. The list of failed images will be output at the end.
--backfill-from EARLIER_ARCHIVE_PATH
Use an earlier archive to get images from if possible, instead of downloading (useful for incremental backups), e.g. --backfill-from ~/Desktop/tweet-archive
--skip-retweets
Do not download images from retweets (done by default).
--skip-images
Do not download any images (just videos).
--skip-videos
Do not download any videos (just images).
--skip-avatars
Do not download avatars from tweets (by default, user avatars are downloaded alongside tweet images).
--force-redownload
Force the script to not be very smart and download again stuff that’s already been download.
data/js/tweets/YYYY_MM_media
subdirectories.img/avatars
directory.Does this work on Windows or Linux?
I wrote/tested it on Mac OS only, but I’ve heard of people having success running it on Windows. Others reported it worked for them properly on Ubuntu, FreeBSD, and Debian.
Does this download videos in addition to images?
Sort of. There is an experimental youtube-dl integration. Check out the
include-videos
parameter above. Note that the videos won’t be playable
from the archive’s local webpage, but they will be downloaded locally
into your file system.
Some of my images fail to load, even though they open on Twitter
Image URLs can change if you protect (or unprotect?) your account, and the archive can get out of sync. If that matches your usage, simply re-download a fresh archive.
This script is in public domain. Run free.
1.10 (28 Apr 2018)
1.06 (28 Apr 2018)
1.05 (27 Apr 2018)
1.04 (26 Apr 2018)
1.03 (5 Jan 2017)
1.02 (27 Dec 2016)
1.01 (27 Dec 2016)
1.00 (26 Dec 2016)