diff --git a/docs/configuration.rst b/docs/configuration.rst index cc2bbc90..549e456f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -206,7 +206,7 @@ Default ``"auto"`` Example * ``"/!? (){}"`` - * ``{" ": "_", "/": "-", "|": "-", ":": "-", "*": "+"}`` + * ``{" ": "_", "/": "-", "|": "-", ":": "_-_", "*": "_+_"}`` Description | A string of characters to be replaced with the value of `path-replace `__ @@ -219,7 +219,8 @@ Description depending on the local operating system * ``"unix"``: ``"/"`` * ``"windows"``: ``"\\\\|/<>:\"?*"`` - * ``"ascii"``: ``"^0-9A-Za-z_."`` + * ``"ascii"``: ``"^0-9A-Za-z_."`` (only ASCII digits, letters, underscores, and dots) + * ``"ascii+"``: ``"^0-9@-[\\]-{ #-)+-.;=!}~"`` (all ASCII characters except the ones not allowed by Windows) Note: In a string with 2 or more characters, ``[]^-\`` need to be escaped with backslashes, e.g. ``"\\[\\]"`` diff --git a/gallery_dl/path.py b/gallery_dl/path.py index a14562ab..71927a55 100644 --- a/gallery_dl/path.py +++ b/gallery_dl/path.py @@ -98,6 +98,8 @@ class PathFormat(): restrict = "\\\\|/<>:\"?*" elif restrict == "ascii": restrict = "^0-9A-Za-z_." + elif restrict == "ascii+": + restrict = "^0-9@-[\\]-{ #-)+-.;=!}~" self.clean_segment = self._build_cleanfunc(restrict, replace) remove = config("path-remove", "\x00-\x1f\x7f")