2018-04-30 09:56:43 +02:00
|
|
|
.. _command-line-options:
|
|
|
|
|
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
|
2018-04-30 09:56:43 +02:00
|
|
|
their descriptions, you may also run ``instaloader --help``. For an
|
|
|
|
introduction on how to use Instaloader, see
|
|
|
|
:ref:`download-pictures-from-instagram`.
|
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
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --profile-pic-only, -P
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
Only download profile picture.
|
|
|
|
|
2017-12-14 15:46:42 +01:00
|
|
|
.. option:: --no-profile-pic
|
|
|
|
|
|
|
|
Do not download profile picture.
|
|
|
|
|
2018-08-20 10:37:51 +02:00
|
|
|
.. option:: --no-pictures
|
|
|
|
|
|
|
|
Do not download post pictures. Cannot be used together with
|
|
|
|
:option:`--fast-update`. Implies :option:`--no-video-thumbnails`, does not
|
|
|
|
imply :option:`--no-videos`.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --no-videos, -V
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
Do not download videos.
|
|
|
|
|
2017-12-14 16:46:19 +01:00
|
|
|
.. option:: --no-video-thumbnails
|
|
|
|
|
|
|
|
Do not download thumbnails of videos.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --geotags, -G
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
**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.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --comments, -C
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-04-13 22:54:40 +02:00
|
|
|
Do not create txt files.
|
|
|
|
|
|
|
|
.. option:: --post-metadata-txt
|
|
|
|
|
2018-04-29 16:24:55 +02:00
|
|
|
Template to write in txt file for each Post. See :ref:`metadata-text-files`.
|
2018-04-13 22:54:40 +02:00
|
|
|
|
|
|
|
.. option:: --storyitem-metadata-txt
|
|
|
|
|
2018-04-29 16:24:55 +02:00
|
|
|
Template to write in txt file for each StoryItem. See
|
|
|
|
:ref:`metadata-text-files`.
|
2017-09-08 10:35:38 +02:00
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --stories, -s
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
Also **download stories** of each profile that is downloaded. Requires
|
|
|
|
:option:`--login`.
|
|
|
|
|
2018-08-20 10:44:20 +02:00
|
|
|
.. option:: --tagged
|
|
|
|
|
|
|
|
Also download posts where each profile is tagged.
|
|
|
|
|
2018-04-12 22:01:26 +02:00
|
|
|
.. option:: --no-metadata-json
|
2017-09-29 14:02:58 +02:00
|
|
|
|
2018-04-12 22:01:26 +02:00
|
|
|
Do not create a JSON file containing the metadata of each post.
|
|
|
|
|
|
|
|
.. option:: --no-compress-json
|
|
|
|
|
|
|
|
Do not xz compress JSON files, rather create pretty formatted JSONs.
|
2017-09-29 14:02:58 +02:00
|
|
|
|
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
|
|
|
|
2018-05-14 11:04:48 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
If possible, use ``:stories`` target rather than :option:`--stories-only`
|
|
|
|
with all your followees. ``:stories`` uses fewer API requests.
|
|
|
|
|
2018-08-20 10:44:20 +02:00
|
|
|
.. option:: --tagged-only
|
|
|
|
|
|
|
|
Download only post where each profile is tagged, not their regular posts.
|
|
|
|
|
2018-04-19 15:12:05 +02:00
|
|
|
.. option:: --post-filter filter, --only-if filter
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
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:
|
2018-04-19 15:12:05 +02:00
|
|
|
``--post-filter=viewer_has_liked``. See :ref:`filter-posts` for more
|
2017-09-08 10:35:38 +02:00
|
|
|
examples.
|
|
|
|
|
2018-04-19 15:12:05 +02:00
|
|
|
.. option:: --storyitem-filter filter
|
|
|
|
|
|
|
|
Expression that, if given, must evaluate to True for each storyitem to be
|
|
|
|
downloaded. Must be a syntactically valid Python expression. Variables are
|
|
|
|
evaluated to :class:`instaloader.StoryItem` attributes.
|
|
|
|
See :ref:`filter-posts` for more examples.
|
|
|
|
|
|
|
|
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
When to Stop Downloading
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
If none of these options are given, Instaloader goes through all pictures
|
|
|
|
matching the specified targets.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --fast-update, -F
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --count COUNT, -c
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --login YOUR-USERNAME, -l YOUR-USERNAME
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
Login name (profile name) for your Instagram account.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --sessionfile SESSIONFILE, -f SESSIONFILE
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --password YOUR-PASSWORD, -p YOUR-PASSWORD
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-04-30 09:56:43 +02:00
|
|
|
.. warning:: Using :option:`--password` option is discouraged for security
|
|
|
|
reasons. Enter your password interactively when asked, or use the
|
|
|
|
sessionfile feature (:option:`--sessionfile` to customize path).
|
|
|
|
|
2017-09-08 10:35:38 +02:00
|
|
|
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
|
|
|
|
|
2018-04-29 11:57:28 +02:00
|
|
|
Prefix of filenames, relative to the directory given with
|
|
|
|
:option:`--dirname-pattern`. ``{profile}`` is replaced by the profile name,
|
2017-09-08 10:35:38 +02:00
|
|
|
``{target}`` is replaced by the target you specified, i.e. either ``:feed``,
|
2018-04-29 11:57:28 +02:00
|
|
|
``#hashtag`` or the profile name. Defaults to ``{date_utc}_UTC``.
|
|
|
|
See :ref:`filename-specification` for a list of supported tokens.
|
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
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-04-29 16:41:24 +02:00
|
|
|
.. option:: --quiet, -q
|
2017-09-08 10:35:38 +02:00
|
|
|
|
|
|
|
Disable user interaction, i.e. do not print messages (except errors) and fail
|
2018-04-30 09:56:43 +02:00
|
|
|
if login credentials are needed but not given.
|
|
|
|
This is handy for running :ref:`instaloader-as-cronjob`.
|
2018-08-20 09:00:51 +02:00
|
|
|
|
|
|
|
.. option:: +args.txt
|
|
|
|
|
|
|
|
Read arguments from file `args.txt`, a shortcut to provide argument from
|
|
|
|
file rather than command-line. This provide a convient way to hide login
|
|
|
|
info from CLI. and also can use for simplify managment of long arguments.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
text file should separate arg with line break.
|
|
|
|
|
|
|
|
args.txt example::
|
|
|
|
|
|
|
|
--login MYUSENAME
|
|
|
|
--password MYPASSWORD
|
|
|
|
--fast-update
|
|
|
|
|