update docs/configuration.rst

- document metadata.indent
- add concrete mappings to object types
- fix lists for code examples
- fix typos
pull/3503/head
Mike Fährmann 2 years ago
parent 3c03928d75
commit b125fcafc5
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -59,13 +59,13 @@ extractor.*.filename
-------------------- --------------------
Type Type
* ``string`` * ``string``
* ``object`` * ``object`` (`condition` -> `format string`_)
Example Example
* .. code:: json .. code:: json
"{manga}_c{chapter}_{page:>03}.{extension}" "{manga}_c{chapter}_{page:>03}.{extension}"
* .. code:: json .. code:: json
{ {
"extension == 'mp4'": "{id}_video.{extension}", "extension == 'mp4'": "{id}_video.{extension}",
@ -117,13 +117,13 @@ extractor.*.directory
--------------------- ---------------------
Type Type
* ``list`` of ``strings`` * ``list`` of ``strings``
* ``object`` * ``object`` (`condition` -> `format strings`_)
Example Example
* .. code:: json .. code:: json
["{category}", "{manga}", "c{chapter} - {title}"] ["{category}", "{manga}", "c{chapter} - {title}"]
* .. code:: json .. code:: json
{ {
"'nature' in content": ["Nature Pictures"], "'nature' in content": ["Nature Pictures"],
@ -201,7 +201,7 @@ extractor.*.path-restrict
------------------------- -------------------------
Type Type
* ``string`` * ``string``
* ``object`` * ``object`` (`character` -> `replacement character(s)`)
Default Default
``"auto"`` ``"auto"``
Example Example
@ -281,7 +281,7 @@ Description
extractor.*.extension-map extractor.*.extension-map
------------------------- -------------------------
Type Type
``object`` ``object`` (`extension` -> `replacement`)
Default Default
.. code:: json .. code:: json
@ -416,7 +416,7 @@ extractor.*.cookies
------------------- -------------------
Type Type
* |Path|_ * |Path|_
* ``object`` * ``object`` (`name` -> `value`)
* ``list`` * ``list``
Description Description
Source to read additional cookies from. This can be Source to read additional cookies from. This can be
@ -467,7 +467,7 @@ extractor.*.proxy
----------------- -----------------
Type Type
* ``string`` * ``string``
* ``object`` * ``object`` (`scheme` -> `proxy`)
Default Default
``null`` ``null``
Description Description
@ -550,11 +550,11 @@ Description
extractor.*.keywords extractor.*.keywords
-------------------- --------------------
Type Type
``object`` ``object`` (`name` -> `value`)
Example Example
``{"type": "Pixel Art", "type_id": 123}`` ``{"type": "Pixel Art", "type_id": 123}``
Description Description
Additional key-value pairs to be added to each metadata dictionary. Additional name-value pairs to be added to each metadata dictionary.
extractor.*.keywords-default extractor.*.keywords-default
@ -1814,7 +1814,7 @@ Description
extractor.mangadex.api-parameters extractor.mangadex.api-parameters
--------------------------------- ---------------------------------
Type Type
``object`` ``object`` (`name` -> `value`)
Example Example
``{"order[updatedAt]": "desc"}`` ``{"order[updatedAt]": "desc"}``
Description Description
@ -2105,7 +2105,7 @@ Type
Default Default
``"auto"`` ``"auto"``
Description Description
Specifies the domain used by ``pinterest`` extractots. Specifies the domain used by ``pinterest`` extractors.
Setting this option to ``"auto"`` Setting this option to ``"auto"``
uses the same domain as a given input URL. uses the same domain as a given input URL.
@ -3113,7 +3113,7 @@ Description
extractor.ytdl.raw-options extractor.ytdl.raw-options
-------------------------- --------------------------
Type Type
``object`` ``object`` (`name` -> `value`)
Example Example
.. code:: json .. code:: json
@ -3349,13 +3349,14 @@ downloader.*.proxy
------------------ ------------------
Type Type
* ``string`` * ``string``
* ``object`` * ``object`` (`scheme` -> `proxy`)
Default Default
`extractor.*.proxy`_ `extractor.*.proxy`_
Description Description
Proxy server used for file downloads. Proxy server used for file downloads.
Disable the use of a proxy by explicitly setting this option to ``null``. Disable the use of a proxy for file downloads
by explicitly setting this option to ``null``.
downloader.http.adjust-extensions downloader.http.adjust-extensions
@ -3393,7 +3394,7 @@ Description
downloader.http.headers downloader.http.headers
----------------------- -----------------------
Type Type
``object`` ``object`` (`name` -> `value`)
Example Example
``{"Accept": "image/webp,*/*", "Referer": "https://example.org/"}`` ``{"Accept": "image/webp,*/*", "Referer": "https://example.org/"}``
Description Description
@ -3490,7 +3491,7 @@ Description
downloader.ytdl.raw-options downloader.ytdl.raw-options
--------------------------- ---------------------------
Type Type
``object`` ``object`` (`name` -> `value`)
Example Example
.. code:: json .. code:: json
@ -3538,7 +3539,7 @@ output.mode
----------- -----------
Type Type
* ``string`` * ``string``
* ``object`` * ``object`` (`key` -> `format string`)
Default Default
``"auto"`` ``"auto"``
Description Description
@ -3607,7 +3608,7 @@ Description
output.colors output.colors
------------- -------------
Type Type
``object`` ``object`` (`key` -> `ANSI color`)
Default Default
``{"success": "1;32", "skip": "2"}`` ``{"success": "1;32", "skip": "2"}``
Description Description
@ -3750,7 +3751,7 @@ and `event <exec.event_>`__ field:
classify.mapping classify.mapping
---------------- ----------------
Type Type
``object`` ``object`` (`directory` -> `extensions`)
Default Default
.. code:: json .. code:: json
@ -3869,8 +3870,7 @@ Default
Description Description
Selects how to process metadata. Selects how to process metadata.
* ``"json"``: write metadata using `json.dump() * ``"json"``: write metadata using |json.dump()|_
<https://docs.python.org/3/library/json.html#json.dump>`__
* ``"jsonl"``: write metadata in `JSON Lines * ``"jsonl"``: write metadata in `JSON Lines
<https://jsonlines.org/>`__ format <https://jsonlines.org/>`__ format
* ``"tags"``: write ``tags`` separated by newlines * ``"tags"``: write ``tags`` separated by newlines
@ -3974,11 +3974,11 @@ Type
* ``list`` of ``strings`` * ``list`` of ``strings``
* ``object`` (`field name` -> `format string`_) * ``object`` (`field name` -> `format string`_)
Example Example
* .. code:: json .. code:: json
["blocked", "watching", "status[creator][name]"] ["blocked", "watching", "status[creator][name]"]
* .. code:: json .. code:: json
{ {
"blocked" : "***", "blocked" : "***",
@ -4008,6 +4008,21 @@ Description
Note: Only applies for ``"mode": "custom"``. Note: Only applies for ``"mode": "custom"``.
metadata.indent
---------------
Type
* ``integer``
* ``string``
Default
``4``
Description
Indentation level of JSON output.
See the ``indent`` argument of |json.dump()|_ for further details.
Note: Only applies for ``"mode": "json"``.
metadata.open metadata.open
------------- -------------
Type Type
@ -4021,18 +4036,7 @@ Description
use ``"a"`` to append to a file's content use ``"a"`` to append to a file's content
or ``"w"`` to truncate it. or ``"w"`` to truncate it.
See the ``mode`` parameter of |open()|_ for further details. See the ``mode`` argument of |open()|_ for further details.
metadata.private
----------------
Type
``bool``
Default
``false``
Description
Include private fields,
i.e. fields whose name starts with an underscore.
metadata.encoding metadata.encoding
@ -4044,7 +4048,18 @@ Defsult
Description Description
Name of the encoding used to encode a file's content. Name of the encoding used to encode a file's content.
See the ``encoding`` parameter of |open()|_ for further details. See the ``encoding`` argument of |open()|_ for further details.
metadata.private
----------------
Type
``bool``
Default
``false``
Description
Include private fields,
i.e. fields whose name starts with an underscore.
metadata.archive metadata.archive
@ -4546,7 +4561,7 @@ Description
* If given as a single ``float``, it will be used as that exact value. * If given as a single ``float``, it will be used as that exact value.
* If given as a ``list`` with 2 floating-point numbers ``a`` & ``b`` , * If given as a ``list`` with 2 floating-point numbers ``a`` & ``b`` ,
it will be randomly chosen with uniform distribution such that ``a <= N <=b``. it will be randomly chosen with uniform distribution such that ``a <= N <= b``.
(see `random.uniform() <https://docs.python.org/3/library/random.html#random.uniform>`_) (see `random.uniform() <https://docs.python.org/3/library/random.html#random.uniform>`_)
* If given as a ``string``, it can either represent a single ``float`` * If given as a ``string``, it can either represent a single ``float``
value (``"2.85"``) or a range (``"1.5-3.0"``). value (``"2.85"``) or a range (``"1.5-3.0"``).
@ -4711,6 +4726,7 @@ Description
.. |postprocessors| replace:: ``postprocessors`` .. |postprocessors| replace:: ``postprocessors``
.. |mode: color| replace:: ``"mode": "color"`` .. |mode: color| replace:: ``"mode": "color"``
.. |open()| replace:: the built-in ``open()`` function .. |open()| replace:: the built-in ``open()`` function
.. |json.dump()| replace:: ``json.dump()``
.. _base-directory: `extractor.*.base-directory`_ .. _base-directory: `extractor.*.base-directory`_
.. _date-format: `extractor.*.date-format`_ .. _date-format: `extractor.*.date-format`_
@ -4725,6 +4741,7 @@ Description
.. _strptime: https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior .. _strptime: https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior
.. _webbrowser.open(): https://docs.python.org/3/library/webbrowser.html .. _webbrowser.open(): https://docs.python.org/3/library/webbrowser.html
.. _open(): https://docs.python.org/3/library/functions.html#open .. _open(): https://docs.python.org/3/library/functions.html#open
.. _json.dump(): https://docs.python.org/3/library/json.html#json.dump
.. _mature_content: https://www.deviantart.com/developers/http/v1/20160316/object/deviation .. _mature_content: https://www.deviantart.com/developers/http/v1/20160316/object/deviation
.. _Authentication: https://github.com/mikf/gallery-dl#authentication .. _Authentication: https://github.com/mikf/gallery-dl#authentication
.. _OAuth: https://github.com/mikf/gallery-dl#oauth .. _OAuth: https://github.com/mikf/gallery-dl#oauth

Loading…
Cancel
Save