Usage¶
instaLooter provides a command line interface, that you can call with
the instaLooter command.
Note
In some cases, the instaLooter command is not added into
the $PATH after installation. It is possible to perform
all the following actions nevertheless by replacing occurences
of instaLooter with python -m instaLooter (or
python3 -m instaLooter).
Command Line Interface¶
Download pictures/videos from the profile of a single user:
$ instaLooter user <username> [<directory>] [options]
Download pictures/videos tagged with a given #hashtag:
$ instaLooter hashtag <hashtag> <directory> [options]
Download pictures/videos from a single post:
$ instaLooter post <post_token> <directory> [options]
Download pictures/videos in Batch mode:
$ instaLooter batch <batch_file>
Positional Arguments¶
usernamethe username of the Instagram profile to download pictures/videos from.
hashtagthe hashtag to download pictures/videos from.
post_tokenthe URL or the code of the post to download.
directorythe directory in which to download pictures/videos. Optional for profile download, will then use current directory.
batch_filethe path to the batch file containing batch download instructions (see the Batch mode page for the format specification).
Options - Credentials¶
-u USER, --username USERThe username to connect to Instagram with.
-p PASS, --password PASSThe password to connect to Instagram with (will be asked in the shell if the
--usernameoption was given without the corresponding--password).
Options - Files¶
-n NUM, --num-to-dl NUMMaximum number of new files to download
-j JOBS, --jobs JOBSNumber of parallel threads to use to download files [default: 16]
-T TMPL, --template TMPLA filename template to use to write the files (see Template). [default: {id}]
-v, --get-videosGet videos as well as photos
-V, --videos-onlyGet videos only (implies
--get-videos)-N, --newOnly look for files newer than the ones in the destination directory (faster).
-t TIME, --time TIMEThe time limit within which to download pictures and video (see Time)
Options - Metadata¶
-d, --dump-jsonSave metadata to a JSON file next to downloaded videos and pictures.
-m, --add-metadataAdd date and caption metadata to downloaded pictures (requires PIL or Pillow as well as piexif).
-D, --dump-onlySave only the metadata and no video / picture.
-e, --extended-dumpAlways dump the maximum amount of extractable information, at the cost of more time.
Options - Miscellaneous¶
-q, --quietDo not produce any output
-h, --helpDisplay the help message
--versionShow program version and quit
--tracebackPrint error traceback if any (debug).
-W WARNINGCTLChange warning behaviour (same as
python -W) [default: default]
Template¶
The default filename of the pictures and videos on Instagram doesn’t show
anything about the file you just downloaded. But using the -T argument
allows you to give instaLooter a filename template, using the following
format with brackets-enclosed ({}) variable names among:
id*² andcode² of the instagram id of the mediaownerid*,usernameandfullnameof the ownerdatetime*: the date and time of the post (YYYY-MM-DD hh:mm:ss)date*: the date of the post (YYYY-MM-DD)width* andheight*likescount* andcommentscount*
- *
use these only to quicken download, since fetching the others may take a tad longer (in particular in hashtag download mode).
- ²
use at least one of these in your filename to make sure the generated filename is unique.
Examples of acceptable values:
$ instaLooter <profile> -T {username}.{datetime}
$ instaLooter <profile> -T {username}-{likescount}-{width}x{height}.{id}
$ instaLooter <profile> -T {username}.{code}.something_constant
Time¶
The --time parameter can be given either a combination of start and stop
date in ISO format (e.g. 2016-12-21:2016-12-18, 2015-03-07:,
:2016-08-02) or a special value among: thisday, thisweek, thismonth,
thisyear.
Edges are included in the time frame, so if using the following value:
--time 2016-05-10:2016-04-03, then all medias will be downloaded
including the ones posted the 10th of May 2016 and the 3rd of April 2016.
Credentials¶
The --username and --password parameters can be used to log to
Instagram. This allows you to download pictures/videos from private profiles
you are following. You can either provide your password directly
or type it in later for privacy purposes.
$ instaLooter ... --username USERNAME --password PASSWORD
$ instaLooter ... --username USERNAME
Password: # type PASSWORD privately here