Use Post class attributes in filename-pattern

- Added owner_id and mediaid to Post class properties.
- In case of not downloading stories, the attributes of the Post class
  can now be used in filename-pattern, e.g. {post.owner_id} or {post.mediaid}.

Closes #53.
This commit is contained in:
André Koch-Kramer
2017-11-08 15:58:33 +01:00
parent ce13c0c53c
commit e9207f095f
4 changed files with 38 additions and 11 deletions

View File

@@ -10,6 +10,6 @@ https://instaloader.readthedocs.io/
The documentation is created with [Sphinx](http://www.sphinx-doc.org/). To build it, use
```
pip3 install sphinx
pip3 install sphinx sphinx-autodoc-typehints
make html
```

View File

@@ -96,7 +96,8 @@ pattern, the token ``{target}`` is replaced by the target name, and
to the target directory. The default is ``--filename-pattern={date}``.
The tokens ``{target}`` and ``{profile}`` are replaced like in the
dirname pattern. Further, the tokens ``{date}`` and ``{shortcode}`` are
defined.
defined. Additionally, in case of not downloading stories, the attributes of
:class:`.Post` can be used, e.g. ``{post.owner_id}`` or ``{post.mediaid}``.
For example, encode the poster's profile name in the filenames with:

View File

@@ -134,8 +134,11 @@ How to Download
with ``--dirname-pattern``. ``{profile}`` is replaced by the profile name,
``{target}`` is replaced by the target you specified, i.e. either ``:feed``,
``#hashtag`` or the profile name. Also, the fields ``{date}`` and
``{shortcode}`` can be specified. Defaults to ``{date:%Y-%m-%d_%H-%M-%S}``.
See :ref:`filename-specification`.
``{shortcode}`` can be specified. In case of not downloading stories, the
attributes of the :class:`.Post` class can be used in addition, e.g.
``{post.owner_id}`` or ``{post.mediaid}``.
Defaults to
``{date:%Y-%m-%d_%H-%M-%S}``. See :ref:`filename-specification`.
.. option:: --user-agent USER_AGENT