caption_hashtags property for only-if evaluation
caption_hashtags is a list of all hashtags that are mentioned in the Post's caption. It allows to easily filter Posts that have multiple hashtags, and as such fixes #24. Further, the documentation of --only-if has been completed by linking to a description of the syntax in the Python documentation, and by linking to a list of all defined properties with their meanings. So, this commit also closes #42.
This commit is contained in:
13
README.rst
13
README.rst
@@ -129,8 +129,8 @@ Filter Posts
|
||||
The ``--only-if`` option allows to specify criterias that posts have to
|
||||
meet to be downloaded. If not given, all posts are downloaded. It must
|
||||
be a boolean Python expression where the variables ``likes``,
|
||||
``comments``, ``viewer_has_liked``, ``is_video``, ``date``, and some
|
||||
more (see class ``instaloader.Post`` for a full list) are defined.
|
||||
``comments``, ``viewer_has_liked``, ``is_video``, and many
|
||||
more are defined.
|
||||
|
||||
A few examples:
|
||||
|
||||
@@ -153,8 +153,17 @@ Or you may **skip videos**:
|
||||
|
||||
instaloader --only-if="not is_video" target
|
||||
|
||||
Or you may filter by hashtags that occur in the Post's caption. For
|
||||
example, to download posts of kittens that are cute: ::
|
||||
|
||||
instaloader --only-if="'cute' in caption_hashtags" "#kitten"
|
||||
|
||||
.. basic-usage-end
|
||||
|
||||
(For a more complete description of the ``-only-if`` option, refer to
|
||||
the `Instaloader Documentation <https://instaloader.readthedocs.io/basic-usage.html#filter-posts>`__)
|
||||
|
||||
|
||||
Advanced Options
|
||||
----------------
|
||||
|
||||
|
Reference in New Issue
Block a user