diff options
| author | 2021-01-11 03:25:41 -0500 | |
|---|---|---|
| committer | 2021-01-11 03:25:41 -0500 | |
| commit | 6335711bbe769b6b9301a88d88790d7a2f8aa82e (patch) | |
| tree | 9122f4da2bcce66fbee1a2f21260a2de53dc4cc7 /gallery_dl/util.py | |
| parent | 87a5aa088ce33a1196ff409b76a9ea8233bdc634 (diff) | |
New upstream version 1.16.3.upstream/1.16.3
Diffstat (limited to 'gallery_dl/util.py')
| -rw-r--r-- | gallery_dl/util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gallery_dl/util.py b/gallery_dl/util.py index d91d29a..ffd686e 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -506,6 +506,7 @@ class Formatter(): - "c": calls str.capitalize - "C": calls string.capwords - "t": calls str.strip + - "d": calls text.parse_timestamp - "U": calls urllib.parse.unquote - "S": calls util.to_string() - Example: {f!l} -> "example"; {f!u} -> "EXAMPLE" @@ -537,6 +538,7 @@ class Formatter(): "c": str.capitalize, "C": string.capwords, "t": str.strip, + "d": text.parse_timestamp, "U": urllib.parse.unquote, "S": to_string, "s": str, @@ -767,13 +769,14 @@ class PathFormat(): restrict = extractor.config("path-restrict", "auto") replace = extractor.config("path-replace", "_") - if restrict == "auto": restrict = "\\\\|/<>:\"?*" if WINDOWS else "/" elif restrict == "unix": restrict = "/" elif restrict == "windows": restrict = "\\\\|/<>:\"?*" + elif restrict == "ascii": + restrict = "^0-9A-Za-z_." self.clean_segment = self._build_cleanfunc(restrict, replace) remove = extractor.config("path-remove", "\x00-\x1f\x7f") |
