aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/util.py')
-rw-r--r--gallery_dl/util.py5
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")