diff --git a/README.rst b/README.rst index 463707e..7993c1a 100644 --- a/README.rst +++ b/README.rst @@ -309,7 +309,7 @@ Then, you may download all pictures of all followees with .. code:: python - for f in loader.get_followers(PROFILE): + for f in loader.get_followees(PROFILE): loader.download_profile(f['username']) You could also download your last 20 liked pics with @@ -325,11 +325,14 @@ To download the last 20 pictures with hashtag #cat, do loader.download_hashtag('cat', max_count=20) -If logged in, Instaloader is also able to download user stories: +Generally, Instaloader provides methods to iterate over the Posts from +a certain source. .. code:: python - loader.download_stories() + for post in loader.get_hashtag_posts('cat'): + # post is an instance of instaloader.Post + self.download_post(post, target='#cat') Each Instagram profile has its own unique ID which stays unmodified even if a user changes his/her username. To get said ID, given the profile's @@ -345,7 +348,7 @@ get the current username of a profile, given this unique ID .. code:: python - loader.get_username_by_id(followees[0]['id']) + loader.get_username_by_id(loader.get_followees()[0]['id']) .. as-module-intro-end diff --git a/docs/conf.py b/docs/conf.py index 4422474..c9656c9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,6 +32,7 @@ sys.path.insert(0, os.path.abspath('..')) # ones. extensions = [ 'sphinx.ext.autodoc', + 'sphinx_autodoc_typehints', 'sphinx.ext.githubpages', ] @@ -129,7 +130,10 @@ html_theme = 'alabaster' # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + 'show_powered_by': False, + 'sidebar_width': '290px', + 'page_width': '935px' } # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] diff --git a/docs/installation.rst b/docs/installation.rst index ded96f7..532d836 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -4,3 +4,8 @@ Installation .. include:: ../README.rst :start-after: installation-start :end-before: installation-end + +If you do not want to use pip, even though it is highly recommended, +and prefer installing Instaloader manually, +`Download the Source `__, +extract the Zip or Tarball and execute ``instaloader.py`` from there. diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..1fc9d86 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +sphinx-autodoc-typehints diff --git a/instaloader.py b/instaloader.py index 33a5c42..d15bf62 100755 --- a/instaloader.py +++ b/instaloader.py @@ -1011,11 +1011,12 @@ class Instaloader: """ Download pictures from the user's feed. - Example to download up to the 20 pics the user last liked: - >>> loader = Instaloader() - >>> loader.load_session_from_file('USER') - >>> loader.download_feed_posts(max_count=20, fast_update=True, - >>> filter_func=lambda post: post.viewer_has_liked) + Example to download up to the 20 pics the user last liked: :: + + loader = Instaloader() + loader.load_session_from_file('USER') + loader.download_feed_posts(max_count=20, fast_update=True, + filter_func=lambda post: post.viewer_has_liked) :param max_count: Maximum count of pictures to download :param fast_update: If true, abort when first already-downloaded picture is encountered @@ -1049,9 +1050,10 @@ class Instaloader: fast_update: bool = False) -> None: """Download pictures of one hashtag. - To download the last 30 pictures with hashtag #cat, do - >>> loader = Instaloader() - >>> loader.download_hashtag('cat', max_count=30) + To download the last 30 pictures with hashtag #cat, do :: + + loader = Instaloader() + loader.download_hashtag('cat', max_count=30) :param hashtag: Hashtag to download, without leading '#' :param max_count: Maximum count of pictures to download