From 64902f518e75411eaee86107d8b93c07d95200be Mon Sep 17 00:00:00 2001 From: pi_allen Date: Mon, 26 Dec 2022 07:46:41 +0100 Subject: [PATCH] [docs] Update links and fix field typo --- docs/configuration.rst | 8 ++++---- gallery_dl/formatter.py | 13 ++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 2e5e7f6a..2fb71b10 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -588,7 +588,7 @@ Description data structure into metadata dictionaries as the given name. For example, setting this option to ``"gdl_path"`` would make it possible - to access the current file's filename as ``"[gdl_path.filename}"``. + to access the current file's filename as ``"{gdl_path.filename}"``. extractor.*.http-metadata @@ -4468,9 +4468,9 @@ Description In addition to the default `LogRecord attributes `__, it is also possible to access the current - `extractor `__, - `job `__, - `path `__, + `extractor `__, + `job `__, + `path `__, and `keywords` objects and their attributes, for example ``"{extractor.url}"``, ``"{path.filename}"``, ``"{keywords.title}"`` * Default: ``"[{name}][{levelname}] {message}"`` diff --git a/gallery_dl/formatter.py b/gallery_dl/formatter.py index 8a45330c..58bf48d0 100644 --- a/gallery_dl/formatter.py +++ b/gallery_dl/formatter.py @@ -60,14 +60,21 @@ class StringFormatter(): - "u": calls str.upper - "c": calls str.capitalize - "C": calls string.capwords - - "j". calls json.dumps + - "g": calls text.slugify() + - "j": calls json.dumps - "t": calls str.strip + - "T": calls util.datetime_to_timestamp_string() - "d": calls text.parse_timestamp - - "U": calls urllib.parse.unescape + - "s": calls str() - "S": calls util.to_string() - - "T": calls util.to_timestamü() + - "U": calls urllib.parse.unescape + - "r": calls repr() + - "a": calls ascii() - Example: {f!l} -> "example"; {f!u} -> "EXAMPLE" + # Go to _CONVERSIONS and _SPECIFIERS below to se all of them, read: + # https://github.com/mikf/gallery-dl/blob/master/docs/formatting.md + Extra Format Specifiers: - "?//": Adds and to the actual value if it evaluates to True.