Post class representing an Instagram Post

This simplifies accessing properties of a Post. Method download_post()
remains to class Instaloader rather than Post, as it fits there better.

Also, since it is now easily possible, all download_*() functions now
have a filter_func parameter. Its meaning has been reverted to be
consistent of how a filter is commonly understood: A post is downloaded
iff filter_func is None or evaluates to True.

Post.get_comments() foreports commit 86fb80d ("Avoid GraphQL queries if
all comments in metadata").
This commit is contained in:
Alexander Graf
2017-08-19 12:58:28 +02:00
parent ccdac0305f
commit 0f64768dd8
2 changed files with 235 additions and 137 deletions

View File

@@ -260,10 +260,7 @@ You could also download your last 20 liked pics with
.. code:: python
loader.download_feed_posts(max_count=20, fast_update=True,
filter_func=lambda node:
not node["likes"]["viewer_has_liked"]
if "likes" in node else
not node["viewer_has_liked"])
filter_func=lambda post: post.viewer_has_liked)
To download the last 20 pictures with hashtag #cat, do