2017-08-25 16:54:36 +02:00
|
|
|
Command Line Options
|
|
|
|
====================
|
|
|
|
|
2017-11-14 11:18:30 +01:00
|
|
|
Instaloader is invoked with::
|
2017-09-08 10:35:38 +02:00
|
|
|
|
2017-11-14 11:18:30 +01:00
|
|
|
$ instaloader [options] target [target ...]
|
|
|
|
|
|
|
|
where ``target`` is a ``profile``, a ``"#hashtag"``, ``@profile`` (all profiles
|
|
|
|
that *profile* is following), or if logged in ``:feed`` (pictures from your
|
2018-03-13 13:53:21 +01:00
|
|
|
feed), ``:stories`` (stories of your followees) or ``:saved`` (collection of
|
|
|
|
posts marked as saved).
|
2017-11-14 11:18:30 +01:00
|
|
|
|
|
|
|
Here we explain the additional options that can be given to Instaloader to
|
|
|
|
customize its behavior. To get a list of all flags, their abbreviations and
|
|
|
|
their descriptions, you may also run ``instaloader --help``.
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
What to Download
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-03-13 13:53:21 +01:00
|
|
|
Specify a list of targets (profiles, #hashtags, ``:feed``, ``:stories`` or
|
|
|
|
``:saved``). For each of these, Instaloader creates a folder and stores all
|
|
|
|
posts along with the pictures's captions and the current **profile picture**
|
|
|
|
there. If an already-downloaded profile has been renamed, Instaloader
|
|
|
|
automatically **finds it by its unique ID** and renames the folder likewise.
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
.. option:: --profile-pic-only
|
|
|
|
|
|
|
|
Only download profile picture.
|
|
|
|
|
2017-12-14 15:46:42 +01:00
|
|
|
.. option:: --no-profile-pic
|
|
|
|
|
|
|
|
Do not download profile picture.
|
|
|
|
|
2017-09-08 10:35:38 +02:00
|
|
|
.. option:: --no-videos
|
|
|
|
|
|
|
|
Do not download videos.
|
|
|
|
|
2017-12-14 16:46:19 +01:00
|
|
|
.. option:: --no-video-thumbnails
|
|
|
|
|
|
|
|
Do not download thumbnails of videos.
|
|
|
|
|
2017-09-08 10:35:38 +02:00
|
|
|
.. option:: --geotags
|
|
|
|
|
|
|
|
**Download geotags** when available. Geotags are stored as a text file with
|
|
|
|
the location's name and a Google Maps link. This requires an additional
|
|
|
|
request to the Instagram server for each picture, which is why it is disabled
|
|
|
|
by default.
|
|
|
|
|
|
|
|
.. option:: --no-geotags
|
|
|
|
|
|
|
|
Do not store geotags, even if they can be obtained without any additional
|
|
|
|
request.
|
|
|
|
|
|
|
|
.. option:: --comments
|
|
|
|
|
|
|
|
Download and update comments for each post. This requires an additional
|
|
|
|
request to the Instagram server for each post, which is why it is disabled by
|
|
|
|
default.
|
|
|
|
|
|
|
|
.. option:: --no-captions
|
|
|
|
|
|
|
|
Do not store media captions, although no additional request is needed to
|
|
|
|
obtain them.
|
|
|
|
|
|
|
|
.. option:: --stories
|
|
|
|
|
|
|
|
Also **download stories** of each profile that is downloaded. Requires
|
|
|
|
:option:`--login`.
|
|
|
|
|
2017-09-29 14:02:58 +02:00
|
|
|
.. option:: --metadata-json
|
|
|
|
|
|
|
|
Create a JSON file containing the metadata of each post. This does not
|
|
|
|
include comments (see :option:`--comments`) nor geotags (see
|
|
|
|
:option:`--geotags`). The JSON files contain the properties of
|
|
|
|
:class:`instaloader.Post`.
|
|
|
|
|
2017-09-08 10:35:38 +02:00
|
|
|
.. option:: --stories-only
|
|
|
|
|
|
|
|
Rather than downloading regular posts of each specified profile, only
|
2017-12-14 15:46:42 +01:00
|
|
|
download stories. Requires :option:`--login`. Does not imply
|
|
|
|
:option:`--no-profile-pic`.
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
.. option:: --only-if filter
|
|
|
|
|
|
|
|
Expression that, if given, must evaluate to True for each post to be
|
|
|
|
downloaded. Must be a syntactically valid Python expression. Variables are
|
|
|
|
evaluated to :class:`instaloader.Post` attributes. Example:
|
|
|
|
``--only-if=viewer_has_liked``. See :ref:`filter-posts` for more
|
|
|
|
examples.
|
|
|
|
|
|
|
|
|
|
|
|
When to Stop Downloading
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
If none of these options are given, Instaloader goes through all pictures
|
|
|
|
matching the specified targets.
|
|
|
|
|
|
|
|
.. option:: --fast-update
|
|
|
|
|
|
|
|
For each target, stop when encountering the first already-downloaded picture.
|
|
|
|
This flag is recommended when you use Instaloader to update your personal
|
|
|
|
Instagram archive.
|
|
|
|
|
|
|
|
.. option:: --count COUNT
|
|
|
|
|
|
|
|
Do not attempt to download more than COUNT posts. Applies only to
|
2017-10-30 18:38:03 +01:00
|
|
|
``#hashtag`` and ``:feed``.
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
Login (Download Private Profiles)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Instaloader can **login to Instagram**. This allows downloading private
|
|
|
|
profiles. To login, pass the :option:`--login` option. Your session cookie (not your
|
|
|
|
password!) will be saved to a local file to be reused next time you want
|
|
|
|
Instaloader to login.
|
|
|
|
|
|
|
|
.. option:: --login YOUR-USERNAME
|
|
|
|
|
|
|
|
Login name (profile name) for your Instagram account.
|
|
|
|
|
|
|
|
.. option:: --sessionfile SESSIONFILE
|
|
|
|
|
|
|
|
Path for loading and storing session key file. Defaults to a path within
|
|
|
|
your temporary directory, encoding your local username and your Instagram
|
|
|
|
profile name.
|
|
|
|
|
|
|
|
.. option:: --password YOUR-PASSWORD
|
|
|
|
|
|
|
|
Password for your Instagram account. Without this option, you'll be prompted
|
|
|
|
for your password interactively if there is not yet a valid session file.
|
|
|
|
|
|
|
|
How to Download
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. option:: --dirname-pattern DIRNAME_PATTERN
|
|
|
|
|
|
|
|
Name of directory where to store posts. ``{profile}`` is replaced by the
|
|
|
|
profile name, ``{target}`` is replaced by the target you specified, i.e.
|
|
|
|
either ``:feed``, ``#hashtag`` or the profile name. Defaults to ``{target}``.
|
|
|
|
See :ref:`filename-specification`.
|
|
|
|
|
|
|
|
.. option:: --filename-pattern FILENAME_PATTERN
|
|
|
|
|
|
|
|
Prefix of filenames. Posts are stored in the directory whose pattern is given
|
|
|
|
with ``--dirname-pattern``. ``{profile}`` is replaced by the profile name,
|
|
|
|
``{target}`` is replaced by the target you specified, i.e. either ``:feed``,
|
2018-01-07 14:52:03 +01:00
|
|
|
``#hashtag`` or the profile name. Also, the fields ``{date}``, ``{date_utc}`` and
|
2017-11-08 15:58:33 +01:00
|
|
|
``{shortcode}`` can be specified. In case of not downloading stories, the
|
|
|
|
attributes of the :class:`.Post` class can be used in addition, e.g.
|
|
|
|
``{post.owner_id}`` or ``{post.mediaid}``.
|
|
|
|
Defaults to
|
|
|
|
``{date:%Y-%m-%d_%H-%M-%S}``. See :ref:`filename-specification`.
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
.. option:: --user-agent USER_AGENT
|
|
|
|
|
|
|
|
User Agent to use for HTTP requests. Per default, Instaloader pretends being
|
|
|
|
Chrome/51.
|
|
|
|
|
2017-09-29 16:09:15 +02:00
|
|
|
.. option:: --max-connection-attempts N
|
|
|
|
|
|
|
|
Maximum number of connection attempts until a request is aborted. Defaults
|
2017-10-30 18:38:03 +01:00
|
|
|
to ``3``. If a connection fails, it can be manually skipped by hitting
|
2017-09-29 16:09:15 +02:00
|
|
|
:kbd:`Control-c`. Set this to ``0`` to retry infinitely.
|
|
|
|
|
2017-09-08 10:35:38 +02:00
|
|
|
Miscellaneous Options
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. option:: --quiet
|
|
|
|
|
|
|
|
Disable user interaction, i.e. do not print messages (except errors) and fail
|
|
|
|
if login credentials are needed but not given. This makes Instaloader
|
|
|
|
**suitable as a cron job**.
|