"instaloader -- -SHORTCODE" to fetch single post

Closes #129.
This commit is contained in:
Alexander Graf 2018-08-20 09:31:30 +02:00
parent f7e6632f68
commit 5f57345f1b
2 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,10 @@ Instaloader supports the following targets:
All profiles that are followed by ``profile``, i.e. the *followees* of
``profile`` (requires :option:`--login`).
- ``-post``
The single **post** with the given shortcode. Must be preceeded by ``--`` in
the argument list to not be mistaken as an option flag.
Instaloader goes through all media matching the specified targets and
downloads the pictures and videos and their captions. You can specify

View File

@ -133,6 +133,8 @@ def _main(instaloader: Instaloader, targetlist: List[str],
elif target[0] == '#':
instaloader.download_hashtag(hashtag=target[1:], max_count=max_count, fast_update=fast_update,
post_filter=post_filter)
elif target[0] == '-':
instaloader.download_post(Post.from_shortcode(instaloader.context, target[1:]), target)
elif target == ":feed":
instaloader.download_feed_posts(fast_update=fast_update, max_count=max_count,
post_filter=post_filter)