mirror of
https://github.com/instaloader/instaloader.git
synced 2024-07-14 23:00:06 +02:00
docs: Split as-module into smaller documents
This commit is contained in:
parent
5d7c36399f
commit
82e7b19d6d
@ -12,9 +12,6 @@ Python Module :mod:`instaloader`
|
|||||||
|
|
||||||
.. highlight:: python
|
.. highlight:: python
|
||||||
|
|
||||||
.. contents::
|
|
||||||
:backlinks: none
|
|
||||||
|
|
||||||
Instaloader exposes its internally used methods and structures as a Python
|
Instaloader exposes its internally used methods and structures as a Python
|
||||||
module, making it a **powerful and intuitive Python API for Instagram**,
|
module, making it a **powerful and intuitive Python API for Instagram**,
|
||||||
allowing to further customize obtaining media and metadata.
|
allowing to further customize obtaining media and metadata.
|
||||||
@ -94,164 +91,17 @@ metadata of a Profile. :class:`Profile` instances can be created with:
|
|||||||
- :attr:`PostComment.owner` attribute for comment in :meth:`Post.get_comments`
|
- :attr:`PostComment.owner` attribute for comment in :meth:`Post.get_comments`
|
||||||
Profile of a Post comment.
|
Profile of a Post comment.
|
||||||
|
|
||||||
A reference of the many methods provided by the :mod:`instaloader` module is
|
|
||||||
provided in the remainder of this document.
|
|
||||||
|
|
||||||
For a list of real code examples using the Instaloader module for advanced
|
For a list of real code examples using the Instaloader module for advanced
|
||||||
tasks, see :ref:`codesnippets`.
|
tasks, see :ref:`codesnippets`.
|
||||||
|
|
||||||
``Instaloader`` (Main Class)
|
The reference of the many classes provided by the :mod:`instaloader` module is
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
divided into the following subsections.
|
||||||
|
|
||||||
.. autoclass:: Instaloader
|
.. toctree::
|
||||||
:no-show-inheritance:
|
:maxdepth: 2
|
||||||
|
|
||||||
Instagram Structures
|
module/instaloader
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
module/structures
|
||||||
|
module/nodeiterator
|
||||||
Posts
|
module/instaloadercontext
|
||||||
"""""
|
module/exceptions
|
||||||
|
|
||||||
.. autoclass:: Post
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
Additionally, the following trivial structures are defined:
|
|
||||||
|
|
||||||
.. autoclass:: PostSidecarNode
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autoclass:: PostComment
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autoclass:: PostCommentAnswer
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autoclass:: PostLocation
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
User Stories
|
|
||||||
""""""""""""
|
|
||||||
|
|
||||||
.. autoclass:: Story
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autoclass:: StoryItem
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
Highlights
|
|
||||||
""""""""""
|
|
||||||
|
|
||||||
.. autoclass:: Highlight
|
|
||||||
:no-show-inheritance:
|
|
||||||
:inherited-members:
|
|
||||||
|
|
||||||
Bases: :class:`Story`
|
|
||||||
|
|
||||||
.. versionadded:: 4.1
|
|
||||||
|
|
||||||
Profiles
|
|
||||||
""""""""
|
|
||||||
|
|
||||||
.. autoclass:: Profile
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
Hashtags
|
|
||||||
""""""""
|
|
||||||
|
|
||||||
.. autoclass:: Hashtag
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. versionadded:: 4.4
|
|
||||||
|
|
||||||
TopSearchResults
|
|
||||||
""""""""""""""""
|
|
||||||
|
|
||||||
.. autoclass:: TopSearchResults
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. versionadded:: 4.3
|
|
||||||
|
|
||||||
Loading and Saving
|
|
||||||
""""""""""""""""""
|
|
||||||
|
|
||||||
:class:`Post`, :class:`StoryItem`, :class:`Profile` and :class:`Hashtag` can be saved and loaded
|
|
||||||
to/from JSON files.
|
|
||||||
|
|
||||||
.. autofunction:: load_structure_from_file
|
|
||||||
|
|
||||||
.. autofunction:: save_structure_to_file
|
|
||||||
|
|
||||||
Exceptions
|
|
||||||
^^^^^^^^^^
|
|
||||||
|
|
||||||
.. currentmodule:: instaloader.exceptions
|
|
||||||
|
|
||||||
.. autoexception:: InstaloaderException
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autoexception:: ConnectionException
|
|
||||||
|
|
||||||
.. currentmodule:: instaloader
|
|
||||||
|
|
||||||
.. autoexception:: QueryReturnedBadRequestException
|
|
||||||
|
|
||||||
.. autoexception:: QueryReturnedForbiddenException
|
|
||||||
|
|
||||||
.. autoexception:: ProfileNotExistsException
|
|
||||||
|
|
||||||
.. autoexception:: ProfileHasNoPicsException
|
|
||||||
|
|
||||||
.. autoexception:: PrivateProfileNotFollowedException
|
|
||||||
|
|
||||||
.. autoexception:: LoginRequiredException
|
|
||||||
|
|
||||||
.. autoexception:: TwoFactorAuthRequiredException
|
|
||||||
|
|
||||||
.. versionadded:: 4.2
|
|
||||||
|
|
||||||
.. autoexception:: InvalidArgumentException
|
|
||||||
|
|
||||||
.. autoexception:: BadResponseException
|
|
||||||
|
|
||||||
.. autoexception:: BadCredentialsException
|
|
||||||
|
|
||||||
.. autoexception:: PostChangedException
|
|
||||||
|
|
||||||
.. autoexception:: QueryReturnedNotFoundException
|
|
||||||
|
|
||||||
.. versionchanged:: 4.3
|
|
||||||
QueryReturnedNotFoundException now inherits ConnectionException
|
|
||||||
to retry on 404 errors.
|
|
||||||
|
|
||||||
|
|
||||||
.. autoexception:: TooManyRequestsException
|
|
||||||
|
|
||||||
Resumable Iterations
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. versionadded:: 4.5
|
|
||||||
|
|
||||||
.. autoclass:: NodeIterator
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autoclass:: FrozenNodeIterator
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. autofunction:: resumable_iteration
|
|
||||||
|
|
||||||
``InstaloaderContext`` (Low-level functions)
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
``InstaloaderContext``
|
|
||||||
""""""""""""""""""""""
|
|
||||||
|
|
||||||
.. autoclass:: InstaloaderContext
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
``RateController``
|
|
||||||
""""""""""""""""""
|
|
||||||
|
|
||||||
.. autoclass:: RateController
|
|
||||||
:no-show-inheritance:
|
|
||||||
|
|
||||||
.. versionadded:: 4.5
|
|
||||||
|
49
docs/module/exceptions.rst
Normal file
49
docs/module/exceptions.rst
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
Exceptions
|
||||||
|
^^^^^^^^^^
|
||||||
|
|
||||||
|
.. module:: instaloader
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
.. highlight:: python
|
||||||
|
|
||||||
|
.. currentmodule:: instaloader.exceptions
|
||||||
|
|
||||||
|
.. autoexception:: InstaloaderException
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. autoexception:: ConnectionException
|
||||||
|
|
||||||
|
.. currentmodule:: instaloader
|
||||||
|
|
||||||
|
.. autoexception:: QueryReturnedBadRequestException
|
||||||
|
|
||||||
|
.. autoexception:: QueryReturnedForbiddenException
|
||||||
|
|
||||||
|
.. autoexception:: ProfileNotExistsException
|
||||||
|
|
||||||
|
.. autoexception:: ProfileHasNoPicsException
|
||||||
|
|
||||||
|
.. autoexception:: PrivateProfileNotFollowedException
|
||||||
|
|
||||||
|
.. autoexception:: LoginRequiredException
|
||||||
|
|
||||||
|
.. autoexception:: TwoFactorAuthRequiredException
|
||||||
|
|
||||||
|
.. versionadded:: 4.2
|
||||||
|
|
||||||
|
.. autoexception:: InvalidArgumentException
|
||||||
|
|
||||||
|
.. autoexception:: BadResponseException
|
||||||
|
|
||||||
|
.. autoexception:: BadCredentialsException
|
||||||
|
|
||||||
|
.. autoexception:: PostChangedException
|
||||||
|
|
||||||
|
.. autoexception:: QueryReturnedNotFoundException
|
||||||
|
|
||||||
|
.. versionchanged:: 4.3
|
||||||
|
QueryReturnedNotFoundException now inherits ConnectionException
|
||||||
|
to retry on 404 errors.
|
||||||
|
|
||||||
|
|
||||||
|
.. autoexception:: TooManyRequestsException
|
10
docs/module/instaloader.rst
Normal file
10
docs/module/instaloader.rst
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
``Instaloader`` (Main Class)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. module:: instaloader
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
.. highlight:: python
|
||||||
|
|
||||||
|
.. autoclass:: Instaloader
|
||||||
|
:no-show-inheritance:
|
24
docs/module/instaloadercontext.rst
Normal file
24
docs/module/instaloadercontext.rst
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
``InstaloaderContext`` (Low-level functions)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. module:: instaloader
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
.. highlight:: python
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:backlinks: none
|
||||||
|
|
||||||
|
``InstaloaderContext``
|
||||||
|
""""""""""""""""""""""
|
||||||
|
|
||||||
|
.. autoclass:: InstaloaderContext
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
``RateController``
|
||||||
|
""""""""""""""""""
|
||||||
|
|
||||||
|
.. autoclass:: RateController
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. versionadded:: 4.5
|
31
docs/module/nodeiterator.rst
Normal file
31
docs/module/nodeiterator.rst
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
Resumable Iterations
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. module:: instaloader
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
.. highlight:: python
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:backlinks: none
|
||||||
|
|
||||||
|
For many download targets, Instaloader is able to resume a
|
||||||
|
previously-interrupted iteration. It provides an interruptable
|
||||||
|
Iterator :class:`NodeIterator` and a context manager
|
||||||
|
:func:`resumable_iteration`, which we both present here.
|
||||||
|
|
||||||
|
.. versionadded:: 4.5
|
||||||
|
|
||||||
|
``NodeIterator``
|
||||||
|
""""""""""""""""
|
||||||
|
|
||||||
|
.. autoclass:: NodeIterator
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. autoclass:: FrozenNodeIterator
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
``resumable_iteration``
|
||||||
|
"""""""""""""""""""""""
|
||||||
|
|
||||||
|
.. autofunction:: resumable_iteration
|
82
docs/module/structures.rst
Normal file
82
docs/module/structures.rst
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
Instagram Structures
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. module:: instaloader
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
.. highlight:: python
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:backlinks: none
|
||||||
|
|
||||||
|
Posts
|
||||||
|
"""""
|
||||||
|
|
||||||
|
.. autoclass:: Post
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
Additionally, the following trivial structures are defined:
|
||||||
|
|
||||||
|
.. autoclass:: PostSidecarNode
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. autoclass:: PostComment
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. autoclass:: PostCommentAnswer
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. autoclass:: PostLocation
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
User Stories
|
||||||
|
""""""""""""
|
||||||
|
|
||||||
|
.. autoclass:: Story
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. autoclass:: StoryItem
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
Highlights
|
||||||
|
""""""""""
|
||||||
|
|
||||||
|
.. autoclass:: Highlight
|
||||||
|
:no-show-inheritance:
|
||||||
|
:inherited-members:
|
||||||
|
|
||||||
|
Bases: :class:`Story`
|
||||||
|
|
||||||
|
.. versionadded:: 4.1
|
||||||
|
|
||||||
|
Profiles
|
||||||
|
""""""""
|
||||||
|
|
||||||
|
.. autoclass:: Profile
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
Hashtags
|
||||||
|
""""""""
|
||||||
|
|
||||||
|
.. autoclass:: Hashtag
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. versionadded:: 4.4
|
||||||
|
|
||||||
|
TopSearchResults
|
||||||
|
""""""""""""""""
|
||||||
|
|
||||||
|
.. autoclass:: TopSearchResults
|
||||||
|
:no-show-inheritance:
|
||||||
|
|
||||||
|
.. versionadded:: 4.3
|
||||||
|
|
||||||
|
Loading and Saving
|
||||||
|
""""""""""""""""""
|
||||||
|
|
||||||
|
:class:`Post`, :class:`StoryItem`, :class:`Profile`, :class:`Hashtag` and
|
||||||
|
:class:`FrozenNodeIterator` can be saved and loaded to/from JSON files.
|
||||||
|
|
||||||
|
.. autofunction:: load_structure_from_file
|
||||||
|
|
||||||
|
.. autofunction:: save_structure_to_file
|
Loading…
Reference in New Issue
Block a user